pgpool-II-4.6.0/0000775000175000017500000000000014760010121010313 500000000000000pgpool-II-4.6.0/m4/0000775000175000017500000000000014760010070010636 500000000000000pgpool-II-4.6.0/m4/docbook.m40000664000175000017500000000556714760001620012456 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.6.0/m4/libtool.m40000644000175000017500000105743214760010043012476 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 # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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="$sys_lib_dlsearch_path_spec $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' ;; 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*) 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*) ;; *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 ;; *) _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 ;; 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*) 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 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*) 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.6.0/m4/ltoptions.m40000644000175000017500000003007314760010043013054 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.6.0/m4/ltsugar.m40000644000175000017500000001042414760010043012500 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.6.0/m4/ltversion.m40000644000175000017500000000126214760010043013044 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.6.0/m4/lt~obsolete.m40000644000175000017500000001375614760010043013404 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.6.0/Makefile.in0000664000175000017500000006134414760010050012311 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) AUTHORS COPYING \ ChangeLog INSTALL NEWS README TODO compile config.guess \ config.sub install-sh missing 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 = $(install_sh) -d 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@ AR_FLAGS = @AR_FLAGS@ 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 && $(MAKE) .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.6.0/Makefile.am0000664000175000017500000000040414760007565012307 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 && $(MAKE) .PHONY: docs SUBDIRS = src DIST_SUBDIRS = src doc doc.ja pgpool-II-4.6.0/configure0000775000175000017500000176171114760010047012167 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for pgpool-II 4.6.0. # # 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.6.0' PACKAGE_STRING='pgpool-II 4.6.0' 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 AR_FLAGS 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_ldap 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.6.0 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.6.0:";; 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-ldap build with LDAP 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.6.0 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.6.0, 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" 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_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi # Error out if the compiler does not support C99, as the codebase # relies on that. if test "$ac_cv_prog_cc_c99" = no; then as_fn_error $? "C compiler \"$CC\" does not support C99" "$LINENO" 5 fi 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.6.0' 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 AR_FLAGS="cr" 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*) 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 ;; 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*) 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 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*) 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 # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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="$sys_lib_dlsearch_path_spec $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' ;; 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 #include #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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5 $as_echo_n "checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; } if ${pgac_cv_prog_CC_cflags__Wstringop_truncation+:} false; then : $as_echo_n "(cached) " >&6 else pgac_save_CFLAGS=$CFLAGS pgac_save_CC=$CC CC=${CC} CFLAGS="${NOT_THE_CFLAGS} -Wstringop-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__Wstringop_truncation=yes else pgac_cv_prog_CC_cflags__Wstringop_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__Wstringop_truncation" >&5 $as_echo "$pgac_cv_prog_CC_cflags__Wstringop_truncation" >&6; } if test x"$pgac_cv_prog_CC_cflags__Wstringop_truncation" = x"yes"; then NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" fi if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-stringop-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-ldap was given. if test "${with_ldap+set}" = set; then : withval=$with_ldap; $as_echo "#define USE_LDAP 1" >>confdefs.h fi if test "$with_ldap" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5 $as_echo_n "checking for ldap_bind in -lldap... " >&6; } if ${ac_cv_lib_ldap_ldap_bind+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $EXTRA_LDAP_LIBS $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 ldap_bind (); int main () { return ldap_bind (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldap_ldap_bind=yes else ac_cv_lib_ldap_ldap_bind=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_ldap_ldap_bind" >&5 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; } if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF LIBS="-lldap $LIBS" else as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5 fi for ac_header in ldap.h do : ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default" if test "x$ac_cv_header_ldap_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LDAP_H 1 _ACEOF else as_fn_error $? "header file is required for LDAP" "$LINENO" 5 fi done for ac_func in ldap_initialize do : ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize" if test "x$ac_cv_func_ldap_initialize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LDAP_INITIALIZE 1 _ACEOF fi done 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 for ac_func in PQpingParams do : ac_fn_c_check_func "$LINENO" "PQpingParams" "ac_cv_func_PQpingParams" if test "x$ac_cv_func_PQpingParams" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PQPINGPARAMS 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/tools/watchdog/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.6.0, 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.6.0 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/tools/watchdog/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/watchdog/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.6.0/c-compiler.m40000664000175000017500000006000714760001620012536 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.6.0/c-library.m40000664000175000017500000002507514760001620012376 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 #include #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.6.0/general.m40000664000175000017500000001351014760001620012116 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.6.0/ac_func_accept_argtypes.m40000664000175000017500000000707114760001620015341 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.6.0/configure.ac0000664000175000017500000004170414760010004012527 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([pgpool-II], [4.6.0], [pgpool-hackers@pgpool.net], [pgpool-II]) dnl Checks for programs. AC_PROG_CC AC_PROG_CC_C99() # Error out if the compiler does not support C99, as the codebase # relies on that. if test "$ac_cv_prog_cc_c99" = no; then AC_MSG_ERROR([C compiler "$CC" does not support C99]) fi AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects]) dnl Disallow to rebuild configure. AM_MAINTAINER_MODE(disable) # AC_PROG_RANLIB AR_FLAGS="cr" AC_SUBST(AR_FLAGS) 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 PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wstringop-truncation]) if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-stringop-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(ldap, [ --with-ldap build with LDAP support], [AC_DEFINE([USE_LDAP], 1, [Define to 1 to build with LDAP support. (--with-ldap)])]) if test "$with_ldap" = yes ; then AC_CHECK_LIB(ldap, ldap_bind, [], [AC_MSG_ERROR([library 'ldap' is required for LDAP])], [$EXTRA_LDAP_LIBS]) AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR([header file is required for LDAP])]) AC_CHECK_FUNCS([ldap_initialize]) 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) AC_CHECK_FUNCS(PQpingParams) 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/tools/watchdog/Makefile src/watchdog/Makefile]) pgpool-II-4.6.0/aclocal.m40000664000175000017500000007422714760010046012115 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.6.0/AUTHORS0000664000175000017500000000017314760001620011310 00000000000000Authors of pgpool pgpool was originally written by Tatsuo Ishii, then was contributed to pgpool Global Development Group. pgpool-II-4.6.0/COPYING0000664000175000017500000000123214760001620011270 00000000000000Copyright (c) 2003-2021 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.6.0/ChangeLog0000664000175000017500000000001214760001620012002 00000000000000See NEWS. pgpool-II-4.6.0/INSTALL0000664000175000017500000003660014760001620011275 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.6.0/NEWS0000664000175000017500000153567114760007565010776 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 inconsistent 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_backend() 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". (Tatsuo 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 inconsistency 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. (Tatsuo 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 unavailability. (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 possible hang during health checking. (bug 204) (Yugo Nagata) Health 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 checking 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 documentation bug about raw mode. (Yugo Nagata, Bo Peng) Connection pool is available 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 happen if we execute an extended protocol query and it fails. After an error is received the "ignore till sync flag" is set and retained even if sync message was actually received. Thus any subsequent query (in the case above "DEALLOCATE message") is not processed and pgpool waits for message from frontend and backend, and pgpool sticks 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) (Tatsuo 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 distinguishable 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 unavailability. (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 documentation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is available 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 possible hang during health checking (Yugo Nagata) Health 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 checking 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 distinguishable 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 memory 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 happened 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 extended 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. -- Multiple 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 alarm 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 table 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 segfault that occurs when function is used in FROM clause (Yugo Nagata) PREPARE statements in streaming-reapplication 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 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 - 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 quotation (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 documentation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is available 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 possible hang during health checking (Yugo Nagata) Health 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 checking 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 memory 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 alarm 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 table 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 quotation (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 distinguishable 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 segfault that occurs when function is used in FROM clause (Yugo Nagata) PREPARE statements in streaming-reapplication 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 healthcheck 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 healthcheck 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_ifconfig (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 balancing (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 occurs 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 reported in [pgpool-general: 3325]. - Change the log level of "Frontend Terminated" message to DEBUG1 from LOG (Muhammad Usama) - Fix ill signal behavior 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 reported 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 parameter "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 documentation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is available 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 possible hang during health checking (Yugo Nagata) Health 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 checking 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 memory 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 alarm 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 table 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 quotation (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 distinguishable 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 healthcheck 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 balancing (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 occasional 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 behavior 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 process, 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]. - Disable 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 recommended 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 explicit 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 debug 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 additional 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 whose 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 included 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 Multiple 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 coverity 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 pgpool-II and PostgreSQL in the. spec file. (Nozomi Anzai) - Fix resource leak in make_persistent_db_connection. (Tatsuo Ishii) For this purpose, 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 following 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 monitoring 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 monitoring 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 empty, virtual 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 installation method is still preserved. Note: extension names are "pgpool_recovery" and "pgpool_regclass", not "pgpool-recovery" and "pgpool-regclass" because letters are not convenient in using CREATE EXTENSION command (requires double quotes). - Add a function "pgpool_pgctl()" which enables 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 completion 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 existing 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 degenerate 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 fails because there's no oid table entry for t2. Problem is, it fails to check oid table for t1. So cache 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 occurs 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 function 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 documentation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is available 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 possible hang during health checking (Yugo Nagata) Health 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 checking 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 - Disable 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 explicit 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 additional 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 whose 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 included 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 Multiple 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 coverity 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. (Tatsuo Ishii) For this purpose, 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 occurs 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 completion 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 existing 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 degenerate 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 fails because there's no oid table entry for t2. Problem is, it fails to check oid table for t1. So cache 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 usable 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 freed 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 primary 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_regclass 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, manually 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 array is used to keep temporary cache results in a transaction. If there are more than 128 SELECTs in a transaction, the module expands cache_array 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 obsoleted. 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_detach_node (Tatsuo Ishii) When node status is changed by pcp_attach_node and pcp_detach_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 segmentation 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 incorrectly 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. (Tatsuo 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() refers 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 problem 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 pgpool 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 receive 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 extension. 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 infinite 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 detail. #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 exiting 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 involved, 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 performance 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 triggers, 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 memory 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 failed 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. (Tatsuo) This is useful 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(). (Tatsuo Ishii) - Fix on memory query cache section's comments in pgpool.com in the way which other sections employ. (Tatsuo 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. (Tatsuo 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 statement 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 consumed. (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 documentation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is available 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 possible hang during health checking (Yugo Nagata) Health 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 checking 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]. - Disable 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 additional 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 whose 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 included 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 Multiple 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. (Tatsuo Ishii) For this purpose, 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 completion 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 existing 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 degenerate 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 freed 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 primary 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_regclass 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_detach_node (Tatsuo Ishii) When node status is changed by pcp_attach_node and pcp_detach_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 segmentation 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() refers 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 infinite 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 statement 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 relcache 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 standby 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 segfault. - 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 length == 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 necessary 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 disconnect existing sessions in streaming replication mode. In other mode, pcp_attach_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]. - Disable 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 additional 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 whose 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 included 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 Multiple 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. (Tatsuo Ishii) For this purpose, 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 completion 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 existing 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 degenerate 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 freed 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 primary 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_regclass 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 segmentation 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() refers 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 infinite 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 statement 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 relcache 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_recovery() 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 pgpool-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) - "Gracefully detach" option is added to pcp_detach_node. With this option, pcp_detach_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 transferred(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 health 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 parallel query. Patch contributed 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 identified 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 useful because PostgreSQL does not log particular statement if the error was detected *before* raw parser get executed. This typically 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 occasionally 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 frontend 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 includes 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 performance 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 default 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 behavior 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 unnecessary lock(Tatsuo Ishii) - Remove init script from all runlevels before uninstall(Devrim) - Fix pgpool.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 pgpool.conf. This will take effect for next client sessions(Tatsuo Ishii) - Reply with useful error messages, rather than "server closed the connection unexpectedly" when authentication fails(Glyn Astill) - Add info to logs when writing to sockets fails 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 infinite 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 affects visible change to applications. 2.2.3 unconditionally sends param packet to client even it uses version 2 protocol, which is apparently 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 statement_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 important fix is made to avoid data inconsistency risk, which could happen when client does not exit gracefully(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 inconsistency(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 insert_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) - Enhance kind mismatch error message to include original 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 FreeBSD(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 erroneous 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 statement 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 parser 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 reliability 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 number 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) - Occasionally, 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 replicate 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.6.0/README0000664000175000017500000000004014760001620011111 00000000000000See the file doc/pgpool-en.html pgpool-II-4.6.0/TODO0000664000175000017500000000452014760007565010746 00000000000000$Header$ * General - Reset application name to "pgpool" 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 efficient cache (memcache?) * Log - Multiple 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 PostgreSQL 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.6.0/compile0000755000175000017500000001624514760010050011620 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 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 # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" 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.6.0/config.guess0000755000175000017500000013036114760010050012556 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-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 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 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # 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 # # Please send patches with a ChangeLog entry to config-patches@gnu.org. 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 1992-2013 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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # 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 ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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 ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${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-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} 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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 ;; x86_64:Haiku:*:*) echo x86_64-unknown-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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi 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 case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi 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 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.6.0/config.sub0000755000175000017500000010531514760010050012222 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # 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 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 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # 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 1992-2013 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-musl* | 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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | 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 | microblazeel | 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 \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | 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-* | arceb-* \ | 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-* | microblazeel-* \ | 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-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | 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 ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; 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-* | ppc64p7-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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* | -plan9* \ | -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* \ | -bitrig* | -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* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -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 ;; -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 ;; hexagon-*) os=-elf ;; 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 ;; or1k-*) 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.6.0/install-sh0000755000175000017500000003325514760010050012246 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # 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-writable 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.6.0/missing0000755000175000017500000001533114760010050011634 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man 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 # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # 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.6.0/ltmain.sh0000644000175000017500000105152214760010043012062 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 # 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 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% $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" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi 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 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 ;; 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.6.0/src/0000775000175000017500000000000014760010077011114 500000000000000pgpool-II-4.6.0/src/auth/0000775000175000017500000000000014760010070012046 500000000000000pgpool-II-4.6.0/src/auth/md5.c0000664000175000017500000002501414760007565012640 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 hexadecimal * 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.6.0/src/auth/pool_auth.c0000664000175000017500000017701514760007565014156 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 #include "context/pool_session_context.h" #include "protocol/pool_process_query.h" #include "protocol/pool_proto_modules.h" #include "utils/pool_stream.h" #include "pool_config.h" #include "auth/pool_auth.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" #include #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 = MAIN_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)); MAIN(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(MAIN(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 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(MAIN(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(MAIN(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(MAIN(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, MAIN(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, MAIN(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 = MAIN_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 (MAIN(cp)->auth_kind) { case AUTH_REQ_OK: /* trust */ break; case AUTH_REQ_PASSWORD: /* clear text password */ do_clear_text_password(MAIN(cp), frontend, 1, protoMajor); break; case AUTH_REQ_CRYPT: /* crypt password */ do_crypt(MAIN(cp), frontend, 1, protoMajor); break; case AUTH_REQ_MD5: /* md5 password */ authenticate_frontend_md5(MAIN(cp), frontend, 1, protoMajor); break; case AUTH_REQ_SASL: /* SCRAM */ authenticate_frontend_SCRAM(MAIN(cp), frontend, 1); break; default: ereport(ERROR, (errmsg("authentication failed"), errdetail("unknown authentication request code %d", MAIN(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, MAIN_CONNECTION(cp)->pid, MAIN_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(MAIN_CONNECTION(cp)->sp->user) + 100; errmessage = (char *) palloc(messagelen + 1); snprintf(errmessage, messagelen, "password authentication failed for user \"%s\"", MAIN_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 password, 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_MAIN_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)); } /* main? */ if (IS_MAIN_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("failed 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; } /* * Authenticate frontend using pool_hba.conf */ 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_LDAP case uaLDAP: break; #endif /* USE_LDAP */ } } #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"))); } /* main? */ if (IS_MAIN_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_MAIN_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; } 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"))); } /* main? */ if (frontend && IS_MAIN_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.6.0/src/auth/pool_passwd.c0000664000175000017500000003736614760007565014522 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. * * 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; if (pool_passwd_filename == NULL) { saved_passwd_filename[0] = '\0'; /* indicate pool_passwd is disabled */ 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:\"%m\""))); } } /* * 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) { if (strlen(saved_passwd_filename)) ereport(ERROR, (errmsg("unable to get password, password file descriptor is NULL"))); else return 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:password[: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) { if (strlen(saved_passwd_filename)) 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 user 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 string 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; /* * To prevent file-swapping due to file race conditions, * we open the key file before checking it by stat(). */ /* If password file cannot be opened, ignore it. */ if ( (fp = fopen(key_file_path, "r")) == NULL) return NULL; if (fstat(fileno(fp), &stat_buf) != 0) { ereport(WARNING, (errmsg("failed to stat pool key file"), errdetail("fstat failed with reason: \"%m\""))); fclose(fp); 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))); fclose(fp); 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", key_file_path))); /* do we want to allow unsecure pool key file ? */ /* fclose(fp); */ /* 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 } /* * Check password type is md5 hashed or not. recovery_password and * wd_lifecheck_password are not allowed to be md5 hashed format. * The kind of returns of this function is follow; * 0: password is not md5 hashed * -1: password is md5 hashed * -2: password is not found */ int chceck_password_type_is_not_md5(char *username, char *password_in_config) { PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; /* * if the password specified in config is empty string or NULL look for the * password in pool_passwd file */ if (password_in_config == NULL || strlen(password_in_config) == 0) { PasswordMapping *password_mapping = NULL; password_mapping = pool_get_user_credentials(username); if (password_mapping == NULL) { return -2; } passwordType = password_mapping->pgpoolUser.passwordType; delete_passwordMapping(password_mapping); } else { passwordType = get_password_type(password_in_config); } /* if the password type is MD5 hash return -1*/ if (passwordType == PASSWORD_TYPE_MD5) { return -1; } return 0; } pgpool-II-4.6.0/src/auth/pool_hba.c0000664000175000017500000024432214760007565013743 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 "auth/pool_auth.h" #include "protocol/pool_connection_pool.h" #include "utils/pool_path.h" #include "utils/pool_ip.h" #include "utils/pool_stream.h" #include "utils/pool_signal.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" #include "protocol/pool_process_query.h" #ifdef USE_LDAP #define LDAP_DEPRECATED 1 #include #endif #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 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); static struct pam_conv pam_passwd_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 */ #ifdef USE_LDAP #define LDAP_DEPRECATED 1 #include static POOL_STATUS CheckLDAPAuth(POOL_CONNECTION *frontend); /* LDAP_OPT_DIAGNOSTIC_MESSAGE is the newer spelling */ #ifndef LDAP_OPT_DIAGNOSTIC_MESSAGE #define LDAP_OPT_DIAGNOSTIC_MESSAGE LDAP_OPT_ERROR_STRING #endif #endif /* USE_LDAP */ #if defined(USE_PAM) || defined(USE_LDAP) /* * recv_password_packet is usually used with authentications that require a client * password. However, pgpool's hba function uses it for PAM or LDAP authentication, * so declare a prototype here in "#if defined(USE_PAM or USE_LDAP)" to avoid * compilation warning. */ static char *recv_password_packet(POOL_CONNECTION * frontend); #endif /* USE_PAM or USE_LDAP */ /* * 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; } /* * Macros used to check and report on invalid configuration options. * On error: log a message at level elevel, set *err_msg, and exit the function. * These macros are not as general-purpose as they look, because they know * what the calling function's error-exit value is. * * INVALID_AUTH_OPTION = reports when an option is specified for a method where it's * not supported. * REQUIRE_AUTH_OPTION = same as INVALID_AUTH_OPTION, except it also checks if the * method is actually the one specified. Used as a shortcut when * the option is only valid for one authentication method. * MANDATORY_AUTH_ARG = check if a required option is set for an authentication method, * reporting error if it's not. */ #define INVALID_AUTH_OPTION(optname, validmethods) \ do { \ ereport(elevel, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ /* translator: the second %s is a list of auth methods */ \ errmsg("authentication option \"%s\" is only valid for authentication methods %s", \ optname, _(validmethods)), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ *err_msg = psprintf("authentication option \"%s\" is only valid for authentication methods %s", \ optname, validmethods); \ return false; \ } while (0) #define REQUIRE_AUTH_OPTION(methodval, optname, validmethods) \ do { \ if (hbaline->auth_method != methodval) \ INVALID_AUTH_OPTION(optname, validmethods); \ } while (0) #define MANDATORY_AUTH_ARG(argvar, argname, authname) \ do { \ if (argvar == NULL) { \ ereport(elevel, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ errmsg("authentication method \"%s\" requires argument \"%s\" to be set", \ authname, argname), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ *err_msg = psprintf("authentication method \"%s\" requires argument \"%s\" to be set", \ authname, argname); \ return NULL; \ } \ } while (0) 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(tok_line->fields, 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(tok_line->fields, 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(tok_line->fields, 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(tok_line->fields, 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(tok_line->fields, 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 #ifdef USE_LDAP else if (strcmp(token->string, "ldap") == 0) parsedline->auth_method = uaLDAP; #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(tok_line->fields, 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); } } #ifdef USE_LDAP /* * Check if the selected authentication method has any mandatory arguments * that are not set. */ if (parsedline->auth_method == uaLDAP) { #ifndef HAVE_LDAP_INITIALIZE /* Not mandatory for OpenLDAP, because it can use DNS SRV records */ MANDATORY_AUTH_ARG(parsedline->ldapserver, "ldapserver", "ldap"); #endif /* * LDAP can operate in two modes: either with a direct bind, using * ldapprefix and ldapsuffix, or using a search+bind, using * ldapbasedn, ldapbinddn, ldapbindpasswd and one of * ldapsearchattribute or ldapsearchfilter. Disallow mixing these * parameters. */ if (parsedline->ldapprefix || parsedline->ldapsuffix) { if (parsedline->ldapbasedn || parsedline->ldapbinddn || parsedline->ldapbindpasswd || parsedline->ldapsearchattribute || parsedline->ldapsearchfilter) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("cannot use ldapbasedn, ldapbinddn, ldapbindpasswd, ldapsearchattribute, ldapsearchfilter, or ldapurl together with ldapprefix"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "cannot use ldapbasedn, ldapbinddn, ldapbindpasswd, ldapsearchattribute, ldapsearchfilter, or ldapurl together with ldapprefix"; return NULL; } } else if (!parsedline->ldapbasedn) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("authentication method \"ldap\" requires argument \"ldapbasedn\", \"ldapprefix\", or \"ldapsuffix\" to be set"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "authentication method \"ldap\" requires argument \"ldapbasedn\", \"ldapprefix\", or \"ldapsuffix\" to be set"; return NULL; } /* * When using search+bind, you can either use a simple attribute * (defaulting to "uid") or a fully custom search filter. You can't * do both. */ if (parsedline->ldapsearchattribute && parsedline->ldapsearchfilter) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("cannot use ldapsearchattribute together with ldapsearchfilter"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "cannot use ldapsearchattribute together with ldapsearchfilter"; return NULL; } } #endif 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; #ifdef USE_LDAP hbaline->ldapscope = LDAP_SCOPE_SUBTREE; #endif 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 if (strcmp(name, "ldapurl") == 0) { #ifdef USE_LDAP #ifdef LDAP_API_FEATURE_X_OPENLDAP LDAPURLDesc *urldata; int rc; #endif REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap"); #ifdef LDAP_API_FEATURE_X_OPENLDAP rc = ldap_url_parse(val, &urldata); if (rc != LDAP_SUCCESS) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("could not parse LDAP URL \"%s\": %s", val, ldap_err2string(rc)))); *err_msg = psprintf("could not parse LDAP URL \"%s\": %s", val, ldap_err2string(rc)); return false; } if (strcmp(urldata->lud_scheme, "ldap") != 0 && strcmp(urldata->lud_scheme, "ldaps") != 0) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("unsupported LDAP URL scheme: %s", urldata->lud_scheme))); *err_msg = psprintf("unsupported LDAP URL scheme: %s", urldata->lud_scheme); ldap_free_urldesc(urldata); return false; } if (urldata->lud_scheme) hbaline->ldapscheme = pstrdup(urldata->lud_scheme); if (urldata->lud_host) hbaline->ldapserver = pstrdup(urldata->lud_host); hbaline->ldapport = urldata->lud_port; if (urldata->lud_dn) hbaline->ldapbasedn = pstrdup(urldata->lud_dn); if (urldata->lud_attrs) hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */ hbaline->ldapscope = urldata->lud_scope; if (urldata->lud_filter) hbaline->ldapsearchfilter = pstrdup(urldata->lud_filter); ldap_free_urldesc(urldata); #else /* not OpenLDAP */ ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("LDAP URLs not supported on this platform"))); *err_msg = "LDAP URLs not supported on this platform"; #endif /* not OpenLDAP */ #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldaptls") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldaptls", "ldap"); if (strcmp(val, "1") == 0) hbaline->ldaptls = true; else hbaline->ldaptls = false; #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapscheme") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapscheme", "ldap"); if (strcmp(val, "ldap") != 0 && strcmp(val, "ldaps") != 0) ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid ldapscheme value: \"%s\"", val), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); hbaline->ldapscheme = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapserver") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapserver", "ldap"); hbaline->ldapserver = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapport") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapport", "ldap"); hbaline->ldapport = atoi(val); if (hbaline->ldapport == 0) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid LDAP port number: \"%s\"", val), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid LDAP port number: \"%s\"", val); return false; } #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapbinddn") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapbinddn", "ldap"); hbaline->ldapbinddn = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapbindpasswd") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapbindpasswd", "ldap"); hbaline->ldapbindpasswd = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapsearchattribute") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapsearchattribute", "ldap"); hbaline->ldapsearchattribute = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapsearchfilter") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapsearchfilter", "ldap"); hbaline->ldapsearchfilter = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapbasedn") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapbasedn", "ldap"); hbaline->ldapbasedn = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapprefix") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapprefix", "ldap"); hbaline->ldapprefix = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "ldapsuffix") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "ldapsuffix", "ldap"); hbaline->ldapsuffix = pstrdup(val); #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } else if (strcmp(name, "backend_use_passwd") == 0) { #ifdef USE_LDAP REQUIRE_AUTH_OPTION(uaLDAP, "backend_use_passwd", "ldap"); if (strcmp(val, "1") == 0) hbaline->backend_use_passwd = true; else hbaline->backend_use_passwd = false; #else /* USE_LDAP */ ereport(elevel, (errmsg("ldap authentication option can only be configured for authentication method \"ldap\""), errhint("Compile with --with-ldap to use LDAP authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "ldap authentication option cannot be used because LDAP is not supported by this build"; #endif /* USE_LDAP */ } 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 */ #ifdef USE_LDAP case uaLDAP: status = CheckLDAPAuth(frontend); break; #endif /* USE_LDAP */ 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); /* do authentication against frontend */ 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); } #if defined(USE_PAM) || defined(USE_LDAP) /* * 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 or USE_LDAP */ /* * 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_LDAP */ #ifdef USE_LDAP case uaLDAP: snprintf(errmessage, messagelen, "LDAP authentication with pgpool failed for user \"%s\"", frontend->username); break; #endif /* USE_LDAP */ 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"))); } /* * 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 friends * 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_passwd_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_passwd_conv, &pamh); else retval = pam_start(PGPOOL_PAM_SERVICE, "pgpool@", &pam_passwd_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_passwd_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 USE_LDAP /* * Add a detail error message text to the current error if one can be * constructed from the LDAP 'diagnostic message'. */ static int errdetail_for_ldap(LDAP *ldap) { char *message; int rc; rc = ldap_get_option(ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, &message); if (rc == LDAP_SUCCESS && message != NULL) { errdetail("LDAP diagnostics: %s", message); ldap_memfree(message); } return 0; } static int InitializeLDAPConnection(POOL_CONNECTION *frontend, LDAP **ldap) { const char *scheme; int ldapversion = LDAP_VERSION3; int r; scheme = frontend->pool_hba->ldapscheme; if (scheme == NULL) scheme = "ldap"; #ifdef HAVE_LDAP_INITIALIZE /* * OpenLDAP provides a non-standard extension ldap_initialize() that takes * a list of URIs, allowing us to request "ldaps" instead of "ldap". It * also provides ldap_domain2hostlist() to find LDAP servers automatically * using DNS SRV. They were introduced in the same version, so for now we * don't have an extra configure check for the latter. */ { StringInfoData uris; char *hostlist = NULL; char *p; bool append_port; /* We'll build a space-separated scheme://hostname:port list here */ initStringInfo(&uris); /* * If pg_hba.conf provided no hostnames, we can ask OpenLDAP to try to * find some by extracting a domain name from the base DN and looking * up DSN SRV records for _ldap._tcp.. */ if (!frontend->pool_hba->ldapserver || frontend->pool_hba->ldapserver[0] == '\0') { char *domain; /* ou=blah,dc=foo,dc=bar -> foo.bar */ if (ldap_dn2domain(frontend->pool_hba->ldapbasedn, &domain)) { ereport(LOG, (errmsg("could not extract domain name from ldapbasedn"))); return -1; } /* Look up a list of LDAP server hosts and port numbers */ if (ldap_domain2hostlist(domain, &hostlist)) { ereport(LOG, (errmsg("LDAP authentication could not find DNS SRV records for \"%s\"", domain), (errhint("Set an LDAP server name explicitly.")))); ldap_memfree(domain); return -1; } ldap_memfree(domain); /* We have a space-separated list of host:port entries */ p = hostlist; append_port = false; } else { /* We have a space-separated list of hosts from pg_hba.conf */ p = frontend->pool_hba->ldapserver; append_port = true; } /* Convert the list of host[:port] entries to full URIs */ do { size_t size; /* Find the span of the next entry */ size = strcspn(p, " "); /* Append a space separator if this isn't the first URI */ if (uris.len > 0) appendStringInfoChar(&uris, ' '); /* Append scheme://host:port */ appendStringInfoString(&uris, scheme); appendStringInfoString(&uris, "://"); appendBinaryStringInfo(&uris, p, size); if (append_port) appendStringInfo(&uris, ":%d", frontend->pool_hba->ldapport); /* Step over this entry and any number of trailing spaces */ p += size; while (*p == ' ') ++p; } while (*p); /* Free memory from OpenLDAP if we looked up SRV records */ if (hostlist) ldap_memfree(hostlist); /* Finally, try to connect using the URI list */ r = ldap_initialize(ldap, uris.data); pfree(uris.data); if (r != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not initialize LDAP: %s", ldap_err2string(r)))); return -1; } } #else if (strcmp(scheme, "ldaps") == 0) { ereport(LOG, (errmsg("ldaps not supported with this LDAP library"))); return -1; } *ldap = ldap_init(frontend->pool_hba->ldapserver, frontend->pool_hba->ldapport); if (!*ldap) { ereport(LOG, (errmsg("could not initialize LDAP: %m"))); return -1; } #endif if ((r = ldap_set_option(*ldap, LDAP_OPT_PROTOCOL_VERSION, &ldapversion)) != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not set LDAP protocol version: %s", ldap_err2string(r)), errdetail_for_ldap(*ldap))); ldap_unbind(*ldap); return -1; } if (frontend->pool_hba->ldaptls) { if ((r = ldap_start_tls_s(*ldap, NULL, NULL)) != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not start LDAP TLS session: %s", ldap_err2string(r)), errdetail_for_ldap(*ldap))); ldap_unbind(*ldap); return -1; } } return 0; } /* Placeholders recognized by FormatSearchFilter. For now just one. */ #define LPH_USERNAME "$username" #define LPH_USERNAME_LEN (sizeof(LPH_USERNAME) - 1) /* Not all LDAP implementations define this. */ #ifndef LDAP_NO_ATTRS #define LDAP_NO_ATTRS "1.1" #endif /* Not all LDAP implementations define this. */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 #endif /* * Return a newly allocated C string copied from "pattern" with all * occurrences of the placeholder "$username" replaced with "user_name". */ static char * FormatSearchFilter(const char *pattern, const char *user_name) { StringInfoData output; initStringInfo(&output); while (*pattern != '\0') { if (strncmp(pattern, LPH_USERNAME, LPH_USERNAME_LEN) == 0) { appendStringInfoString(&output, user_name); pattern += LPH_USERNAME_LEN; } else appendStringInfoChar(&output, *pattern++); } return output.data; } /* * Check authentication against LDAP. */ static POOL_STATUS CheckLDAPAuth(POOL_CONNECTION * frontend) { char *passwd; LDAP *ldap; int r; char *fulluser; const char *server_name; #ifdef HAVE_LDAP_INITIALIZE /* * For OpenLDAP, allow empty hostname if we have a basedn. We'll look for * servers with DNS SRV records via OpenLDAP library facilities. */ if ((!frontend->pool_hba->ldapserver || frontend->pool_hba->ldapserver[0] == '\0') && (!frontend->pool_hba->ldapbasedn || frontend->pool_hba->ldapbasedn[0] == '\0')) { ereport(LOG, (errmsg("LDAP server not specified, and no ldapbasedn"))); return -1; } #else if (!frontend->pool_hba->ldapserver || frontend->pool_hba->ldapserver[0] == '\0') { ereport(LOG, (errmsg("LDAP server not specified"))); return -1; } #endif /* * If we're using SRV records, we don't have a server name so we'll just * show an empty string in error messages. */ server_name = frontend->pool_hba->ldapserver ? frontend->pool_hba->ldapserver : ""; if (frontend->pool_hba->ldapport == 0) { if (frontend->pool_hba->ldapscheme != NULL && strcmp(frontend->pool_hba->ldapscheme, "ldaps") == 0) frontend->pool_hba->ldapport = LDAPS_PORT; else frontend->pool_hba->ldapport = LDAP_PORT; } sendAuthRequest(frontend, AUTH_REQ_PASSWORD); passwd = recv_password_packet(frontend); if (passwd == NULL) return -2; /* client wouldn't send password */ if (InitializeLDAPConnection(frontend, &ldap) == -1) { /* Error message already sent */ pfree(passwd); return -1; } if (frontend->pool_hba->backend_use_passwd) { frontend->pwd_size = strlen(passwd); memcpy(frontend->password, passwd, frontend->pwd_size); frontend->passwordType = PASSWORD_TYPE_PLAINTEXT; } if (frontend->pool_hba->ldapbasedn) { /* * First perform an LDAP search to find the DN for the user we are * trying to log in as. */ char *filter; LDAPMessage *search_message; LDAPMessage *entry; char *attributes[] = {LDAP_NO_ATTRS, NULL}; char *dn; char *c; int count; /* * Disallow any characters that we would otherwise need to escape, * since they aren't really reasonable in a username anyway. Allowing * them would make it possible to inject any kind of custom filters in * the LDAP filter. */ for (c = frontend->username; *c; c++) { if (*c == '*' || *c == '(' || *c == ')' || *c == '\\' || *c == '/') { ereport(LOG, (errmsg("invalid character in user name for LDAP authentication"))); ldap_unbind(ldap); pfree(passwd); return -1; } } /* * Bind with a pre-defined username/password (if available) for * searching. If none is specified, this turns into an anonymous bind. */ r = ldap_simple_bind_s(ldap, frontend->pool_hba->ldapbinddn ? frontend->pool_hba->ldapbinddn : "", frontend->pool_hba->ldapbindpasswd ? frontend->pool_hba->ldapbindpasswd : ""); if (r != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not perform initial LDAP bind for ldapbinddn \"%s\" on server \"%s\": %s", frontend->pool_hba->ldapbinddn ? frontend->pool_hba->ldapbinddn : "", server_name, ldap_err2string(r)), errdetail_for_ldap(ldap))); ldap_unbind(ldap); pfree(passwd); return -1; } /* Build a custom filter or a single attribute filter? */ if (frontend->pool_hba->ldapsearchfilter) filter = FormatSearchFilter(frontend->pool_hba->ldapsearchfilter, frontend->username); else if (frontend->pool_hba->ldapsearchattribute) filter = psprintf("(%s=%s)", frontend->pool_hba->ldapsearchattribute, frontend->username); else filter = psprintf("(uid=%s)", frontend->username); r = ldap_search_s(ldap, frontend->pool_hba->ldapbasedn, frontend->pool_hba->ldapscope, filter, attributes, 0, &search_message); if (r != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not search LDAP for filter \"%s\" on server \"%s\": %s", filter, server_name, ldap_err2string(r)), errdetail_for_ldap(ldap))); ldap_unbind(ldap); pfree(passwd); pfree(filter); return -1; } count = ldap_count_entries(ldap, search_message); if (count != 1) { if (count == 0) ereport(LOG, (errmsg("LDAP user \"%s\" does not exist", frontend->username), errdetail("LDAP search for filter \"%s\" on server \"%s\" returned no entries.", filter, server_name))); else ereport(LOG, (errmsg("LDAP user \"%s\" is not unique", frontend->username), errdetail_plural("LDAP search for filter \"%s\" on server \"%s\" returned %d entry.", "LDAP search for filter \"%s\" on server \"%s\" returned %d entries.", count, filter, server_name, count))); ldap_unbind(ldap); pfree(passwd); pfree(filter); ldap_msgfree(search_message); return -1; } entry = ldap_first_entry(ldap, search_message); dn = ldap_get_dn(ldap, entry); if (dn == NULL) { int error; (void) ldap_get_option(ldap, LDAP_OPT_ERROR_NUMBER, &error); ereport(LOG, (errmsg("could not get dn for the first entry matching \"%s\" on server \"%s\": %s", filter, server_name, ldap_err2string(error)), errdetail_for_ldap(ldap))); ldap_unbind(ldap); pfree(passwd); pfree(filter); ldap_msgfree(search_message); return -1; } fulluser = pstrdup(dn); pfree(filter); ldap_memfree(dn); ldap_msgfree(search_message); /* Unbind and disconnect from the LDAP server */ r = ldap_unbind_s(ldap); if (r != LDAP_SUCCESS) { ereport(LOG, (errmsg("could not unbind after searching for user \"%s\" on server \"%s\"", fulluser, server_name))); pfree(passwd); pfree(fulluser); return -1; } /* * Need to re-initialize the LDAP connection, so that we can bind to * it with a different username. */ if (InitializeLDAPConnection(frontend, &ldap) == -1) { pfree(passwd); pfree(fulluser); /* Error message already sent */ return -1; } } else fulluser = psprintf("%s%s%s", frontend->pool_hba->ldapprefix ? frontend->pool_hba->ldapprefix : "", frontend->username, frontend->pool_hba->ldapsuffix ? frontend->pool_hba->ldapsuffix : ""); r = ldap_simple_bind_s(ldap, fulluser, passwd); if (r != LDAP_SUCCESS) { ereport(LOG, (errmsg("LDAP login failed for user \"%s\" on server \"%s\": %s", fulluser, server_name, ldap_err2string(r)), errdetail_for_ldap(ldap))); ldap_unbind(ldap); pfree(passwd); pfree(fulluser); return -1; } ldap_unbind(ldap); pfree(passwd); pfree(fulluser); return 0; } #endif /* USE_LDAP */ #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.6.0/src/auth/auth-scram.c0000664000175000017500000013365014760007565014225 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. * * 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 "auth/pool_auth.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; } /* * Deterministically 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.6.0/src/config/0000775000175000017500000000000014760010070012352 500000000000000pgpool-II-4.6.0/src/config/pool_config.c0000664000175000017500000017110314760010070014737 00000000000000#line 2 "config/pool_config.c" #line 4 "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[40] = { 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, 7, 7, 6, 4, 4, 0, 5, 0, 0, 8, 7, 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, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 } ; static yyconst flex_int32_t yy_meta[20] = { 0, 1, 1, 2, 1, 1, 1, 3, 3, 3, 4, 4, 1, 5, 6, 5, 1, 3, 5, 3 } ; static yyconst flex_int16_t yy_base[47] = { 0, 0, 0, 66, 115, 59, 115, 57, 15, 24, 40, 28, 35, 115, 40, 50, 48, 115, 17, 115, 21, 36, 0, 12, 0, 52, 0, 54, 8, 66, 0, 24, 39, 40, 13, 17, 0, 0, 4, 115, 83, 89, 92, 96, 102, 104, 108 } ; static yyconst flex_int16_t yy_def[47] = { 0, 39, 1, 39, 39, 39, 39, 40, 41, 39, 42, 39, 11, 39, 43, 39, 40, 39, 41, 39, 44, 42, 11, 11, 21, 39, 45, 39, 46, 43, 29, 41, 41, 44, 39, 39, 27, 27, 46, 0, 39, 39, 39, 39, 39, 39, 39 } ; static yyconst flex_int16_t yy_nxt[135] = { 0, 4, 5, 6, 7, 8, 9, 9, 10, 4, 11, 12, 13, 14, 14, 14, 4, 14, 14, 14, 19, 38, 19, 35, 35, 38, 32, 35, 35, 19, 26, 20, 21, 20, 22, 23, 21, 33, 23, 23, 20, 26, 26, 26, 19, 32, 27, 28, 28, 28, 25, 17, 15, 26, 25, 20, 33, 30, 34, 34, 17, 15, 35, 35, 36, 36, 39, 37, 37, 26, 39, 39, 26, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 30, 16, 16, 16, 16, 16, 16, 18, 39, 18, 18, 18, 18, 24, 39, 24, 29, 29, 29, 29, 31, 39, 31, 31, 31, 31, 26, 26, 28, 28, 28, 28, 3, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 } ; static yyconst flex_int16_t yy_chk[135] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 38, 18, 34, 34, 28, 20, 35, 35, 31, 23, 8, 9, 18, 9, 9, 11, 20, 11, 11, 31, 11, 11, 11, 32, 33, 11, 14, 14, 14, 21, 16, 15, 12, 10, 32, 33, 14, 25, 25, 7, 5, 25, 25, 27, 27, 3, 27, 27, 27, 0, 0, 27, 29, 29, 29, 0, 0, 0, 0, 0, 0, 0, 29, 40, 40, 40, 40, 40, 40, 41, 0, 41, 41, 41, 41, 42, 0, 42, 43, 43, 43, 43, 44, 0, 44, 44, 44, 44, 45, 45, 46, 46, 46, 46, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 } ; 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 "config/pool_config.l" /* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "config/pool_config.l" #include #include #include #include #include "pool.h" #include "pool_config.h" #include "pool_config_variables.h" #include "utils/regex_array.h" #include "utils/pool_path.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 legacy reason pointer to the above struct */ static unsigned Lineno; char config_file_dir[POOLMAXPATHLEN + 1]; /* directory path of config file pgpool.conf */ 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, const char *calling_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); static int growFunctionPatternArray(RegPattern item); static int growMemqcacheTablePatternArray(RegPattern item); static int growQueryPatternArray(RegPattern item); #define YY_NO_INPUT 1 #line 563 "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 96 "config/pool_config.l" #line 746 "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 >= 40 ) 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 != 39 ); 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 98 "config/pool_config.l" Lineno++; return POOL_EOL; YY_BREAK case 2: YY_RULE_SETUP #line 99 "config/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 100 "config/pool_config.l" /* eat comment */ YY_BREAK case 4: YY_RULE_SETUP #line 102 "config/pool_config.l" return POOL_KEY; YY_BREAK case 5: YY_RULE_SETUP #line 103 "config/pool_config.l" return POOL_STRING; YY_BREAK case 6: YY_RULE_SETUP #line 104 "config/pool_config.l" return POOL_UNQUOTED_STRING; YY_BREAK case 7: YY_RULE_SETUP #line 105 "config/pool_config.l" return POOL_INTEGER; YY_BREAK case 8: YY_RULE_SETUP #line 106 "config/pool_config.l" return POOL_REAL; YY_BREAK case 9: YY_RULE_SETUP #line 107 "config/pool_config.l" return POOL_EQUALS; YY_BREAK case 10: YY_RULE_SETUP #line 109 "config/pool_config.l" return POOL_PARSE_ERROR; YY_BREAK case 11: YY_RULE_SETUP #line 111 "config/pool_config.l" ECHO; YY_BREAK #line 884 "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 >= 40 ) 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 >= 40 ) 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 == 39); 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; yy_size_t 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 111 "config/pool_config.l" int pool_init_config(void) { memset(pool_config, 0, sizeof(POOL_CONFIG)); g_pool_config.backend_desc = palloc0(sizeof(BackendDesc)); 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: write_function_list and read_only_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; int pattern_len; /* force case insensitive pattern matching */ regex_flags |= REG_ICASE; /* Add extended regex search */ regex_flags |= REG_EXTENDED; /* Fill the pattern type */ if (strcmp(type, "write_function_list") == 0 || strcmp(type, "primary_routing_query_pattern_list") == 0 || strcmp(type, "cache_unsafe_memqcache_table_list") == 0) { currItem.type = WRITELIST; } else if (strcmp(type, "read_only_function_list") == 0 || strcmp(type, "cache_safe_memqcache_table_list") == 0) { currItem.type = READONLYLIST; } 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 */ pattern_len = sizeof(char)*(strlen(s)+3); currItem.pattern = palloc(pattern_len); /* 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, pattern_len - 2); } else { strncpy(currItem.pattern, s, pattern_len); } 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, "read_only_function_list") == 0 || strcmp(type, "write_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, "cache_safe_memqcache_table_list") == 0 || strcmp(type, "cache_unsafe_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, "primary_routing_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. */ static 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); } static 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); } static 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 * calling_file: absolute path of file containing the "include" directive, * or NULL at outer level (config_file must be absolute at outer level) * depth: recursion depth (used only to prevent infinite recursion) * 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, const char *calling_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p) { FILE *fd; YY_BUFFER_STATE lex_buffer; int token; char *key; char *val; ConfigVariable *item; char buf[POOLMAXPATHLEN + 1]; char *config_filepath; /* * Reject too-deep include nesting depth. */ if (depth > 10) ereport(elevel, (errmsg("could not open configuration file \"%s\": maximum nesting depth exceeded", config_file))); if (depth == 0) { /* get directory path of config file pgpool.conf */ strlcpy(buf, config_file, sizeof(buf)); get_parent_directory(buf); strlcpy(config_file_dir, buf, sizeof(config_file_dir)); } if (calling_file == NULL || is_absolute_path(config_file)) { /* absolute path is taken as-is */ config_filepath = (char *) palloc(strlen(config_file) + 1); strcpy(config_filepath, config_file); config_filepath[strlen(config_file)] = '\0'; } else { /* relative path is relative to dir of calling file */ config_filepath = (char *) palloc(strlen(config_file) + 1 + strlen(calling_file) + 1); strcpy(config_filepath, calling_file); get_parent_directory(config_filepath); join_path_components(config_filepath, config_filepath, config_file); canonicalize_path(config_filepath); } /* open config file */ fd = fopen(config_filepath, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"",config_filepath), errdetail("using default configuration parameter values"))); return false; } lex_buffer = yy_create_buffer(fd,YY_BUF_SIZE); yy_switch_to_buffer(lex_buffer); yyin = fd; Lineno = 1; for(;;) { key = NULL; 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))); if (strcmp(key, "include") == 0) { /* * An include directive isn't a variable and should be processed * immediately. */ unsigned save_Lineno = Lineno; if (!ParseConfigFile(val, config_filepath, depth + 1, elevel, head_p, tail_p)) { goto parse_error; } yy_switch_to_buffer(lex_buffer); Lineno = save_Lineno; } else { /* 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: if (key) pfree(key); fclose(fd); FreeConfigVariables(*head_p); *head_p = NULL; *tail_p = NULL; ereport(elevel, (errmsg("syntax error in configuration file \"%s\"", config_filepath), 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, NULL, 0, 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_PRIMARY & flag) { if (*buf == '\0') snprintf(buf, sizeof(buf), "ALWAYS_PRIMARY"); else snprintf(buf+strlen(buf), sizeof(buf), "|ALWAYS_PRIMARY"); } 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.6.0/src/config/pool_config.l0000664000175000017500000004066014760007565014772 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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" #include "utils/pool_path.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 legacy reason pointer to the above struct */ static unsigned Lineno; char config_file_dir[POOLMAXPATHLEN + 1]; /* directory path of config file pgpool.conf */ 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, const char *calling_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); static int growFunctionPatternArray(RegPattern item); static int growMemqcacheTablePatternArray(RegPattern item); static int growQueryPatternArray(RegPattern item); %} %option 8bit %option never-interactive %option nounput %option noyywrap %option noinput SIGN ("-"|"+") DIGIT [0-9] HEXDIGIT [0-9a-fA-F] UNIT_LETTER [a-zA-Z] INTEGER {SIGN}?({DIGIT}+|0x{HEXDIGIT}+){UNIT_LETTER}* 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)); g_pool_config.backend_desc = palloc0(sizeof(BackendDesc)); 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: write_function_list and read_only_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; int pattern_len; /* force case insensitive pattern matching */ regex_flags |= REG_ICASE; /* Add extended regex search */ regex_flags |= REG_EXTENDED; /* Fill the pattern type */ if (strcmp(type, "write_function_list") == 0 || strcmp(type, "primary_routing_query_pattern_list") == 0 || strcmp(type, "cache_unsafe_memqcache_table_list") == 0) { currItem.type = WRITELIST; } else if (strcmp(type, "read_only_function_list") == 0 || strcmp(type, "cache_safe_memqcache_table_list") == 0) { currItem.type = READONLYLIST; } 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 */ pattern_len = sizeof(char)*(strlen(s)+3); currItem.pattern = palloc(pattern_len); /* 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, pattern_len - 2); } else { strncpy(currItem.pattern, s, pattern_len); } 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, "read_only_function_list") == 0 || strcmp(type, "write_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, "cache_safe_memqcache_table_list") == 0 || strcmp(type, "cache_unsafe_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, "primary_routing_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. */ static 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); } static 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); } static 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 * calling_file: absolute path of file containing the "include" directive, * or NULL at outer level (config_file must be absolute at outer level) * depth: recursion depth (used only to prevent infinite recursion) * 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, const char *calling_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p) { FILE *fd; YY_BUFFER_STATE lex_buffer; int token; char *key; char *val; ConfigVariable *item; char buf[POOLMAXPATHLEN + 1]; char *config_filepath; /* * Reject too-deep include nesting depth. */ if (depth > 10) ereport(elevel, (errmsg("could not open configuration file \"%s\": maximum nesting depth exceeded", config_file))); if (depth == 0) { /* get directory path of config file pgpool.conf */ strlcpy(buf, config_file, sizeof(buf)); get_parent_directory(buf); strlcpy(config_file_dir, buf, sizeof(config_file_dir)); } if (calling_file == NULL || is_absolute_path(config_file)) { /* absolute path is taken as-is */ config_filepath = (char *) palloc(strlen(config_file) + 1); strcpy(config_filepath, config_file); config_filepath[strlen(config_file)] = '\0'; } else { /* relative path is relative to dir of calling file */ config_filepath = (char *) palloc(strlen(config_file) + 1 + strlen(calling_file) + 1); strcpy(config_filepath, calling_file); get_parent_directory(config_filepath); join_path_components(config_filepath, config_filepath, config_file); canonicalize_path(config_filepath); } /* open config file */ fd = fopen(config_filepath, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"",config_filepath), errdetail("using default configuration parameter values"))); return false; } lex_buffer = yy_create_buffer(fd, YY_BUF_SIZE); yy_switch_to_buffer(lex_buffer); yyin = fd; Lineno = 1; for(;;) { key = NULL; 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))); if (strcmp(key, "include") == 0) { /* * An include directive isn't a variable and should be processed * immediately. */ unsigned save_Lineno = Lineno; if (!ParseConfigFile(val, config_filepath, depth + 1, elevel, head_p, tail_p)) { goto parse_error; } yy_switch_to_buffer(lex_buffer); Lineno = save_Lineno; } else { /* 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: if (key) pfree(key); fclose(fd); FreeConfigVariables(*head_p); *head_p = NULL; *tail_p = NULL; ereport(elevel, (errmsg("syntax error in configuration file \"%s\"", config_filepath), 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, NULL, 0, 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_PRIMARY & flag) { if (*buf == '\0') snprintf(buf, sizeof(buf), "ALWAYS_PRIMARY"); else snprintf(buf+strlen(buf), sizeof(buf), "|ALWAYS_PRIMARY"); } 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.6.0/src/config/pool_config_variables.c0000664000175000017500000047642314760007565017023 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 #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_listen_addresses_list "localhost" #define default_pcp_listen_addresses_list "localhost" #define default_unix_socket_directories_list "/tmp" #define default_read_only_function_list "" #define default_write_function_list "" #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 MakeUserRedirectListRegex(char *newval, int elevel); static bool MakeDBRedirectListRegex(char *newval, int elevel); static bool MakeAppRedirectListRegex(char *newval, int elevel); static bool MakeDMLAdaptiveObjectRelationList(char *newval, int elevel); static char* getParsedToken(char *token, DBObjectTypes *object_type); 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 *FilePermissionShowFunc(int value); static const char *UnixSockPermissionsShowFunc(void); static const char *HBDestinationPortShowFunc(int index); static const char *HBDeviceShowFunc(int index); static const char *HBHostnameShowFunc(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 DelegateIPAssignMessage(ConfigContext scontext, char *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 HBDestinationPortAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HBDeviceAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HBHostnameAssignFunc(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 bool SetHBDestIfFunc(int elevel); static bool SetPgpoolNodeId(int elevel); static struct config_generic *get_index_free_record_if_any(struct config_generic *record); static bool parse_int(const char *value, int64 *result, int flags, const char **hintmsg, int64 MaxVal); static bool convert_to_base_unit(double value, const char *unit, int base_unit, double *base_value); #ifndef POOL_PRIVATE static void convert_int_from_base_unit(int64 base_value, int base_unit, int64 *value, const char **unit); /* These functions are used to provide Hints for enum type config parameters and * to output the values of the parameters. * These functions 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 backend_clustering_mode_options[] = { {"streaming_replication", CM_STREAMING_REPLICATION, false}, {"native_replication", CM_NATIVE_REPLICATION, false}, {"logical_replication", CM_LOGICAL_REPLICATION, false}, {"slony", CM_SLONY, false}, {"raw", CM_RAW, false}, {"snapshot_isolation", CM_SNAPSHOT_ISOLATION, false}, {NULL, 0, false} }; static const struct config_enum_entry process_management_mode_options[] = { {"static", PM_STATIC, false}, {"dynamic", PM_DYNAMIC, false}, {NULL, 0, false} }; static const struct config_enum_entry process_management_strategy_options[] = { {"aggressive", PM_STRATEGY_AGGRESSIVE, false}, {"gentle", PM_STRATEGY_GENTLE, false}, {"lazy", PM_STRATEGY_LAZY, 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}, {"dml_adaptive", DLBOW_DML_ADAPTIVE, false}, {NULL, 0, false} }; static const struct config_enum_entry relcache_query_target_options[] = { {"primary", RELQTARGET_PRIMARY, 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 compatibility. */ {"off", CHECK_TEMP_OFF, false}, /* same as CHECK_TEMP_NONE. Just for backward compatibility. */ {NULL, 0, false} }; static const struct config_enum_entry log_backend_messages_options[] = { {"none", BGMSG_NONE, false}, /* turn off logging */ {"terse", BGMSG_TERSE, false}, /* terse logging (repeated messages are collapsed into count */ {"verbose", BGMSG_VERBOSE, false}, /* always log each message */ {NULL, 0, false} }; /* From PostgreSQL's guc.c */ /* * Unit conversion tables. * * There are two tables, one for memory units, and another for time units. * For each supported conversion from one unit to another, we have an entry * in the table. * * To keep things simple, and to avoid possible roundoff error, * conversions are never chained. There needs to be a direct conversion * between all units (of the same type). * * The conversions for each base unit must be kept in order from greatest to * smallest human-friendly unit; convert_xxx_from_base_unit() rely on that. * (The order of the base-unit groups does not matter.) */ #define MAX_UNIT_LEN 3 /* length of longest recognized unit string */ typedef struct { char unit[MAX_UNIT_LEN + 1]; /* unit, as a string, like "kB" or * "min" */ int base_unit; /* GUC_UNIT_XXX */ double multiplier; /* Factor for converting unit -> base_unit */ } unit_conversion; static const char *memory_units_hint = "Valid units for this parameter are \"B\", \"kB\", \"MB\", \"GB\", and \"TB\"."; static const unit_conversion memory_unit_conversion_table[] = { {"TB", GUC_UNIT_BYTE, 1024.0 * 1024.0 * 1024.0 * 1024.0}, {"GB", GUC_UNIT_BYTE, 1024.0 * 1024.0 * 1024.0}, {"MB", GUC_UNIT_BYTE, 1024.0 * 1024.0}, {"kB", GUC_UNIT_BYTE, 1024.0}, {"B", GUC_UNIT_BYTE, 1.0}, {"TB", GUC_UNIT_KB, 1024.0 * 1024.0 * 1024.0}, {"GB", GUC_UNIT_KB, 1024.0 * 1024.0}, {"MB", GUC_UNIT_KB, 1024.0}, {"kB", GUC_UNIT_KB, 1.0}, {"B", GUC_UNIT_KB, 1.0 / 1024.0}, {"TB", GUC_UNIT_MB, 1024.0 * 1024.0}, {"GB", GUC_UNIT_MB, 1024.0}, {"MB", GUC_UNIT_MB, 1.0}, {"kB", GUC_UNIT_MB, 1.0 / 1024.0}, {"B", GUC_UNIT_MB, 1.0 / (1024.0 * 1024.0)}, {""} /* end of table marker */ }; static const char *time_units_hint = "Valid units for this parameter are \"us\", \"ms\", \"s\", \"min\", \"h\", and \"d\"."; static const unit_conversion time_unit_conversion_table[] = { {"d", GUC_UNIT_MS, 1000 * 60 * 60 * 24}, {"h", GUC_UNIT_MS, 1000 * 60 * 60}, {"min", GUC_UNIT_MS, 1000 * 60}, {"s", GUC_UNIT_MS, 1000}, {"ms", GUC_UNIT_MS, 1}, {"us", GUC_UNIT_MS, 1.0 / 1000}, {"d", GUC_UNIT_S, 60 * 60 * 24}, {"h", GUC_UNIT_S, 60 * 60}, {"min", GUC_UNIT_S, 60}, {"s", GUC_UNIT_S, 1}, {"ms", GUC_UNIT_S, 1.0 / 1000}, {"us", GUC_UNIT_S, 1.0 / (1000 * 1000)}, {"d", GUC_UNIT_MIN, 60 * 24}, {"h", GUC_UNIT_MIN, 60}, {"min", GUC_UNIT_MIN, 1}, {"s", GUC_UNIT_MIN, 1.0 / 60}, {"ms", GUC_UNIT_MIN, 1.0 / (1000 * 60)}, {"us", GUC_UNIT_MIN, 1.0 / (1000 * 1000 * 60)}, {""} /* end of table marker */ }; 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, true, NULL, NULL, NULL }, { {"failover_require_consensus", CFGCXT_INIT, FAILOVER_CONFIG, "Only do failover when majority agrees.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_require_consensus, true, 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 }, { {"wd_remove_shutdown_nodes", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Revoke the cluster membership of properly shutdown watchdog nodes.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.wd_remove_shutdown_nodes, false, NULL, NULL, NULL }, { {"log_connections", CFGCXT_RELOAD, LOGGING_CONFIG, "Logs each successful connection.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_connections, false, NULL, NULL, NULL }, { {"log_disconnections", CFGCXT_RELOAD, LOGGING_CONFIG, "Logs end of a session.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_disconnections, false, NULL, NULL, NULL }, { {"log_pcp_processes", CFGCXT_RELOAD, LOGGING_CONFIG, "Logs PCP process forks and a normal exit status to the log", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_pcp_processes, true, NULL, NULL, NULL }, { {"log_hostname", CFGCXT_RELOAD, LOGGING_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, LOGGING_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, true, NULL, NULL, NULL }, { {"replication_stop_on_mismatch", CFGCXT_RELOAD, REPLICATION_CONFIG, "Starts degeneration and stops replication, If there's a data mismatch between primary 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 primary 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 }, { {"prefer_lower_delay_standby", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "If the load balance node is delayed over delay_threshold on SR, pgpool find another standby node which is lower delayed.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.prefer_lower_delay_standby, 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 }, { {"failover_on_backend_shutdown", CFGCXT_RELOAD, FAILOVER_CONFIG, "Triggers fail over when backend is shutdown.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_on_backend_shutdown, false, 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, LOGGING_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, LOGGING_CONFIG, "Logs per node detailed SQL statements.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_per_node_statement, false, NULL, NULL, NULL }, { {"notice_per_node_statement", CFGCXT_SESSION, LOGGING_CONFIG, "Logs notice message for per node detailed SQL statements.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.notice_per_node_statement, false, NULL, NULL, NULL }, { {"log_client_messages", CFGCXT_SESSION, LOGGING_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 escalates to leader watchdog node.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.clear_memqcache_on_escalation, true, 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 detached node continue streaming replication.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.auto_failback, false, NULL, NULL, NULL }, { {"logging_collector", CFGCXT_INIT, LOGGING_CONFIG, "Enable capturing of stderr into log files.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.logging_collector, false, NULL, NULL, NULL }, { {"log_truncate_on_rotation", CFGCXT_RELOAD, LOGGING_CONFIG, "If on, an existing log file gets truncated on time based log rotation.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_truncate_on_rotation, false, NULL, NULL, NULL }, { {"health_check_test", CFGCXT_INIT, HEALTH_CHECK_CONFIG, "If on, enable health check testing.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.health_check_test, false, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_BOOL }; static struct config_string ConfigureNamesString[] = { { {"user_redirect_preference_list", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "redirect by user name.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.user_redirect_preference_list, /* variable */ NULL, /* boot value */ NULL, /* assign_func */ NULL, /* check_func */ MakeUserRedirectListRegex, /* process func */ NULL /* show hook */ }, { {"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 }, { {"dml_adaptive_object_relationship_list", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "list of relationships between objects.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.dml_adaptive_object_relationship_list, NULL, NULL, NULL, MakeDMLAdaptiveObjectRelationList, NULL }, { {"unix_socket_group", CFGCXT_INIT, CONNECTION_CONFIG, "The owning user of the sockets that always starts the server.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.unix_socket_group, "", 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, LOGGING_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, LOGGING_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, LOGGING_CONFIG, "printf-style string to output at beginning of each log line.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.log_line_prefix, "%m: %a 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, "", 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_primary_command", CFGCXT_RELOAD, FAILOVER_CONFIG, "Command to execute in streaming replication mode after a primary node failover.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.follow_primary_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 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 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 }, { {"trusted_server_command", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Command to excute when communicate with trusted server.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.trusted_server_command, "ping -q -c3 %h", NULL, NULL, NULL, NULL }, { {"delegate_IP", CFGCXT_INIT, WATCHDOG_CONFIG, "Old config parameter for delegate_ip.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_IN_SHOW_ALL }, NULL, "", DelegateIPAssignMessage, NULL, NULL, NULL }, { {"delegate_ip", CFGCXT_INIT, WATCHDOG_CONFIG, "Delegate IP address to be used when pgpool node become a watchdog cluster leader.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.delegate_ip, "", 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, "template1", 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, "", 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, "", 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, "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, "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, "Single PEM format file containing CA root certificate(s).", 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_crl_file", CFGCXT_INIT, SSL_CONFIG, "SSL certificate revocation list file", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_crl_file, "", 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 }, { {"ssl_passphrase_command", CFGCXT_INIT, SSL_CONFIG, "Path to the Diffie-Hellman parameters contained file", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_passphrase_command, "", NULL, NULL, NULL, NULL }, { {"memqcache_oiddir", CFGCXT_INIT, CACHE_CONFIG, "Temporary 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, LOGGING_CONFIG, "PgPool status file logging directory.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.logdir, DEFAULT_LOGDIR, NULL, NULL, NULL, NULL }, { {"log_directory", CFGCXT_RELOAD, LOGGING_CONFIG, "directory where log files are written.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.log_directory, "/tmp/pgpool_logs", NULL, NULL, NULL, NULL }, { {"log_filename", CFGCXT_RELOAD, LOGGING_CONFIG, "log file name pattern.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.log_filename, "pgpool-%Y-%m-%d_%H%M%S.log", 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 separator */ false, /* compute_regex ? */ NULL, NULL, NULL /* assign, check, show funcs */ }, { {"listen_addresses", CFGCXT_INIT, CONNECTION_CONFIG, "hostname(s) or IP address(es) on which pgpool will listen on.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.listen_addresses, &g_pool_config.num_listen_addresses, (const char *) default_listen_addresses_list, ",", false, 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_LIST, false, 0 }, &g_pool_config.pcp_listen_addresses, &g_pool_config.num_pcp_listen_addresses, (const char *) default_pcp_listen_addresses_list, ",", false, NULL, NULL, NULL }, { {"unix_socket_directories", CFGCXT_INIT, CONNECTION_CONFIG, "The directories to create the UNIX domain sockets for accepting pgpool-II client connections.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.unix_socket_directories, &g_pool_config.num_unix_socket_directories, (const char *) default_unix_socket_directories_list, ",", false, NULL, NULL, NULL }, { {"pcp_socket_dir", CFGCXT_INIT, CONNECTION_CONFIG, "The directories to create the UNIX domain socket for accepting pgpool-II PCP connections.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.pcp_socket_dir, &g_pool_config.num_pcp_socket_directories, (const char *) default_unix_socket_directories_list, ",", false, NULL, NULL, NULL }, { {"read_only_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.read_only_function_list, &g_pool_config.num_read_only_function_list, (const char *) default_read_only_function_list, ",", true, NULL, NULL, NULL }, { {"write_function_list", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "list of functions that writes to database.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.write_function_list, &g_pool_config.num_write_function_list, (const char *) default_write_function_list, ",", true, NULL, NULL, NULL }, { {"cache_safe_memqcache_table_list", CFGCXT_RELOAD, CACHE_CONFIG, "list of tables to be cached.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.cache_safe_memqcache_table_list, &g_pool_config.num_cache_safe_memqcache_table_list, NULL, ",", true, NULL, NULL, NULL }, { {"cache_unsafe_memqcache_table_list", CFGCXT_RELOAD, CACHE_CONFIG, "list of tables should not be cached.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.cache_unsafe_memqcache_table_list, &g_pool_config.num_cache_unsafe_memqcache_table_list, NULL, ",", true, NULL, NULL, NULL }, { {"primary_routing_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.primary_routing_query_pattern_list, &g_pool_config.num_primary_routing_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 in bytes.", CONFIG_VAR_TYPE_LONG, false, GUC_UNIT_BYTE }, &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, GUC_UNIT_S }, &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, GUC_UNIT_BYTE }, &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_port", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "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 }, { {"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 }, { {"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, GUC_UNIT_S, 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, GUC_UNIT_S, 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, GUC_UNIT_S, 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, GUC_UNIT_MS, 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, "application_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 }, { /* * There are two entries of "backend_flag" for "ALLOW_TO_FAILOVER" and * "ALWAYS_PRIMARY". This is mostly ok but "pgpool show all" command * displayed both backend_flag entries, which looks redundant. The * reason for this is, report_all_variables() shows grouped variables * first then other variables except already shown as grouped * variables. Unfortunately build_variable groups() is not smart * enough to build grouped variable data: it only registers the first * backend_flag entry and leaves the second entry. since the second * entry is not a grouped variable, backend_flag is shown firstly as a * grouped variable and then is show as a non grouped variable in * report_all_variables(). To fix this, mark that the second variable * is also a grouped variable (the flag is set by * build_config_variables()). See bug 728 for the report of the * problem. */ {"backend_flag", CFGCXT_RELOAD, CONNECTION_CONFIG, "Controls various backend behavior.", CONFIG_VAR_TYPE_STRING_ARRAY, true, VAR_PART_OF_GROUP, MAX_NUM_BACKENDS }, NULL, "", /* for ALWAYS_PRIMARY */ EMPTY_CONFIG_STRING, BackendFlagsAssignFunc, NULL, BackendFlagsShowFunc, BackendSlotEmptyCheckFunc }, { {"heartbeat_hostname", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "Hostname for sending heartbeat signal.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, WD_MAX_IF_NUM }, NULL, "", EMPTY_CONFIG_STRING, HBHostnameAssignFunc, NULL, HBHostnameShowFunc, WdIFSlotEmptyCheckFunc }, { {"heartbeat_device", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "Name of NIC device for sending heartbeat.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, WD_MAX_IF_NUM }, NULL, "", EMPTY_CONFIG_STRING, HBDeviceAssignFunc, NULL, HBDeviceShowFunc, WdIFSlotEmptyCheckFunc }, { {"hostname", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Hostname of 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, "", { {"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, "", 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 }, { {"unix_socket_permissions", CFGCXT_INIT, CONNECTION_CONFIG, "The access permissions of the Unix domain sockets.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.unix_socket_permissions, 0777, 0000, 0777, NULL, NULL, UnixSockPermissionsShowFunc }, { {"num_init_children", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Maximim number of child process to handle client connections.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.num_init_children, 32, 1, INT_MAX, NULL, NULL, NULL }, { {"min_spare_children", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "Minimum number of spare child processes.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.min_spare_children, 5, 1, INT_MAX, NULL, NULL, NULL }, { {"max_spare_children", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "Maximum number of spare child processes.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.max_spare_children, 10, 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, 2, 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, GUC_UNIT_S }, &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, GUC_UNIT_S }, &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, GUC_UNIT_S }, &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, GUC_UNIT_S }, &g_pool_config.authentication_timeout, 60, 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, GUC_UNIT_S }, &g_pool_config.sr_check_period, 10, 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, GUC_UNIT_S }, &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, GUC_UNIT_S }, &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, GUC_UNIT_S }, &g_pool_config.search_primary_node_timeout, 300, 0, 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, GUC_UNIT_S }, &g_pool_config.wd_interval, 10, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_lost_node_removal_timeout", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Timeout in seconds to revoke the cluster membership of LOST watchdog nodes.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_S }, &g_pool_config.wd_lost_node_removal_timeout, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_no_show_node_removal_timeout", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Timeout in seconds to revoke the cluster membership of NO-SHOW watchdog nodes.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_S }, &g_pool_config.wd_no_show_node_removal_timeout, 0, 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_keepalive", CFGCXT_INIT, WATCHDOG_CONFIG, "Time interval in seconds between sending the heartbeat signal.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_S }, &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 signal.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_S }, &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, GUC_UNIT_S }, &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, GUC_UNIT_BYTE }, &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, GUC_UNIT_BYTE }, &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, GUC_UNIT_S }, &g_pool_config.auto_failback_interval, 60, 0, INT_MAX, NULL, NULL, NULL }, { {"log_rotation_age", CFGCXT_RELOAD, LOGGING_CONFIG, "Automatic rotation of logfiles will happen after that (minutes) time.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_MIN }, &g_pool_config.log_rotation_age, 1440,/*1 day*/ 0, INT_MAX, NULL, NULL, NULL }, { {"log_rotation_size", CFGCXT_RELOAD, LOGGING_CONFIG, "Automatic rotation of logfiles will happen after that much (kilobytes) log output.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_KB }, &g_pool_config.log_rotation_size, 10 * 1024, 0, INT_MAX/1024, NULL, NULL, NULL }, { {"log_file_mode", CFGCXT_RELOAD, LOGGING_CONFIG, "creation mode for log files.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.log_file_mode, 0600, 0, INT_MAX, NULL, NULL, NULL }, { {"delay_threshold_by_time", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "standby delay threshold by time.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_MS, }, &g_pool_config.delay_threshold_by_time, 0, 0, INT_MAX, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_INT }; static struct config_enum ConfigureNamesEnum[] = { { {"backend_clustering_mode", CFGCXT_INIT, MAIN_REPLICA_CONFIG, "backend clustering mode.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.backend_clustering_mode, CM_STREAMING_REPLICATION, backend_clustering_mode_options, NULL, NULL, NULL, NULL }, { {"process_management_mode", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "child process management mode.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.process_management, PM_STATIC, process_management_mode_options, NULL, NULL, NULL, NULL }, { {"process_management_strategy", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "child process management strategy.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.process_management_strategy, PM_STRATEGY_GENTLE, process_management_strategy_options, NULL, NULL, NULL, NULL }, { {"syslog_facility", CFGCXT_RELOAD, LOGGING_CONFIG, "syslog local facility.", 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, LOGGING_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, LOGGING_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, LOGGING_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 }, { {"log_standby_delay", CFGCXT_RELOAD, MAIN_REPLICA_CONFIG, "When to log standby delay.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.log_standby_delay, LSD_OVER_THRESHOLD, log_standby_delay_options, NULL, NULL, NULL, NULL }, { {"log_backend_messages", CFGCXT_SESSION, LOGGING_CONFIG, "Logs any backend messages in the pgpool logs.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.log_backend_messages, BGMSG_NONE, log_backend_messages_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_PRIMARY, 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 }, { {"watchdog", 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("hostname", FATAL); ConfigureVarGroups[1].var_list[0]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[1].var_list[1] = find_option("pgpool_port", FATAL); ConfigureVarGroups[1].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[1].var_list[2] = find_option("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_hostname", FATAL); ConfigureVarGroups[2].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[2].var_list[2] = find_option("heartbeat_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, "primary_routing_query_pattern_list") == 0) { *conf->variable = get_list_from_string_regex_delim(newval, conf->separator, conf->list_elements_count); } else { *conf->variable = get_list_from_string(newval, conf->separator, 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)) { int i; /* skip leading whitespace */ while (isspace(*token)) token++; /* skip trailing whitespace */ i = strlen(token) - 1; while (i >= 0 && isspace(token[i])) { token[i] = '\0'; i--; } 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 before 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 named "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 compare 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) { int64 newval64; const char *hintmsg; if (!parse_int(value, &newval64, conf->gen.flags, &hintmsg, INT_MAX)) { ereport(elevel, (errmsg("invalid value for parameter \"%s\": \"%s\"", name, value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } newval = (int)newval64; } 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) { int64 newval64; const char *hintmsg; if (!parse_int(value, &newval64, conf->gen.flags, &hintmsg, INT_MAX)) { ereport(elevel, (errmsg("invalid value for parameter \"%s\": \"%s\"", name, value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } newval = (int)newval64; } 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) { const char *hintmsg; if (!parse_int(value, &newval, conf->gen.flags, &hintmsg, conf->max)) { ereport(elevel, (errmsg("invalid value for parameter \"%s\": \"%s\"", name, value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } } 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, "primary_routing_query_pattern_list") == 0) { *conf->variable = get_list_from_string_regex_delim(newval, conf->separator, conf->list_elements_count); } else { *conf->variable = get_list_from_string(newval, conf->separator, 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; int i, n; bool allow_to_failover_is_specified = false; bool disallow_to_failover_is_specified = false; char **flags; flag = g_pool_config.backend_desc->backend_info[index].flag; flags = get_list_from_string(newval, "|", &n); 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_PRIMARY"))) { flag |= POOL_ALWAYS_PRIMARY; } 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))); if (flags) pfree(flags); return true; } static bool BackendAppNameAssignFunc(ConfigContext context, char *newval, int index, int elevel) { 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; } 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 * FilePermissionShowFunc(int value) { static char buffer[10]; snprintf(buffer, sizeof(buffer), "%04o", value); return buffer; } static const char * UnixSockPermissionsShowFunc(void) { return FilePermissionShowFunc(g_pool_config.unix_socket_permissions); } 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_PRIMARY & flag) { if (*buffer == '\0') snprintf(buffer, sizeof(buffer), "ALWAYS_PRIMARY"); else snprintf(buffer+strlen(buffer), sizeof(buffer), "|ALWAYS_PRIMARY"); } 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_nodes.wd_node_info[index].pgpool_port == 0); } static bool WdIFSlotEmptyCheckFunc(int index) { return (g_pool_config.hb_ifs[index].dest_port == 0); } static const char * OtherPPHostShowFunc(int index) { return g_pool_config.wd_nodes.wd_node_info[index].hostname; } static const char * OtherPPPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.wd_nodes.wd_node_info[index].pgpool_port); } static const char * OtherWDPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.wd_nodes.wd_node_info[index].wd_port); } static const char * HBDeviceShowFunc(int index) { return g_pool_config.hb_ifs[index].if_name; } static const char * HBHostnameShowFunc(int index) { return g_pool_config.hb_ifs[index].addr; } static const char * HBDestinationPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.hb_ifs[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 hostname and heartbeat hostname assign functions */ /* hostname */ static bool OtherPPHostAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (newval == NULL || strlen(newval) == 0) g_pool_config.wd_nodes.wd_node_info[index].hostname[0] = '\0'; else strlcpy(g_pool_config.wd_nodes.wd_node_info[index].hostname, newval, MAX_DB_HOST_NAMELEN - 1); return true; } /* pgpool_port */ static bool OtherPPPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.wd_nodes.wd_node_info[index].pgpool_port = newval; return true; } /* wd_port */ static bool OtherWDPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.wd_nodes.wd_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_ifs[index].if_name[0] = '\0'; else strlcpy(g_pool_config.hb_ifs[index].if_name, newval, WD_MAX_IF_NAME_LEN - 1); return true; } /*heartbeat_hostname*/ static bool HBHostnameAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (newval == NULL || strlen(newval) == 0) g_pool_config.hb_ifs[index].addr[0] = '\0'; else strlcpy(g_pool_config.hb_ifs[index].addr, newval, WD_MAX_HOST_NAMELEN - 1); return true; } /*heartbeat_port*/ static bool HBDestinationPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.hb_ifs[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("if fail_over_on_backend_error is specified, the value will be set to failover_on_backend_error"))); g_pool_config.failover_on_backend_error = newval; return true; } /* * Throws warning for if someone uses the removed delegate_IP * configuration parameter and set the value to delegate_ip */ static bool DelegateIPAssignMessage(ConfigContext scontext, char *newval, int elevel) { if (scontext != CFGCXT_BOOT) ereport(WARNING, (errmsg("delegate_IP is changed to delegate_ip"), errdetail("if delegate_IP is specified, the value will be set to delegate_ip"))); g_pool_config.delegate_ip = newval; 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; /* read from pgpool_node_id */ SetPgpoolNodeId(elevel); if (context == CFGCXT_BOOT) { char localhostname[128]; int res = gethostname(localhostname, sizeof(localhostname)); if (res != 0) { ereport(WARNING, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); return false; } strcpy(g_pool_config.wd_nodes.wd_node_info[g_pool_config.pgpool_node_id].hostname, 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_nodes.num_wd = 0; if (g_pool_config.use_watchdog) { for (i = 0; i < MAX_WATCHDOG_NUM; i++) { WdNodeInfo *wdNode = &g_pool_config.wd_nodes.wd_node_info[i]; if (i == g_pool_config.pgpool_node_id && wdNode->wd_port <= 0) { ereport(elevel, (errmsg("invalid watchdog configuration"), errdetail("no watchdog configuration for local pgpool node, pgpool node id: %d ", g_pool_config.pgpool_node_id))); return false; } if (wdNode->wd_port > 0) g_pool_config.wd_nodes.num_wd = i + 1; } } /* Set configured heartbeat destination interfaces */ SetHBDestIfFunc(elevel); 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; } /* * Verify the minimum and maximum number of spare children configuration when * dynamic process management is enabled */ if (g_pool_config.process_management == PM_DYNAMIC) { if (pool_config->min_spare_children >= pool_config->max_spare_children) { ereport(elevel, (errmsg("invalid configuration, max_spare_children:%d must be greater than min_spare_children:%d", pool_config->max_spare_children,pool_config->min_spare_children))); return false; } if (pool_config->num_init_children < pool_config->max_spare_children) { ereport(elevel, (errmsg("invalid configuration, max_spare_children:%d can't be greater than num_init_children:%d", pool_config->max_spare_children,pool_config->num_init_children))); return false; } } return true; } static bool MakeDMLAdaptiveObjectRelationList(char *newval, int elevel) { int i; int elements_count = 0; char **rawList = get_list_from_string(newval, ",", &elements_count); if (rawList == NULL || elements_count == 0) { pool_config->parsed_dml_adaptive_object_relationship_list = NULL; return true; } pool_config->parsed_dml_adaptive_object_relationship_list = palloc(sizeof(DBObjectRelation) * (elements_count + 1)); for (i = 0; i < elements_count; i++) { char *kvstr = rawList[i]; char *left_token = strtok(kvstr, ":"); char *right_token = strtok(NULL, ":"); DBObjectTypes object_type; ereport(DEBUG5, (errmsg("dml_adaptive_init"), errdetail("%s -- left_token[%s] right_token[%s]", kvstr, left_token, right_token))); pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.name = getParsedToken(left_token, &object_type); pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.object_type = object_type; pool_config->parsed_dml_adaptive_object_relationship_list[i].right_token.name = getParsedToken(right_token,&object_type); pool_config->parsed_dml_adaptive_object_relationship_list[i].right_token.object_type = object_type; pfree(kvstr); } pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.name = NULL; pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.object_type = OBJECT_TYPE_UNKNOWN; pool_config->parsed_dml_adaptive_object_relationship_list[i].right_token.name = NULL; pool_config->parsed_dml_adaptive_object_relationship_list[i].right_token.object_type = OBJECT_TYPE_UNKNOWN; pfree(rawList); return true; } /* * Identify the object type for dml adaptive object * the function is very primitive and just looks for token * ending with (). * We also remove the trailing spaces from the function type token * and return the palloc'd copy of token in new_token */ static char* getParsedToken(char *token, DBObjectTypes *object_type) { int len; *object_type = OBJECT_TYPE_UNKNOWN; if (!token) return NULL; len = strlen(token); if (len > strlen("*()")) { int namelen = len - 2; /* check if token ends with () */ if (strcmp(token + namelen,"()") == 0) { /* * Remove the Parentheses from end of * token name */ char *new_token; int new_len = strlen(token) - 2; new_token = palloc(new_len + 1); strncpy(new_token,token,new_len); new_token[new_len] = '\0'; *object_type = OBJECT_TYPE_FUNCTION; return new_token; } } *object_type = OBJECT_TYPE_RELATION; return pstrdup(token); } 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 bool MakeUserRedirectListRegex(char *newval, int elevel) { /* TODO Deal with the memory */ int i; Left_right_tokens *lrtokens; if (newval == NULL) { pool_config->redirect_usernames = NULL; pool_config->user_redirect_tokens = NULL; return true; } lrtokens = create_lrtoken_array(); extract_string_tokens2(newval, ",", ':', lrtokens); pool_config->redirect_usernames = create_regex_array(); pool_config->user_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 \"user_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_usernames, lrtokens->token[i].left_token)) { ereport(elevel, (errmsg("invalid configuration for key \"user_redirect_preference_list\""), errdetail("wrong redirect user name regular expression: \"%s\"", lrtokens->token[i].left_token))); return false; } } return true; } /* Read the pgpool_node_id file */ static bool SetPgpoolNodeId(int elevel) { char pgpool_node_id_file[POOLMAXPATHLEN + 1]; FILE *fd; int length; int i; if (g_pool_config.use_watchdog) { snprintf(pgpool_node_id_file, sizeof(pgpool_node_id_file), "%s/%s", config_file_dir, NODE_ID_FILE_NAME); #define MAXLINE 10 char readbuf[MAXLINE]; fd = fopen(pgpool_node_id_file, "r"); if (!fd) { ereport(elevel, (errmsg("Pgpool node id file %s does not exist", pgpool_node_id_file), errdetail("If watchdog is enable, pgpool_node_id file is required"))); return false; } readbuf[MAXLINE - 1] = '\0'; if (fgets(readbuf, MAXLINE - 1, fd) == 0) { ereport(elevel, (errmsg("pgpool_node_id file is empty"), errdetail("If watchdog is enable, we need to specify pgpool node id in %s file", pgpool_node_id_file))); fclose(fd); return false; } length = strlen(readbuf); if (length > 0 && readbuf[length - 1] == '\n') { readbuf[length - 1] = '\0'; length = strlen(readbuf); if (length <= 0) { ereport(elevel, (errmsg("pgpool_node_id file is empty"), errdetail("If watchdog is enable, we need to specify pgpool node id in %s file", pgpool_node_id_file))); fclose(fd); return false; } } for (i = 0; i < length; i++) { if (!isdigit((int) readbuf[i])) { ereport(elevel, (errmsg("pgpool_node_id is not a numeric value"), errdetail("Please specify a numeric value in %s file", pgpool_node_id_file))); fclose(fd); return false; } } g_pool_config.pgpool_node_id = atoi(readbuf); if (g_pool_config.pgpool_node_id < 0 || g_pool_config.pgpool_node_id > MAX_WATCHDOG_NUM) { ereport(elevel, (errmsg("Invalid pgpool node id \"%d\", must be between 0 and %d", g_pool_config.pgpool_node_id, MAX_WATCHDOG_NUM))); fclose(fd); return false; } else { ereport(DEBUG1, (errmsg("read pgpool node id file %s", pgpool_node_id_file), errdetail("pgpool node id: %s", readbuf))); } fclose(fd); } return true; } /* Set configured heartbeat destination interfaces */ static bool SetHBDestIfFunc(int elevel) { int idx = 0; char **addrs; char **if_names; int i, j, n_addr, n_if_name; g_pool_config.num_hb_dest_if = 0; if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB) { return true; } /* * g_pool_config.hb_ifs is the information for sending/receiving heartbeat * for all nodes specified in pgpool.conf. * If it is local pgpool node information, set dest_port to g_pool_config.wd_heartbeat_port * and ignore addr and if_name. * g_pool_config.hb_dest_if is the heartbeat destination information. */ for (i = 0; i < WD_MAX_IF_NUM; i++) { if (g_pool_config.hb_ifs[i].dest_port > 0) { /* Ignore local pgpool node */ if (i == g_pool_config.pgpool_node_id) { g_pool_config.wd_heartbeat_port = g_pool_config.hb_ifs[i].dest_port; continue; } WdHbIf *hbNodeInfo = &g_pool_config.hb_ifs[i]; addrs = get_list_from_string(hbNodeInfo->addr, ";", &n_addr); if_names = get_list_from_string(hbNodeInfo->if_name, ";", &n_if_name); if (!addrs || n_addr < 0) { g_pool_config.hb_dest_if[idx].addr[0] = '\0'; if (addrs) pfree(addrs); if (if_names) pfree(if_names); ereport(elevel, (errmsg("invalid watchdog configuration"), errdetail("heartbeat_hostname%d is not defined", i))); return false; } for (j = 0; j < n_addr; j++) { strlcpy(g_pool_config.hb_dest_if[idx].addr, addrs[j], WD_MAX_HOST_NAMELEN - 1); g_pool_config.hb_dest_if[idx].dest_port = hbNodeInfo->dest_port; if (n_if_name > j + 1) { strlcpy(g_pool_config.hb_dest_if[idx].if_name, if_names[j], WD_MAX_IF_NAME_LEN - 1); pfree(if_names[j]); } else g_pool_config.hb_dest_if[idx].if_name[0] = '\0'; g_pool_config.num_hb_dest_if = idx + 1; idx++; pfree(addrs[j]); } if (addrs) pfree(addrs); if (if_names) pfree(if_names); } } 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; } /* * Try to parse value as an integer. The accepted formats are the * usual decimal, octal, or hexadecimal formats, as well as floating-point * formats (which will be rounded to integer after any units conversion). * Optionally, the value can be followed by a unit name if "flags" indicates * a unit is allowed. * * If the string parses okay, return true, else false. * If okay and result is not NULL, return the value in *result. * If not okay and hintmsg is not NULL, *hintmsg is set to a suitable * HINT message, or NULL if no hint provided. */ static bool parse_int(const char *value, int64 *result, int flags, const char **hintmsg, int64 MaxVal) { /* * We assume here that double is wide enough to represent any integer * value with adequate precision. */ double val; char *endptr; /* To suppress compiler warnings, always set output params */ if (result) *result = 0; if (hintmsg) *hintmsg = NULL; /* * Try to parse as an integer (allowing octal or hex input). If the * conversion stops at a decimal point or 'e', or overflows, re-parse as * float. This should work fine as long as we have no unit names starting * with 'e'. If we ever do, the test could be extended to check for a * sign or digit after 'e', but for now that's unnecessary. */ errno = 0; val = strtol(value, &endptr, 0); if (*endptr == '.' || *endptr == 'e' || *endptr == 'E' || errno == ERANGE) { errno = 0; val = strtod(value, &endptr); } if (endptr == value || errno == ERANGE) return false; /* no HINT for these cases */ /* reject NaN (infinities will fail range check below) */ if (isnan(val)) return false; /* treat same as syntax error; no HINT */ /* allow whitespace between number and unit */ while (isspace((unsigned char) *endptr)) endptr++; /* Handle possible unit */ if (*endptr != '\0') { if ((flags & GUC_UNIT) == 0) { return false; /* this setting does not accept a unit */ } if (!convert_to_base_unit(val, endptr, (flags & GUC_UNIT), &val)) { /* invalid unit, or garbage after the unit; set hint and fail. */ if (hintmsg) { if (flags & GUC_UNIT_MEMORY) *hintmsg = memory_units_hint; else *hintmsg = time_units_hint; } return false; } } /* Round to int, then check for overflow */ val = rint(val); if (val > MaxVal || val < INT_MIN) { if (hintmsg) *hintmsg = "Value exceeds allowed range."; return false; } if (result) *result = (int64) val; return true; } /* * Convert a value from one of the human-friendly units ("kB", "min" etc.) * to the given base unit. 'value' and 'unit' are the input value and unit * to convert from (there can be trailing spaces in the unit string). * The converted value is stored in *base_value. * It's caller's responsibility to round off the converted value as necessary * and check for out-of-range. * * Returns true on success, false if the input unit is not recognized. */ static bool convert_to_base_unit(double value, const char *unit, int base_unit, double *base_value) { char unitstr[MAX_UNIT_LEN + 1]; int unitlen; const unit_conversion *table; int i; /* extract unit string to compare to table entries */ unitlen = 0; while (*unit != '\0' && !isspace((unsigned char) *unit) && unitlen < MAX_UNIT_LEN) unitstr[unitlen++] = *(unit++); unitstr[unitlen] = '\0'; /* allow whitespace after unit */ while (isspace((unsigned char) *unit)) unit++; if (*unit != '\0') return false; /* unit too long, or garbage after it */ /* now search the appropriate table */ if (base_unit & GUC_UNIT_MEMORY) table = memory_unit_conversion_table; else table = time_unit_conversion_table; for (i = 0; *table[i].unit; i++) { if (base_unit == table[i].base_unit && strcmp(unitstr, table[i].unit) == 0) { double cvalue = value * table[i].multiplier; /* * If the user gave a fractional value such as "30.1GB", round it * off to the nearest multiple of the next smaller unit, if there * is one. */ if (*table[i + 1].unit && base_unit == table[i + 1].base_unit) cvalue = rint(cvalue / table[i + 1].multiplier) * table[i + 1].multiplier; *base_value = cvalue; return true; } } return false; } #ifndef POOL_PRIVATE /* * Convert an integer value in some base unit to a human-friendly unit. * * The output unit is chosen so that it's the greatest unit that can represent * the value without loss. For example, if the base unit is GUC_UNIT_KB, 1024 * is converted to 1 MB, but 1025 is represented as 1025 kB. */ static void convert_int_from_base_unit(int64 base_value, int base_unit, int64 *value, const char **unit) { const unit_conversion *table; int i; *unit = NULL; if (base_unit & GUC_UNIT_MEMORY) table = memory_unit_conversion_table; else table = time_unit_conversion_table; for (i = 0; *table[i].unit; i++) { if (base_unit == table[i].base_unit) { /* * Accept the first conversion that divides the value evenly. We * assume that the conversions for each base unit are ordered from * greatest unit to the smallest! */ if (table[i].multiplier <= 1.0 || base_value % (int64) table[i].multiplier == 0) { *value = (int64) rint(base_value / table[i].multiplier); *unit = table[i].unit; break; } } } Assert(*unit != NULL); } /* * 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 if (conf->variable) val = *conf->variable ? "on" : "off"; else val = ""; } break; case CONFIG_VAR_TYPE_INT: { struct config_int *conf = (struct config_int *) record; if (conf->show_hook) val = (*conf->show_hook) (); else { /* * Use int64 arithmetic to avoid overflows in units * conversion. */ int64 result = (int64) *conf->variable; const char *unit; if (result > 0 && (record->flags & GUC_UNIT)) convert_int_from_base_unit(result, record->flags & GUC_UNIT, &result, &unit); else unit = ""; snprintf(buffer, sizeof(buffer), INT64_FORMAT "%s", result, unit); 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; const char *unit; if (result > 0 && (record->flags & GUC_UNIT)) convert_int_from_base_unit(result, record->flags & GUC_UNIT, &result, &unit); else unit = ""; snprintf(buffer, sizeof(buffer), INT64_FORMAT "%s", result, unit); 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 && **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; } /* * Handle "pgpool show all" command. */ 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; } /* * Handle "pgpool show" command. */ 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\" without 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.6.0/src/context/0000775000175000017500000000000014760010070012571 500000000000000pgpool-II-4.6.0/src/context/pool_session_context.c0000664000175000017500000014115014760007565017156 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "protocol/pool_proto_modules.h" #include "protocol/pool_process_query.h" #include "protocol/pool_connection_pool.h" #include "protocol/pool_pg_utils.h" #include "context/pool_session_context.h" static POOL_SESSION_CONTEXT session_context_d; static POOL_SESSION_CONTEXT * session_context = NULL; static void GetTranIsolationErrorCb(void *arg); static void init_sent_message_list(void); static POOL_PENDING_MESSAGE * copy_pending_message(POOL_PENDING_MESSAGE * message); static void dump_sent_message(char *caller, POOL_SENT_MESSAGE * m); static void dml_adaptive_init(void); static void dml_adaptive_destroy(void); #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_increment_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 (!RAW_MODE && pool_config->load_balance_mode) { node_id = select_load_balancing_node(); } else { node_id = SL_MODE ? PRIMARY_NODE_ID : MAIN_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(); /* * 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(); /* Snapshot isolation state */ session_context->si_state = SI_NO_SNAPSHOT; /* Transaction read only */ session_context->transaction_read_only = false; dml_adaptive_init(); unset_tx_started_by_multi_statement_query(); unset_query_cache_disabled(); unset_query_cache_disabled_tx(); } /* * 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); dml_adaptive_destroy(); } /* 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))); } static void dml_adaptive_init(void) { if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE) { session_context->is_in_transaction = false; session_context->transaction_temp_write_list = NIL; } } static void dml_adaptive_destroy(void) { if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE && session_context) { if (session_context->transaction_temp_write_list != NIL) list_free_deep(session_context->transaction_temp_write_list); } } /* * 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' or 'dml_adaptive', then never turn on writing * transaction flag. */ if (pool_config->disable_load_balance_on_write != DLBOW_OFF && pool_config->disable_load_balance_on_write != DLBOW_DML_ADAPTIVE) { 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(MAIN(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); } /* * 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(session_context->pending_messages, 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_destroy: 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: unknown 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)); msg->flush_pending = false; 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) { 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); session_context->pending_messages = lappend(session_context->pending_messages, message); 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); 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(session_context->pending_messages, 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", "Describe", "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(session_context->pending_messages, cell); } return cnt; } /* * Set flush request flag */ void pool_pending_message_set_flush_request(void) { ListCell *msg_item; foreach(msg_item, session_context->pending_messages) { POOL_PENDING_MESSAGE *msg = (POOL_PENDING_MESSAGE *) lfirst(msg_item); msg->flush_pending = true; ereport(DEBUG5, (errmsg("pool_pending_message_set_flush_request: msg: %s", pool_pending_message_type_to_string(msg->type)))); } } /* * 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; } if (!message_level_is_interesting(DEBUG5)) 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(session_context->pending_messages, 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; } /*----------------------------------------------------------------------- * 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_destroy: 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_cell(session_context->temp_tables, cell); 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_cell(session_context->temp_tables, cell); 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 } /* * Return true if an explicit transaction has been started by a * multi-statement-query */ bool is_tx_started_by_multi_statement_query(void) { if (!session_context) ereport(ERROR, (errmsg("is_tx_started_by_multi_statement_query: session context is not initialized"))); return session_context->is_tx_started_by_multi_statement; } /* * Remember that an explicit transaction has been started by a * multi-statement-query */ void set_tx_started_by_multi_statement_query(void) { if (!session_context) ereport(ERROR, (errmsg("set_tx_started_by_multi_statement_query: session context is not initialized"))); session_context->is_tx_started_by_multi_statement = true; } /* * Forget that an explicit transaction has been started by a * multi-statement-query */ void unset_tx_started_by_multi_statement_query(void) { if (!session_context) ereport(ERROR, (errmsg("unset_tx_started_by_multi_statement_query: session context is not initialized"))); session_context->is_tx_started_by_multi_statement = false; } /* * Set query_cache_disabled */ void set_query_cache_disabled(void) { if (!session_context) ereport(ERROR, (errmsg("set_query_cache_disabled: session context is not initialized"))); session_context->query_cache_disabled = true; } /* * Unset query_cache_disabled */ void unset_query_cache_disabled(void) { if (!session_context) ereport(ERROR, (errmsg("unset_query_cache_disabled: session context is not initialized"))); session_context->query_cache_disabled = false; } /* * Get query_cache_disabled */ bool query_cache_disabled(void) { if (!session_context) ereport(ERROR, (errmsg("query_cache_disabled: session context is not initialized"))); return session_context->query_cache_disabled || session_context->query_cache_disabled_tx; } /* * Set query_cache_disabled in transaction */ void set_query_cache_disabled_tx(void) { if (!session_context) ereport(ERROR, (errmsg("set_query_cache_disabled_tx: session context is not initialized"))); session_context->query_cache_disabled_tx = true; } /* * Unset query_cache_disabled in transaction */ void unset_query_cache_disabled_tx(void) { if (!session_context) ereport(ERROR, (errmsg("unset_query_cache_disabled_tx: session context is not initialized"))); session_context->query_cache_disabled_tx = false; } /* * Get query_cache_disabled in transaction */ bool query_cache_disabled_tx(void) { if (!session_context) ereport(ERROR, (errmsg("query_cache_disabled_tx: session context is not initialized"))); return session_context->query_cache_disabled_tx; } pgpool-II-4.6.0/src/context/pool_process_context.c0000664000175000017500000002114514760007565017152 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2021 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 "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_increment_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. */ size_t pool_coninfo_size(void) { size_t 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) = %zu 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; if (process_info[child].pid) { 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 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; con->client_connection_time = time(NULL); } } /* * 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; con->client_disconnection_time = time(NULL); } } /* * 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.6.0/src/context/pool_query_context.c0000664000175000017500000016434314760007565016651 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "utils/statistics.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 #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); static void where_to_send_deallocate(POOL_QUERY_CONTEXT * query_context, Node *node); static void where_to_send_main_replica(POOL_QUERY_CONTEXT * query_context, char *query, Node *node); static void where_to_send_native_replication(POOL_QUERY_CONTEXT * query_context, char *query, Node *node); static char *remove_read_write(int len, const char *contents, int *rewritten_len); static void set_virtual_main_node(POOL_QUERY_CONTEXT *query_context); static void set_load_balance_info(POOL_QUERY_CONTEXT *query_context); static bool is_in_list(char *name, List *list); static bool is_select_object_in_temp_write_list(Node *node, void *context); static bool add_object_into_temp_write_list(Node *node, void *context); static void dml_adaptive(Node *node, char *query); static char* get_associated_object_from_dml_adaptive_relations (char *left_token, DBObjectTypes object_type); /* * 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_main_node_id = my_main_node_id; query_context->load_balance_node_id = my_main_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; query_context->atEnd = false; query_context->partial_fetch = 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; } /* * Unspecified 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)) { if (SL_MODE) { /* * If load balance mode is disabled, only send to the primary node. * If primary node does not exist, send to the main node. */ if (!pool_config->load_balance_mode) { if (i == PRIMARY_NODE_ID || (PRIMARY_NODE_ID < 0 && MAIN_NODE_ID == i)) { query_context->where_to_send[i] = true; break; } continue; } else /* * If the node is not primary node nor load balance node, * there's no point to send query except statement level * load balance is enabled. */ if (!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_MAIN_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 main DB node id, */ int pool_virtual_main_db_node_id(void) { volatile POOL_REQUEST_INFO *my_req; POOL_SESSION_CONTEXT *sc; /* * Check whether failover is in progress and we are child process. * If so, we will wait for failover to finish. */ my_req = Req_info; if (processType == PT_CHILD && my_req->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 /* * Wait for failover to finish */ if (wait_for_failover_to_finish() == -2) /* * Waiting for failover/failback to finish was timed out. * Time to exit this process (and session disconnection). */ child_exit(POOL_EXIT_AND_RESTART); } sc = pool_get_session_context(true); if (!sc) { /* * We used to return REAL_MAIN_NODE_ID here. Problem with it is, it * is possible that REAL_MAIN_NODE_ID could be changed * anytime. Suppose REAL_MAIN_NODE_ID == my_main_node_id == 1. Then * due to failback, REAL_MAIN_NODE_ID is changed to 0. Then * MAIN_CONNECTION(cp) will return NULL and any reference to it will * cause segmentation fault. To prevent the issue we should return * my_main_node_id instead. */ return my_main_node_id; } if (sc->in_progress && sc->query_context) { int node_id = sc->query_context->virtual_main_node_id; if (SL_MODE) { /* * Make sure that virtual_main_node_id is either primary node id * or load balance node id. If not, it is likely that * virtual_main_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_main_db_node_id: virtual_main_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 streaming replication mode, returns primary node * if exists. Otherwise returns my_main_node_id, which represents the * last REAL_MAIN_NODE_ID. */ if (MAIN_REPLICA) { return PRIMARY_NODE_ID; } return my_main_node_id; } /* * Set 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) { 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); set_virtual_main_node(query_context); } /* * Decide where to send queries(thus expecting response) */ void pool_where_to_send(POOL_QUERY_CONTEXT * query_context, char *query, Node *node) { CHECK_QUERY_CONTEXT_IS_VALID; /* * Zap out DB node map */ pool_clear_node_to_be_sent(query_context); /* * In raw mode, we send only to main node. Simple enough. */ if (RAW_MODE) { pool_set_node_to_be_sent(query_context, REAL_MAIN_NODE_ID); } else if (MAIN_REPLICA) { if (query_context->is_multi_statement) { /* * If we are in streaming replication 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 where_to_send_main_replica(query_context, query, node); } else if (REPLICATION) { if (query_context->is_multi_statement) { pool_setall_node_to_be_sent(query_context); } else where_to_send_native_replication(query_context, query, node); } else { ereport(WARNING, (errmsg("unknown pgpool-II mode while deciding for where to send query"))); return; } /* * DEALLOCATE or EXECUTE? */ if (IsA(node, DeallocateStmt) || IsA(node, ExecuteStmt)) { where_to_send_deallocate(query_context, node); } /* Set virtual main node according to the where_to_send map. */ set_virtual_main_node(query_context); 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 * streaming replication mode, we send BEGIN to standbys instead. * The original_query which is BEGIN READ WRITE is sent to primary. * The rewritten_query 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 we are in streaming replication mode or logical replication mode, * we do not send COMMIT/ABORT to standbys if it's in I (idle) state. */ if (is_commit && MAIN_REPLICA && !IS_MAIN_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); per_node_statement_notice(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 native replication mode, we do not send COMMIT/ABORT to * standbys if it's in I(idle) state. */ if (is_commit && MAIN_REPLICA && !IS_MAIN_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), MAIN_CONNECTION(backend)->pid, MAIN_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. * Also set reset_query_error to true in ERROR case. This does * anything in normal query processing but when processing reset * queries, this is important because it might mean DISCARD ALL * command fails. If so, we need to discard the connection cache so * that any session object (i.e. named statement) does not remain in * the last session. */ if (per_node_error_log(backend, i, string, "pool_send_and_wait: Error or notice message from backend", true) == 'E') reset_query_error = 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 * streaming replication mode, we send BEGIN to standbys instead. * The original_query which is BEGIN READ WRITE is sent to primary. * The rewritten_query 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' || *kind == 'B') { 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 if (*kind == 'B') snprintf(msgbuf, sizeof(msgbuf), "Bind: %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); per_node_statement_notice(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 native replication mode, we do not send COMMIT/ABORT to * standbys if it's in I(idle) state. */ if (is_commit && MAIN_REPLICA && !IS_MAIN_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), MAIN_CONNECTION(backend)->pid, MAIN_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 native replication+HR/SR mode. */ static POOL_DEST send_to_where(Node *node) { /* 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 */ /* * 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)) { if (SL_MODE && is_tx_started_by_multi_statement_query()) { /* * But in streaming replication mode, if a transaction was * started by a multi statement query, SAVEPOINT should be * sent to primary because the transaction was started on * primary only. */ return POOL_PRIMARY; } 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 (nodeTag(&v->val)) { case T_String: if (!strcasecmp(v->val.sval.sval, "off") || !strcasecmp(v->val.sval.sval, "f") || !strcasecmp(v->val.sval.sval, "false")) ret = POOL_PRIMARY; break; case T_Integer: if (v->val.ival.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.ival.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; /* Note that this is a recursive call */ return send_to_where((Node *) (prepare_statement->query)); } /* * EXECUTE */ else if (IsA(node, ExecuteStmt)) { /* * This is a 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; } /* * All other statements are sent to primary */ return POOL_PRIMARY; } /* * Decide where to send given message. * "node" must be a parse tree of either DEALLOCATE or EXECUTE. */ static void where_to_send_deallocate(POOL_QUERY_CONTEXT * query_context, Node *node) { DeallocateStmt *d = NULL; ExecuteStmt *e = NULL; char *name; POOL_SENT_MESSAGE *msg; if (IsA(node, DeallocateStmt)) { d = (DeallocateStmt *) node; name = d->name; } else if (IsA(node, ExecuteStmt)) { e = (ExecuteStmt *) node; name = e->name; } else { ereport(ERROR, (errmsg("invalid node type for where_to_send_deallocate"))); return; } /* DEALLOCATE ALL? */ if (d && (name == NULL)) { /* send to all backend node */ pool_setall_node_to_be_sent(query_context); return; } /* ordinary DEALLOCATE or EXECUTE */ else { /* check if message was created by SQL PREPARE */ msg = pool_get_sent_message('Q', name, POOL_SENT_MESSAGE_CREATED); if (!msg) /* message may be created by Parse message */ msg = pool_get_sent_message('P', 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. * There are two cases when this could happen. * (1) mistakes by client. In this case backend will return ERROR * anyway. * (2) previous query was issued as multi-statement query. e.g. * SELECT 1\;PREPARE foo AS SELECT 1; * In this case pgpool does not know anything about the prepared * statement "foo". */ if (SL_MODE) { /* * In streaming replication or logical replication, sent to * primary node only. */ pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } else { /* * In other mode, sent to all node. */ 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 (nodeTag(&v->val)) { case T_String: if (!strcasecmp(v->val.sval.sval, "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.sval.sval, "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.ival.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) && IsA(&((A_Const *) opt->arg)->val, String) && !strcmp("serializable", ((A_Const *) opt->arg)->val.sval.sval)) return true; } return false; } /* * If the query is BEGIN READ WRITE or * BEGIN ... SERIALIZABLE in streaming replication mode, * we send BEGIN to standbys instead. * The original_query which is BEGIN READ WRITE is sent to primary. * The rewritten_query BEGIN is sent to standbys. */ bool pool_need_to_treat_as_if_default_transaction(POOL_QUERY_CONTEXT * query_context) { return (MAIN_REPLICA && 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 (nodeTag(&v->val)) { case T_String: if (!strcasecmp(v->val.sval.sval, "on") || !strcasecmp(v->val.sval.sval, "t") || !strcasecmp(v->val.sval.sval, "true")) ret = true; break; case T_Integer: if (v->val.ival.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.ival.ival; if (read_only) { ret = true; break; } } } } return ret; } /* * Set virtual main node according to the where_to_send map. If there are * multiple sending requests are in the map, the first node id is set to the * virtual_main_node_id. */ static void set_virtual_main_node(POOL_QUERY_CONTEXT *query_context) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (query_context->where_to_send[i]) { query_context->virtual_main_node_id = i; break; } } } /* * Set load balance info. */ static void set_load_balance_info(POOL_QUERY_CONTEXT *query_context) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(false); 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, query_context->load_balance_node_id); } /* * Check if the name is in the list. */ static bool is_in_list(char *name, List *list) { if (name == NULL || list == NIL) return false; ListCell *cell; foreach (cell, list) { char *cell_name = (char *)lfirst(cell); if (strcasecmp(name, cell_name) == 0) { ereport(DEBUG1, (errmsg("[%s] is in list", name))); return true; } } return false; } /* * Check if the relname of SelectStmt is in the temp write list. */ static bool is_select_object_in_temp_write_list(Node *node, void *context) { if (node == NULL || pool_config->disable_load_balance_on_write != DLBOW_DML_ADAPTIVE) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE && session_context->is_in_transaction) { ereport(DEBUG1, (errmsg("is_select_object_in_temp_write_list: \"%s\", found relation \"%s\"", (char*)context, rgv->relname))); return is_in_list(rgv->relname, session_context->transaction_temp_write_list); } } return raw_expression_tree_walker(node, is_select_object_in_temp_write_list, context); } static char* get_associated_object_from_dml_adaptive_relations (char *left_token, DBObjectTypes object_type) { int i; char *right_token = NULL; if (!pool_config->parsed_dml_adaptive_object_relationship_list) return NULL; for (i=0 ;; i++) { if (pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.name == NULL) break; if (pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.object_type != object_type) continue; if (strcasecmp(pool_config->parsed_dml_adaptive_object_relationship_list[i].left_token.name, left_token) == 0) { right_token = pool_config->parsed_dml_adaptive_object_relationship_list[i].right_token.name; break; } } return right_token; } /* * Check the object relationship list. * If find the name in the list, will add related objects to the transaction temp write list. */ void check_object_relationship_list(char *name, bool is_func_name) { if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE && pool_config->parsed_dml_adaptive_object_relationship_list) { POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); if (session_context->is_in_transaction) { char *right_token = get_associated_object_from_dml_adaptive_relations (name, is_func_name? OBJECT_TYPE_FUNCTION : OBJECT_TYPE_RELATION); if (right_token) { MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); session_context->transaction_temp_write_list = lappend(session_context->transaction_temp_write_list, pstrdup(right_token)); MemoryContextSwitchTo(old_context); } } } } /* * Find the relname and add it to the transaction temp write list. */ static bool add_object_into_temp_write_list(Node *node, void *context) { if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; ereport(DEBUG5, (errmsg("add_object_into_temp_write_list: \"%s\", found relation \"%s\"", (char*)context, rgv->relname))); POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); if (!is_in_list(rgv->relname, session_context->transaction_temp_write_list)) { ereport(DEBUG1, (errmsg("add \"%s\" into transaction_temp_write_list", rgv->relname))); session_context->transaction_temp_write_list = lappend(session_context->transaction_temp_write_list, pstrdup(rgv->relname)); } MemoryContextSwitchTo(old_context); check_object_relationship_list(rgv->relname, false); } return raw_expression_tree_walker(node, add_object_into_temp_write_list, context); } /* * dml adaptive. */ static void dml_adaptive(Node *node, char *query) { if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE) { /* Set/Unset transaction status flags */ if (IsA(node, TransactionStmt)) { POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); MemoryContext old_context = MemoryContextSwitchTo(session_context->memory_context); if (is_start_transaction_query(node)) { session_context->is_in_transaction = true; if (session_context->transaction_temp_write_list != NIL) list_free_deep(session_context->transaction_temp_write_list); session_context->transaction_temp_write_list = NIL; } else if(is_commit_or_rollback_query(node)) { session_context->is_in_transaction = false; if (session_context->transaction_temp_write_list != NIL) list_free_deep(session_context->transaction_temp_write_list); session_context->transaction_temp_write_list = NIL; } MemoryContextSwitchTo(old_context); return; } /* If non-selectStmt, find the relname and add it to the transaction temp write list. */ if (!is_select_query(node, query)) add_object_into_temp_write_list(node, query); } } /* * Decide the backend node to be sent in streaming replication mode, logical * replication mode and slony mode. Called by pool_where_to_send. */ static void where_to_send_main_replica(POOL_QUERY_CONTEXT * query_context, char *query, Node *node) { POOL_DEST dest; POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION_POOL *backend; dest = send_to_where(node); session_context = pool_get_session_context(false); backend = session_context->backend; dml_adaptive(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) { if (is_tx_started_by_multi_statement_query()) { /* * If we are in an explicit transaction and the transaction * was started by a multi statement query, we should send * query to primary node only (which was supposed to be sent * to all nodes) until the transaction gets committed or * aborted. */ pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } else { 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 preconditions. TSTATE:%c writing_transaction:%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)) { /* * Load balance if possible */ /* * 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. */ 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 primary_routing_query_pattern_list, we * send only to main node. */ else if (pattern_compare(query, WRITELIST, "primary_routing_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 (is_select_object_in_temp_write_list(node, 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(); } /* * As streaming replication delay is too much, if * prefer_lower_delay_standby is true then elect new * load balance node which is lowest delayed, * false then send to the primary. */ if (STREAM && check_replication_delay(session_context->load_balance_node_id)) { ereport(DEBUG1, (errmsg("could not load balance because of too much replication delay"), errdetail("destination = %d for query= \"%s\"", dest, query))); if (pool_config->prefer_lower_delay_standby) { int new_load_balancing_node = select_load_balancing_node(); session_context->load_balance_node_id = new_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 { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } } else { 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); } } } /* * Decide the backend node to be sent in replication mode and snapshot * isolation mode. * Called by pool_where_to_send. */ static void where_to_send_native_replication(POOL_QUERY_CONTEXT * query_context, char *query, Node *node) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION_POOL *backend; session_context = pool_get_session_context(false); backend = session_context->backend; /* * Check to see if we can load balance the SELECT (or any read only query * from syntactical point of view). */ elog(DEBUG1, "Maybe: load balance mode: %d is_select_query: %d", pool_config->load_balance_mode, is_select_query(node, query)); if (pool_config->load_balance_mode && is_select_query(node, query) && MAJOR(backend) == PROTO_MAJOR_V3) { /* * In snapshot isolation mode, we always load balance if current * transaction is read only unless load balance mode is off. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION && pool_config->load_balance_mode) { if (TSTATE(backend, MAIN_NODE_ID) == 'T') { /* * We are in an explicit transaction. If the transaction is * read only, we can load balance. */ if (session_context->transaction_read_only) { /* Ok, we can load balance. We are done! */ set_load_balance_info(query_context); set_virtual_main_node(query_context); return; } } else if (TSTATE(backend, MAIN_NODE_ID) == 'I') { /* * We are out side transaction. If default transaction is read only, * we can load balance. */ static char *si_query = "SELECT current_setting('transaction_read_only')"; POOL_SELECT_RESULT *res; bool load_balance = false; do_query(CONNECTION(backend, MAIN_NODE_ID), si_query, &res, MAJOR(backend)); if (res) { if (res->data[0] && !strcmp(res->data[0], "on")) { load_balance = true; } free_select_result(res); } per_node_statement_log(backend, MAIN_NODE_ID, si_query); if (load_balance) { /* Ok, we can load balance. We are done! */ set_load_balance_info(query_context); set_virtual_main_node(query_context); return; } } } /* * If a writing function call is used or replicate_select is true, we * have to send to all nodes since the function may modify database. */ elog(DEBUG1, "Maybe sent to all node: pool_has_function_call: %d pool_config->replicate_select: %d", pool_has_function_call(node), pool_config->replicate_select); 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, MAIN_NODE_ID) == 'I' || (!pool_is_writing_transaction() && !pool_is_failed_transaction() && pool_get_transaction_isolation() != POOL_SERIALIZABLE)) { elog(DEBUG1, "load balance TSTATE: %c pool_is_writing_transaction: %d pool_is_failed_transaction: %d pool_get_transaction_isolation: %d", TSTATE(backend, MAIN_NODE_ID), pool_is_writing_transaction(), pool_is_failed_transaction(), pool_get_transaction_isolation()); set_load_balance_info(query_context); } else { /* only send to main node */ elog(DEBUG1, "unable to load balance"); pool_set_node_to_be_sent(query_context, REAL_MAIN_NODE_ID); } } else { if (is_select_query(node, query) && !pool_config->replicate_select && !pool_has_function_call(node)) { /* only send to main node */ pool_set_node_to_be_sent(query_context, REAL_MAIN_NODE_ID); } else { /* send to all nodes */ pool_setall_node_to_be_sent(query_context); } } } /* * Wait for failover/failback to finish. * Return values: * 0: no failover/failback occurred. * -1: failover/failback occurred and finished within certain period. * -2: failover/failback occurred and timed out. */ int wait_for_failover_to_finish(void) { #define MAX_FAILOVER_WAIT 30 /* waiting for failover finish timeout in seconds */ volatile POOL_REQUEST_INFO *my_req; int ret = 0; int i; /* * Wait for failover to finish */ for (i = 0;i < MAX_FAILOVER_WAIT; i++) { my_req = Req_info; if (my_req->switching == 0) return ret; ret = -1; /* failover/failback finished */ sleep(1); } return -2; /* timed out */ } pgpool-II-4.6.0/src/main/0000775000175000017500000000000014760010070012031 500000000000000pgpool-II-4.6.0/src/main/main.c0000664000175000017500000004414614760007565013071 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2022 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 "version.h" #include "pool_config_variables.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 "utils/pool_signal.h" #include "utils/pool_ipc.h" #include "utils/ps_status.h" #include "utils/pool_ssl.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.h" #include "query_cache/pool_memqcache.h" #include "watchdog/wd_utils.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(); SetProcessGlobalVariables(PT_MAIN); 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", pid), errdetail("%m"))); } 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 infinite * 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: \"%m\""))); } 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: \"%m\""))); } #endif mypid = getpid(); SetProcessGlobalVariables(PT_MAIN); write_pid_file(); if (chdir("/")) ereport(WARNING, (errmsg("change directory failed"), errdetail("chdir() system call failed with reason: \"%m\""))); /* 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\""), errdetail("%m"))); } 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"))); } for (;;) { int cnt = 5; /* sending signal retry interval */ if (kill(pid, stop_sig) == -1) { ereport(FATAL, (errmsg("could not stop process with pid: %d", pid), errdetail("%m"))); } ereport(LOG, (errmsg("stop request sent to pgpool (pid: %d). waiting for termination...", pid))); while (kill(pid, 0) == 0) { fprintf(stderr, "."); sleep(1); cnt--; /* If pgpool did not stop within 5 seconds, break the loop and try * to send the signal again */ if (cnt <= 0) break; } if (cnt > 0) break; } 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\"", pool_config->pid_file_name), errdetail("%m"))); 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 \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } else if (readlen == 0) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("EOF detected while reading pid file \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } 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 \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } 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 \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } if (fsync(fd) == -1) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("could not fsync pid file \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } if (close(fd) == -1) { pfree(pid_file); ereport(FATAL, (errmsg("could not close pid file \"%s\"", pool_config->pid_file_name), errdetail("%m"))); } /* 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("%m"))); } pgpool-II-4.6.0/src/main/pool_globals.c0000664000175000017500000000544614760007565014621 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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 /*For getpid*/ #include "pool.h" #include "utils/elog.h" pid_t mypid; /* pgpool parent process id */ pid_t myProcPid; /* process pid */ ProcessType processType; ProcessState processState; bool reset_query_error; /* true if error returned from backend while processing reset queries */ /* * Application name */ static char *process_application_name = "main"; /* * Fixed application names. ordered by ProcessType. */ char *application_names[] = {"main", "child", "sr_check_worker", "heart_beat_sender", "heart_beat_receiver", "watchdog", "life_check", "follow_child", "watchdog_utility", "pcp_main", "pcp_child", "health_check", "logger" }; char * get_application_name_for_process(ProcessType ptype) { if (ptype < 0 || ptype >= PT_LAST_PTYPE) { ereport(ERROR, (errmsg("failed to set application name. process type: %d", ptype))); } return application_names[ptype]; } /* * Set application name by ProcessType */ void set_application_name(ProcessType ptype) { process_application_name = get_application_name_for_process(ptype); } /* * Set application name with arbitrary string. The storage for the string must * be persistent at least in the session. */ void set_application_name_with_string(char *string) { process_application_name = string; } /* * Set application name with suffix */ void set_application_name_with_suffix(ProcessType ptype, int suffix) { static char appname_buf[POOLCONFIG_MAXNAMELEN +1]; snprintf(appname_buf, POOLCONFIG_MAXNAMELEN, "%s%d", get_application_name_for_process(ptype), suffix); set_application_name_with_string(appname_buf); } /* * Get current application name */ char * get_application_name(void) { return process_application_name; } void SetProcessGlobalVariables(ProcessType pType) { processType = pType; myProcPid = getpid(); set_application_name(pType); } pgpool-II-4.6.0/src/main/pgpool_main.c0000664000175000017500000041570714760007565014456 00000000000000/* -*-pgpool_main-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include #ifdef __FreeBSD__ #include #endif #include "pool.h" #include "version.h" #include "pool_config.h" #include "main/health_check.h" #include "main/pool_internal_comms.h" #include "main/pgpool_logger.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/statistics.h" #include "utils/pool_ipc.h" #include "context/pool_process_context.h" #include "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.h" #include "query_cache/pool_memqcache.h" #include "watchdog/wd_internal_commands.h" #include "watchdog/wd_lifecheck.h" #include "watchdog/watchdog.h" #include "pcp/pcp_worker.h" #include /* * 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_QUARANTINE_NODES, /* notify main about send degenerate requests * for all quarantine nodes */ MAX_INTERRUPTS /* Must be last! */ } User1SignalReason; typedef struct User1SignalSlot { sig_atomic_t signalFlags[MAX_INTERRUPTS]; } User1SignalSlot; #ifdef NOT_USED /* * Process pending signal actions. */ #define CHECK_REQUEST \ do { \ if (wakeup_request) \ { \ wakeup_children(); \ wakeup_request = 0; \ } \ if (sigusr1_request) \ { \ do {\ sigusr1_request = 0; \ sigusr1_interrupt_processor(); \ } while (sigusr1_request == 1); \ } \ if (sigchld_request) \ { \ reaper(); \ } \ if (reload_config_request) \ { \ reload_config(); \ reload_config_request = 0; \ } \ } while (0) #endif #define PGPOOLMAXLITSENQUEUELENGTH 10000 #define MAX_ONE_SHOT_KILLS 8 #define UNIXSOCK_PATH_BUFLEN sizeof(((struct sockaddr_un *) NULL)->sun_path) /* * Context data while exectuing failover() */ typedef struct { bool all_backend_down; /* true if all backends are down */ bool search_primary; /* true if we need to seach primary node */ bool need_to_restart_children; /* true if we need to restart child process */ bool need_to_restart_pcp; /* true if we need to restart pc process */ bool partial_restart; /* true if partial restart is needed */ bool sync_required; /* true if watchdog synchronization is necessary */ POOL_REQUEST_KIND reqkind; int node_id_set[MAX_NUM_BACKENDS]; int node_count; unsigned char request_details; /* * An array to hold down nodes information. Each array member corresponds * to node id. If nodes[i] is 1, the node i is down. */ int nodes[MAX_NUM_BACKENDS]; } FAILOVER_CONTEXT; 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 *fds, 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, const char *group, const int permissions); static int *create_unix_domain_sockets_by_list(struct sockaddr_un *un_addrs, char *group, int permissions, int n_sockets); static int *create_inet_domain_sockets(const char *hostname, const int port); static int *create_inet_domain_sockets_by_list(char **listen_addresses, int n_listen_addresses, int port, int *n_sockets); 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_main_node, 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_interrupt_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_main_node, int new_main_node, int old_primary); static int find_primary_node(void); static int find_primary_node_repeatedly(void); static void terminate_all_childrens(int sig); 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 int get_server_version(POOL_CONNECTION_POOL_SLOT * *slots, int node_id); static void get_info_from_conninfo(char *conninfo, char *host, int hostlen, char *port, int portlen); /* * Subroutines of failover() */ static int handle_failback_request(FAILOVER_CONTEXT *failover_context, int node_id); static int handle_failover_request(FAILOVER_CONTEXT *failover_context, int node_id); static void kill_failover_children(FAILOVER_CONTEXT *failover_context, int node_id); static void exec_failover_command(FAILOVER_CONTEXT *failover_context, int new_main_node_id, int promote_node_id); static int determine_new_primary_node(FAILOVER_CONTEXT *failover_context, int node_id); static int exec_follow_primary_command(FAILOVER_CONTEXT *failover_context, int node_id, int new_primary_node_id); static void save_node_info(FAILOVER_CONTEXT *failover_context, int new_primary_node_id, int new_main_node_id); static void exec_child_restart(FAILOVER_CONTEXT *failover_context, int node_id); static void exec_notice_pcp_child(FAILOVER_CONTEXT *failover_context); static void check_requests(void); static void print_signal_member(sigset_t *sig); static void service_child_processes(void); static int select_victim_processes(int *process_info_idxs, int count); static struct sockaddr_un *un_addrs; /* unix domain socket path */ static struct sockaddr_un *pcp_un_addrs; /* 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 */ int current_child_process_count; 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 = NULL; /* listening file descriptors (UNIX socket, * inet domain sockets) */ static int *pcp_fds = NULL; /* listening file descriptors for pcp (UNIX socket, * inet domain sockets) */ extern char *pcp_conf_file; /* path for pcp.conf */ extern char *conf_file; extern char *hba_file; static volatile sig_atomic_t exiting = 0; /* non 0 if I'm exiting */ static volatile sig_atomic_t 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 pgpool_logger_pid = 0; /* pid for pgpool_logger 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_main_node_id; /* Main node id buffer */ /* * Dummy variable to suppress compiler warnings by discarding return values * from write(2) in signal handlers */ static int dummy_status; /* * Snapshot Isolation manage area */ volatile SI_ManageInfo *si_manage_info; /* * pgpool main program */ int PgpoolMain(bool discard_status, bool clear_memcache_oidmaps) { int num_inet_fds = 0; int num_unix_fds = 0; int num_pcp_fds = 0; int *unix_fds; int *inet_fds; int *pcp_unix_fds; int *pcp_inet_fds; int i; char unix_domain_socket_path[UNIXSOCK_PATH_BUFLEN + 1024]; 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); processState = INITIALIZING; /* * Restore previous backend status if possible */ read_status_file(discard_status); /* set unix domain socket path for connections to pgpool */ for (i = 0; i < pool_config->num_unix_socket_directories; i++) { memset(unix_domain_socket_path, 0, sizeof(unix_domain_socket_path)); snprintf(unix_domain_socket_path, sizeof(unix_domain_socket_path), "%s/.s.PGSQL.%d", pool_config->unix_socket_directories[i], pool_config->port); if (strlen(unix_domain_socket_path) >= UNIXSOCK_PATH_BUFLEN) { ereport(WARNING, (errmsg("Unix-domain socket path \"%s\" is too long (maximum %d bytes)", unix_domain_socket_path, (int) (UNIXSOCK_PATH_BUFLEN - 1)))); continue; } un_addrs = realloc(un_addrs, sizeof(struct sockaddr_un) * (num_unix_fds + 1)); if (un_addrs == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); snprintf(un_addrs[i].sun_path, sizeof(un_addrs[i].sun_path), "%s", unix_domain_socket_path); num_unix_fds++; } if (num_unix_fds == 0) { ereport(FATAL, (errmsg("could not create any Unix-domain sockets"))); } /* set unix domain socket path for pgpool PCP communication */ for (i = 0; i < pool_config->num_pcp_socket_directories; i++) { memset(unix_domain_socket_path, 0, sizeof(unix_domain_socket_path)); snprintf(unix_domain_socket_path, sizeof(unix_domain_socket_path), "%s/.s.PGSQL.%d", pool_config->pcp_socket_dir[i], pool_config->pcp_port); if (strlen(unix_domain_socket_path) >= UNIXSOCK_PATH_BUFLEN) { ereport(WARNING, (errmsg("PCP Unix-domain socket path \"%s\" is too long (maximum %d bytes)", unix_domain_socket_path, (int) (UNIXSOCK_PATH_BUFLEN - 1)))); continue; } pcp_un_addrs = realloc(pcp_un_addrs, sizeof(struct sockaddr_un) * (num_pcp_fds + 1)); if (pcp_un_addrs == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); snprintf(pcp_un_addrs[i].sun_path, sizeof(pcp_un_addrs[i].sun_path), "%s", unix_domain_socket_path); num_pcp_fds++; } if (num_pcp_fds == 0) { ereport(FATAL, (errmsg("could not create any PCP Unix-domain sockets"))); } /* set up signal handlers */ pool_signal(SIGPIPE, SIG_IGN); /* start the log collector if enabled */ pgpool_logger_pid = SysLogger_Start(); /* * If using syslogger, close the read side of the pipe. We don't bother * tracking this in fd.c, either. */ if (syslogPipe[0] >= 0) close(syslogPipe[0]); syslogPipe[0] = -1; initialize_shared_mem_objects(clear_memcache_oidmaps); /* * install the callback for preparation of system exit */ on_system_exit(system_will_go_down, (Datum) NULL); /* setup signal handlers */ pool_signal(SIGCHLD, reap_handler); pool_signal(SIGUSR1, sigusr1_handler); pool_signal(SIGUSR2, wakeup_handler); pool_signal(SIGTERM, exit_handler); pool_signal(SIGINT, exit_handler); pool_signal(SIGQUIT, exit_handler); pool_signal(SIGHUP, reload_config_handler); if (pool_config->use_watchdog) { sigset_t mask; wakeup_request = 0; /* * Watchdog process fires SIGUSR2 once in stable state * In addition, when watchdog fails to start with FATAL, the process * exits and SIGCHLD is fired, so we can also expect SIGCHLD from * watchdog process. Finally, we also need to look for the SIGUSR1 * signal for the failover requests from other watchdog nodes. In * case a request arrives at the same time when the watchdog has just * been initialized. * * So 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); sigdelset(&mask, SIGHUP); 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) { do { sigusr1_request = 0; sigusr1_interrupt_processor(); } while (sigusr1_request == 1); } } /* create unix domain socket(s) */ fds = malloc(sizeof(int) * (num_unix_fds + 1)); if (fds == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); unix_fds = create_unix_domain_sockets_by_list(un_addrs, pool_config->unix_socket_group, pool_config->unix_socket_permissions, num_unix_fds); for (i = 0; i < num_unix_fds; i++) { on_proc_exit(FileUnlink, (Datum) un_addrs[i].sun_path); } /* copy unix domain sockets */ memcpy(fds, unix_fds, sizeof(int) * num_unix_fds); fds[num_unix_fds] = -1; free(unix_fds); /* create inet domain socket if any */ inet_fds = create_inet_domain_sockets_by_list(pool_config->listen_addresses, pool_config->num_listen_addresses, pool_config->port, &num_inet_fds); /* copy inet domain sockets if any */ if (num_inet_fds > 0) { fds = realloc(fds, sizeof(int) * (num_inet_fds + num_unix_fds + 1)); if (fds == NULL) ereport(FATAL, (errmsg("failed to expand memory for fds"))); memcpy(&fds[num_unix_fds], inet_fds, sizeof(int) * num_inet_fds); fds[num_unix_fds + num_inet_fds] = -1; free(inet_fds); } /* For query cache concurrency control */ if (pool_config->memory_cache_enabled) { char path[1024]; int lfd; snprintf(path, sizeof(path), "%s/QUERY_CACHE_LOCK_FILE", pool_config->logdir); lfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (lfd == -1) { ereport(FATAL, (errmsg("Failed to open lock file for query cache \"%s\"", path), errdetail("%m"))); } close(lfd); /* Register file unlink at exit */ on_proc_exit(FileUnlink, (Datum) path); } /* * 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); if (pool_config->process_management == PM_DYNAMIC) { if (pool_config->process_management_strategy == PM_STRATEGY_AGGRESSIVE) current_child_process_count = pool_config->max_spare_children; else current_child_process_count = pool_config->min_spare_children; } else current_child_process_count = pool_config->num_init_children; ereport(DEBUG1, (errmsg("Spawning %d child processes",current_child_process_count))); for (i = 0; i < current_child_process_count; i++) { process_info[i].start_time = time(NULL); process_info[i].client_connection_count = 0; process_info[i].status = WAIT_FOR_CONNECT; process_info[i].connected = 0; process_info[i].wait_for_connect = 0; process_info[i].pooled_connections = 0; process_info[i].need_to_restart = false; process_info[i].exit_if_idle = false; process_info[i].pid = fork_a_child(fds, i); } /* 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(); } /* create pcp unix domain socket */ num_inet_fds = 0; pcp_unix_fds = create_unix_domain_sockets_by_list(pcp_un_addrs, "", 0777, num_pcp_fds); for (i = 0; i < num_pcp_fds; i++) { on_proc_exit(FileUnlink, (Datum) pcp_un_addrs[i].sun_path); } pcp_fds = malloc(sizeof(int) * (num_pcp_fds + 1)); if (pcp_fds == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); memcpy(pcp_fds, pcp_unix_fds, sizeof(int) * num_pcp_fds); pcp_fds[num_pcp_fds] = -1; free(pcp_unix_fds); /* create inet domain socket if any */ pcp_inet_fds = create_inet_domain_sockets_by_list(pool_config->pcp_listen_addresses, pool_config->num_pcp_listen_addresses, pool_config->pcp_port, &num_inet_fds); if (num_inet_fds > 0) { pcp_fds = realloc(pcp_fds, sizeof(int) * (num_inet_fds + num_pcp_fds + 1)); if (pcp_fds == NULL) ereport(FATAL, (errmsg("failed to expand memory for pcp_fds"))); memcpy(&pcp_fds[num_pcp_fds], pcp_inet_fds, sizeof(int) * num_inet_fds); pcp_fds[num_inet_fds + num_pcp_fds] = -1; free(pcp_inet_fds); } pcp_pid = pcp_fork_a_child(pcp_fds, 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 pending requests */ check_requests(); #ifdef NOT_USED CHECK_REQUEST; #endif /* * check for child signals to ensure child startup before reporting * successful 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 = {2, 0}; POOL_SETMASK(&UnBlockSig); r = pool_pause(&t); POOL_SETMASK(&BlockSig); if (pool_config->process_management == PM_DYNAMIC) service_child_processes(); 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_interrupt(void) { signal_user1_to_parent_with_reason(SIG_WATCHDOG_QUORUM_CHANGED); } void register_watchdog_state_change_interrupt(void) { signal_user1_to_parent_with_reason(SIG_WATCHDOG_STATE_CHANGED); } void register_backend_state_sync_req_interrupt(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_QUARANTINE_NODES); } static void signal_user1_to_parent_with_reason(User1SignalReason reason) { ereport(LOG, (errmsg("signal_user1_to_parent_with_reason(%d)", reason))); user1SignalSlot->signalFlags[reason] = true; pool_signal_parent(SIGUSR1); } /* * fork a child for PCP */ static pid_t pcp_fork_a_child(int *fds, char *pcp_conf_file) { pid_t pid; pid = fork(); if (pid == 0) { on_exit_reset(); SetProcessGlobalVariables(PT_PCP); close(pipe_fds[0]); close(pipe_fds[1]); /* call PCP child main */ health_check_timer_expired = 0; reload_config_request = 0; pcp_main(fds); } else if (pid == -1) { ereport(FATAL, (errmsg("fork() failed. reason: %m"))); } 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]); } SetProcessGlobalVariables(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: %m"))); } 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]); } SetProcessGlobalVariables(type); ereport(LOG, (errmsg("process started"))); /* 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: %m"))); } return pid; } /* * Create a socket list by "hostname" and return it. "hostname" can be either * single host name, IP or "*" which means all available UP interface. If * fails with getaddrinfo, socket, setsockopt, bind or listen, return NULL and * pgpool will ignore the hostname. This could happen if wrong hostname or * duplicated hostname is specified in listen_addresses parameter. */ 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: %m"))); } if ((ret = getaddrinfo((!hostname || strcmp(hostname, "*") == 0) ? NULL : hostname, portstr, &hints, &res)) != 0) { /* Perhaps wrong hostname or IP */ ereport(WARNING, (errmsg("failed to create INET domain socket"), errdetail("getaddrinfo() failed: %s", gai_strerror(ret)))); free(portstr); return NULL; } 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: \"%m\"", buf))); continue; } if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one))) == -1) { ereport(WARNING, (errmsg("failed to create INET domain socket"), errdetail("socket error \"%m\""))); close(fd); continue; } 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: \"%m\"", buf))); } } if (bind(fd, walk->ai_addr, walk->ai_addrlen) != 0) { ereport(WARNING, (errmsg("failed to create INET domain socket"), errdetail("bind on socket failed with error \"%m\""))); close(fd); continue; } backlog = pool_config->num_init_children * pool_config->listen_backlog_multiplier; if (backlog > PGPOOLMAXLITSENQUEUELENGTH) backlog = PGPOOLMAXLITSENQUEUELENGTH; status = listen(fd, backlog); if (status < 0) { ereport(WARNING, (errmsg("failed to create INET domain socket"), errdetail("listen on socket failed with error \"%m\""))); close(fd); continue; } sockfds[n++] = fd; } freeaddrinfo(res); if (n == 0) { /* No sockets created. Perhaps duplicated listen address. */ free(sockfds); return NULL; } return sockfds; } /* * create UNIX domain socket */ static int create_unix_domain_socket(struct sockaddr_un un_addr_tmp, const char *group, const int permissions) { 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: \"%m\""))); } 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: \"%m\""))); } if (*group != '\0') { char *endptr; gid_t gid; unsigned long val; /* check group*/ val = strtoul(group, &endptr, 10); if (*endptr == '\0') { gid = val; } else { struct group *gr; gr = getgrnam(group); if(!gr) { ereport(FATAL, (errmsg("unix_socket_group \"%s\" does not exist", group))); } gid = gr->gr_gid; } if (chown(un_addr_tmp.sun_path, -1, gid) == -1) { ereport(FATAL, (errmsg("failed to bind a socket: \"%s\"", un_addr_tmp.sun_path), errdetail("system call chown failed with error: \"%m\""))); } } if (chmod(un_addr_tmp.sun_path, permissions) == -1) { ereport(FATAL, (errmsg("failed to bind a socket: \"%s\"", un_addr_tmp.sun_path), errdetail("system call chmod failed with error: \"%m\""))); } 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: \"%m\""))); } return fd; } /* * sends the kill signal to all Pgpool children except to * the pgpool_logger child * wait for the termination of all killed children before returning. */ static void terminate_all_childrens(int sig) { pid_t wpid; int i; int killed_count = 0; int terminated_count = 0; /* * This is supposed to be called from main process */ if (processType != PT_MAIN) return; if (sig != SIGTERM && sig != SIGINT && sig != SIGQUIT) { ereport(LOG, (errmsg("invalid terminate signal: \"%d\"", sig), errdetail("ignoring"))); return; } 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; killed_count++; } } if (pcp_pid != 0) { kill(pcp_pid, sig); killed_count++; } pcp_pid = 0; if (worker_pid != 0) { kill(worker_pid, sig); killed_count++; } worker_pid = 0; if (pool_config->use_watchdog) { if (pool_config->use_watchdog) { if (watchdog_pid) { kill(watchdog_pid, sig); killed_count++; } watchdog_pid = 0; if (wd_lifecheck_pid) { kill(wd_lifecheck_pid, sig); killed_count++; } wd_lifecheck_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; killed_count++; } } /* wait for all killed children to exit */ do { int ret_pid; wpid = waitpid(-1, &ret_pid, 0); if (wpid > 0) terminated_count++; } while (terminated_count < killed_count && (wpid > 0 || (wpid == -1 && errno == EINTR))); if (wpid == -1 && errno != ECHILD) ereport(LOG, (errmsg("wait() failed"), errdetail("%m"))); } /* * Pgpool main process exit handler */ static RETSIGTYPE exit_handler(int sig) { int *walk; int save_errno = errno; ereport(LOG, (errmsg("exit handler called (signal: %d)", sig))); 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; } /* * Check if another exit handler instance is already running. It is * possible that exit_handler is interrupted in the middle by other * signal. */ if (exiting) { POOL_SETMASK(&UnBlockSig); errno = save_errno; return; } /* Check to make sure that other exit handler is not running */ pool_semaphore_lock(MAIN_EXIT_HANDLER_SEM); if (exiting == 0) { exiting = 1; pool_semaphore_unlock(MAIN_EXIT_HANDLER_SEM); } else { pool_semaphore_unlock(MAIN_EXIT_HANDLER_SEM); ereport(LOG, (errmsg("exit handler (signal: %d) called. but exit handler is already in progress", sig))); POOL_SETMASK(&UnBlockSig); errno = save_errno; return; } processState = EXITING; ereport(LOG, (errmsg("shutting down by signal %d", sig))); /* Close listen socket if they are already initialized */ if (fds) { for (walk = fds; *walk != -1; walk++) close(*walk); } ereport(LOG, (errmsg("terminating all child processes"))); terminate_all_childrens(sig); /* * Send signal to follow child process and it's children. */ if (follow_pid > 0) { ereport(LOG, (errmsg("terminating all child processes of follow child"))); kill(follow_pid, sig); switch (sig) { case SIGINT: case SIGTERM: case SIGQUIT: case SIGSTOP: case SIGKILL: if (kill(-follow_pid, sig) < 0) elog(LOG, "kill(%ld,%d) failed: %m", (long) (-follow_pid), sig); break; default: break; } } POOL_SETMASK(&UnBlockSig); ereport(LOG, (errmsg("Pgpool-II system is shutdown"))); process_info = NULL; exit(0); } /* * Calculate next valid main node id. * If no valid node found, returns -1. */ int get_next_main_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 main 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"), errdetail("%m"))); #endif POOL_SETMASK(&UnBlockSig); errno = save_errno; } static void sigusr1_interrupt_processor(void) { ereport(LOG, (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 (wd_internal_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_QUARANTINE_NODES]) { ereport(LOG, (errmsg("Pgpool-II parent process received inform quarantine nodes signal from watchdog"))); user1SignalSlot->signalFlags[SIG_INFORM_QUARANTINE_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 (wd_internal_get_watchdog_local_node_state() == WD_STANDBY) { ereport(LOG, (errmsg("leader watchdog has performed failover"), errdetail("syncing the backend states from the LEADER watchdog node"))); sync_backend_from_watchdog(); } } if (user1SignalSlot->signalFlags[SIG_WATCHDOG_STATE_CHANGED]) { ereport(LOG, (errmsg("Pgpool-II parent process received watchdog state change signal from watchdog"))); user1SignalSlot->signalFlags[SIG_WATCHDOG_STATE_CHANGED] = false; if (wd_internal_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 LEADER watchdog node"))); sync_backend_from_watchdog(); /* * we also want to release the follow_primary lock if it was held * by the remote node. * because the change of watchdog coordinator would lead to forever stuck * in the the locked state */ pool_release_follow_primary_lock(true); } } 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; } /* * The workhorse of failover processing. Directly called with pgpool main * process or called from sigusr1_interrupt_processor() after SIGUSR1 signal * is received. */ static void failover(void) { FAILOVER_CONTEXT failover_context; int node_id; int new_main_node; int new_primary = -1; int i; ereport(DEBUG1, (errmsg("failover handler called"))); /* * 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; } /* initialize failover context */ memset(&failover_context, 0, sizeof(failover_context)); failover_context.search_primary = true; Req_info->switching = true; switching = 1; /* * This loop processes each failover/failback request until the queue is * empty. */ for (;;) { int queue_index; int promote_node = 0; 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(failover_context.node_id_set, Req_info->request[queue_index].node_id, (sizeof(int) * Req_info->request[queue_index].count)); failover_context.reqkind = Req_info->request[queue_index].kind; failover_context.request_details = Req_info->request[queue_index].request_details; failover_context.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", failover_context.reqkind, failover_context.request_details, failover_context.node_count, queue_index))); if (failover_context.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/native replication 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 main node"))); /* If this is promoting specified node, new_main_node * should be replaced by the requested node. The requested * node should be REAL_PRIMARY_NODE_ID. */ if (failover_context.request_details & REQ_DETAIL_PROMOTE) { promote_node = failover_context.node_id_set[0]; for (i = 0; i < failover_context.node_count; i++) { failover_context.node_id_set[i] = REAL_PRIMARY_NODE_ID; } } node_id = failover_context.node_id_set[0]; /* failback request? */ if (failover_context.reqkind == NODE_UP_REQUEST) { if (handle_failback_request(&failover_context, node_id) < 0) continue; } else if (failover_context.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 */ { if (handle_failover_request(&failover_context, node_id) < 0) continue; } /* * Determin new main node. */ new_main_node = get_next_main_node(); if (new_main_node < 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, failover_context.reqkind, failover_context.request_details & REQ_DETAIL_SWITCHOVER, node_id))); /* * Kill child process to prepare failover/failback. */ kill_failover_children(&failover_context, node_id); /* * Exec failover_command if needed. We do not execute failover when * request is quarantine type. Also if the request is to promote * specified node, execute failover command. */ exec_failover_command(&failover_context, new_main_node, promote_node); /* * Determine new primary node id. Possibly call find_primary_node_repeatedly(). */ new_primary = determine_new_primary_node(&failover_context, node_id); /* * If follow_primary_command is provided and in streaming * replication mode, we start degenerating all backends as they are * not replicated anymore. */ i = exec_follow_primary_command(&failover_context, node_id, new_primary); /* if follow primary command was executed, main node can be changed */ if (i >= 0) new_main_node = i; /* * Now new primary node and new main node are established. * Save them into shared memory. Also update status changed time. */ save_node_info(&failover_context, new_primary, new_main_node); /* Kill children and restart them if needed */ exec_child_restart(&failover_context, node_id); } /* * We are almost done. * Unlock flags. */ pool_semaphore_lock(REQUEST_INFO_SEM); switching = 0; Req_info->switching = false; pool_semaphore_unlock(REQUEST_INFO_SEM); /* * kick wakeup_handler in pcp_child to notice that failover/failback done. */ exec_notice_pcp_child(&failover_context); } /* * 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"), errdetail("%m"))); #endif POOL_SETMASK(&UnBlockSig); errno = save_errno; } /* * pool_waitpid: * nothing more than a wrapper function over NOHANG mode waitpid() or wait3() * depending on the existence 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"; } if (pid == pgpool_logger_pid) return "pgpool log collector"; 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); bool process_health_check = false; /* * 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 or sigkill. Report it */ if (WTERMSIG(status) == SIGSEGV) ereport(WARNING, (errmsg("%s process with pid: %d was terminated by segmentation fault", exiting_process_name, pid))); else if (WTERMSIG(status) == SIGKILL) ereport(WARNING, (errmsg("%s process with pid: %d was terminated by sigkill", exiting_process_name, pid))); else ereport(DEBUG1, (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 abnormally. 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(DEBUG1, (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_fds, 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; } else if (pid == pgpool_logger_pid) { if (restart_child) { pgpool_logger_pid = SysLogger_Start(); } else pgpool_logger_pid = 0; } /* exiting process was follow child process */ else if (pid == follow_pid) { follow_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 && pool_config->process_management != PM_DYNAMIC) { process_info[i].pid = fork_a_child(fds, i); process_info[i].start_time = time(NULL); new_pid = process_info[i].pid; process_info[i].client_connection_count = 0; process_info[i].status = WAIT_FOR_CONNECT; process_info[i].connected = 0; process_info[i].wait_for_connect = 0; } else { current_child_process_count--; process_info[i].pid = 0; } break; } } } /* Check health check process */ if (found == false) { process_health_check = true; 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(DEBUG1, (errmsg("fork a new %s process with pid: %d", exiting_process_name, new_pid))); } else { if (process_health_check == false) { /* 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 cnt = 0; int i; for (i=0;i < pool_config->num_init_children;i++) { if (process_info[i].pid != 0) cnt++; } *array_size = cnt; cnt = 0; array = palloc0(*array_size * sizeof(int)); for (i = 0; i < pool_config->num_init_children || cnt < *array_size; i++) { if (process_info[i].pid != 0) { array[cnt] = process_info[i].pid; cnt++; } } 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"), errdetail("%m"))); #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"), errdetail("%m"))); #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); } } } if (sig == SIGHUP) { /* make PCP process reload as well */ if (pcp_pid > 0) kill(pcp_pid, sig); /* make health check process reload as well */ for (i = 0; i < NUM_BACKENDS; i++) { if (health_check_pids[i] > 0) kill(health_check_pids[i], sig); } /* make worker process reload as well */ if (worker_pid > 0) kill(worker_pid, sig); /* make watchdog process reload as well */ if (watchdog_pid > 0) kill(watchdog_pid, sig); /* make logger process reload as well */ if (pgpool_logger_pid > 0) kill(pgpool_logger_pid, 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"), errdetail("%m"))); } 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_requests(); 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_main_node, int new_main_node, int old_primary) { int r = 0; StringInfoData exec_cmd_data; StringInfo exec_cmd = &exec_cmd_data; BackendInfo *info; BackendInfo *newmain; 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; initStringInfo(exec_cmd); while (*command_line) { if (*command_line == '%') { if (*(command_line + 1)) { char val = *(command_line + 1); switch (val) { case 'p': /* failed node port */ appendStringInfo(exec_cmd, " %d", info->backend_port); break; case 'D': /* failed node database directory */ appendStringInfoString(exec_cmd, info->backend_data_directory); break; case 'd': /* failed node id */ appendStringInfo(exec_cmd, " %d", node); break; case 'h': /* failed host name */ appendStringInfoString(exec_cmd, info->backend_hostname); break; case 'H': /* new main host name */ newmain = pool_get_node_info(new_main_node); if (newmain) appendStringInfoString(exec_cmd, newmain->backend_hostname); else /* no valid new main */ appendStringInfoString(exec_cmd, "\"\""); break; case 'm': /* new main node id */ appendStringInfo(exec_cmd, " %d", new_main_node); break; case 'r': /* new main node port */ newmain = pool_get_node_info(new_main_node); if (newmain) appendStringInfo(exec_cmd, "%d", newmain->backend_port); else /* no valid new main node */ appendStringInfoString(exec_cmd, "\"\""); break; case 'R': /* new main database directory */ newmain = pool_get_node_info(new_main_node); if (newmain) appendStringInfoString(exec_cmd, newmain->backend_data_directory); else /* no valid new main */ appendStringInfoString(exec_cmd, "\"\""); break; case 'M': /* old main node id */ appendStringInfo(exec_cmd, "%d", old_main_node); break; case 'P': /* old primary node id */ appendStringInfo(exec_cmd, "%d", old_primary); break; case 'N': /* old primary host name */ oldprimary = pool_get_node_info(old_primary); if (oldprimary) appendStringInfoString(exec_cmd, oldprimary->backend_hostname); else /* no valid old primary */ appendStringInfoString(exec_cmd, "\"\""); break; case 'S': /* old primary port */ oldprimary = pool_get_node_info(old_primary); if (oldprimary) appendStringInfo(exec_cmd, "%d", oldprimary->backend_port); else /* no valid old primary */ appendStringInfoString(exec_cmd, "\"\""); break; case '%': /* escape */ appendStringInfoString(exec_cmd, "%"); break; default: /* ignore */ break; } command_line++; } } else appendStringInfoChar(exec_cmd, *command_line); command_line++; } if (strlen(exec_cmd->data) != 0) { ereport(LOG, (errmsg("execute command: %s", exec_cmd->data))); r = system(exec_cmd->data); } pfree(exec_cmd->data); 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_catalog.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[MAX_DB_HOST_NAMELEN]; 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 (!slots[i]) continue; if (get_server_version(slots, i) >= 90600) { check_connectivity = true; break; } } if (!check_connectivity) { ereport(DEBUG1, (errmsg("verify_backend_node_status: server version 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 && slots[j]) { ereport(DEBUG1, (errmsg("verify_backend_node_status: %d is standby", j))); if (get_query_result(slots, j, "SELECT status, conninfo FROM pg_catalog.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, sizeof(host), port, sizeof(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') || /* * It is possible that backend_hostname is Unix * domain socket but wal_receiver connects via * TCP/IP localhost. */ (*backend_info->backend_hostname == '/' && !strcmp("localhost", host)) || !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_PRIMARY" 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_PRIMARY & BACKEND_INFO(i).flag) { ereport(DEBUG1, (errmsg("find_primary_node: ALWAYS_PRIMARY 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 : "", false); 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 */ pool_acquire_follow_primary_lock(true, false); status = verify_backend_node_status(slots); pool_release_follow_primary_lock(false); 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) { time_t search_primary_expiration; time_t now; 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 follow primary command is ongoing, skip primary node check. Just * return current primary node to avoid deadlock between pgpool main * failover() and follow primary process. */ if (Req_info->follow_primary_ongoing) { ereport(LOG, (errmsg("find_primary_node_repeatedly: follow primary is ongoing. return current primary: %d", Req_info->primary_node_id))); return Req_info->primary_node_id; } /* * 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"))); /* set expiration time for searching the primary node */ search_primary_expiration = time(NULL) + pool_config->search_primary_node_timeout; for (;;) { now = time(NULL); if (pool_config->search_primary_node_timeout == 0 || search_primary_expiration > now) { node_id = find_primary_node(); if (node_id != -1) break; pool_sleep(1); } else { ereport(LOG, (errmsg("failed to find primary node"), errdetail("find_primary_node_repeatedly: expired after %d seconds", pool_config->search_primary_node_timeout))); break; } } return node_id; } /* * fork a follow child */ static pid_t fork_follow_child(int old_main_node, int new_primary, int old_primary) { pid_t pid; int i; pid = fork(); if (pid == 0) { POOL_SETMASK(&UnBlockSig); pool_signal(SIGCHLD, SIG_DFL); pool_signal(SIGUSR1, SIG_DFL); pool_signal(SIGUSR2, SIG_DFL); pool_signal(SIGTERM, SIG_DFL); pool_signal(SIGINT, SIG_DFL); pool_signal(SIGQUIT, SIG_DFL); pool_signal(SIGHUP, SIG_DFL); on_exit_reset(); /* * Set session id if possible */ #ifdef HAVE_SETSID if (setsid() < 0) { ereport(FATAL, (errmsg("could not set session id in the fork_follow_child"), errdetail("setsid() system call failed with reason: \"%m\""))); } #endif SetProcessGlobalVariables(PT_FOLLOWCHILD); /* * when the watchdog is enabled, we would come here * only on the coordinator node. * so before acquiring the local lock, Lock all the * standby nodes so that they should stop false primary * detection until we are finished with the follow primary * command. */ wd_lock_standby(WD_FOLLOW_PRIMARY_LOCK); pool_acquire_follow_primary_lock(true, false); Req_info->follow_primary_ongoing = true; 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) { ereport(LOG, (errmsg("=== Starting follow primary command for node %d ===", i))); trigger_failover_command(i, pool_config->follow_primary_command, old_main_node, new_primary, old_primary); ereport(LOG, (errmsg("=== Follow primary command for node %d ended ===", i))); } } Req_info->follow_primary_ongoing = false; pool_release_follow_primary_lock(false); /* inform standby watchdog nodes to release the lock as well*/ wd_unlock_standby(WD_FOLLOW_PRIMARY_LOCK); exit(0); } else if (pid == -1) { ereport(WARNING, (errmsg("follow fork() failed"), errdetail("%m"))); exit(1); } return pid; } static void initialize_shared_mem_objects(bool clear_memcache_oidmaps) { BackendDesc* backend_desc; Size size; int i; /* * Calculate the size of required shared memory and try to allocate * everything in single memory segment */ size = 256;/* let us have some extra space */ size += MAXALIGN(sizeof(BackendDesc)); elog(DEBUG1, "BackendDesc: %zu bytes requested for shared memory", MAXALIGN(sizeof(BackendDesc))); size += MAXALIGN(pool_coninfo_size()); size += MAXALIGN(pool_config->num_init_children * (sizeof(ProcessInfo))); elog(DEBUG1, "ProcessInfo: num_init_children (%d) * sizeof(ProcessInfo) (%zu) = %zu bytes requested for shared memory", pool_config->num_init_children, sizeof(ProcessInfo), pool_config->num_init_children* sizeof(ProcessInfo)); size += MAXALIGN(sizeof(User1SignalSlot)); elog(DEBUG1, "UserSignalSlot: %zu bytes requested for shared memory", MAXALIGN(sizeof(User1SignalSlot))); size += MAXALIGN(sizeof(POOL_REQUEST_INFO)); elog(DEBUG1, "POOL_REQUEST_INFO: %zu bytes requested for shared memory", MAXALIGN(sizeof(POOL_REQUEST_INFO))); size += MAXALIGN(sizeof(int)); /* for InRecovery */ size += MAXALIGN(stat_shared_memory_size()); elog(DEBUG1, "stat_shared_memory_size: %zu bytes requested for shared memory", MAXALIGN(stat_shared_memory_size())); size += MAXALIGN(health_check_stats_shared_memory_size()); /* Snapshot Isolation manage area */ size += MAXALIGN(sizeof(SI_ManageInfo)); elog(DEBUG1, "SI_ManageInfo: %zu bytes requested for shared memory", MAXALIGN(sizeof(SI_ManageInfo))); size += MAXALIGN(pool_config->num_init_children * sizeof(pid_t)); size += MAXALIGN(pool_config->num_init_children * sizeof(pid_t)); if (pool_is_shmem_cache()) { size += MAXALIGN(pool_shared_memory_cache_size()); size += MAXALIGN(pool_shared_memory_fsmm_size()); size += MAXALIGN(pool_hash_size(pool_config->memqcache_max_num_cache)); } if (pool_config->memory_cache_enabled || pool_config->enable_shared_relcache) { size += MAXALIGN(sizeof(POOL_QUERY_CACHE_STATS)); elog(DEBUG1, "POOL_QUERY_CACHE_STATS: %zu bytes requested for shared memory", MAXALIGN(sizeof(POOL_QUERY_CACHE_STATS))); } if (pool_config->use_watchdog) { size += MAXALIGN(wd_ipc_get_shared_mem_size()); elog(DEBUG1, "watchdog: %zu bytes requested for shared memory", MAXALIGN(wd_ipc_get_shared_mem_size())); } ereport(LOG, (errmsg("allocating (%zu) bytes of shared memory segment",size))); initialize_shared_memory_main_segment(size); /* Move the backend descriptors to shared memory */ backend_desc = pool_shared_memory_segment_get_chunk(sizeof(BackendDesc)); memcpy(backend_desc, pool_config->backend_desc,sizeof(BackendDesc)); pfree(pool_config->backend_desc); pool_config->backend_desc = backend_desc; /* get the shared memory from main segment*/ con_info = (ConnectionInfo *)pool_shared_memory_segment_get_chunk(pool_coninfo_size()); process_info = (ProcessInfo *)pool_shared_memory_segment_get_chunk(pool_config->num_init_children * (sizeof(ProcessInfo))); for (i = 0; i < pool_config->num_init_children; i++) { process_info[i].connection_info = pool_coninfo(i, 0, 0); process_info[i].pid = 0; } user1SignalSlot = (User1SignalSlot *)pool_shared_memory_segment_get_chunk(sizeof(User1SignalSlot)); Req_info = (POOL_REQUEST_INFO *)pool_shared_memory_segment_get_chunk(sizeof(POOL_REQUEST_INFO)); InRecovery = (int *)pool_shared_memory_segment_get_chunk(sizeof(int)); /* Initialize statistics area */ stat_set_stat_area(pool_shared_memory_segment_get_chunk(stat_shared_memory_size())); stat_init_stat_area(); /* Initialize health check statistics area */ health_check_stats_init(pool_shared_memory_segment_get_chunk(health_check_stats_shared_memory_size())); /* Initialize Snapshot Isolation manage area */ si_manage_info = (SI_ManageInfo*)pool_shared_memory_segment_get_chunk(sizeof(SI_ManageInfo)); si_manage_info->snapshot_waiting_children = (pid_t*)pool_shared_memory_segment_get_chunk(pool_config->num_init_children * sizeof(pid_t)); si_manage_info->commit_waiting_children = (pid_t*)pool_shared_memory_segment_get_chunk(pool_config->num_init_children * sizeof(pid_t)); /* * Initialize backend status area. From now on, VALID_BACKEND macro can be * used. (get_next_main_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->main_node_id = get_next_main_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 = RECOVERY_INIT; /* * 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); pool_init_whole_cache_blocks(); } #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 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\"", fnamebuf), errdetail("%m"))); return 0; } /* * First 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; ereport(LOG, (errmsg("reading status file: %d th backend is set to up status", i))); } 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); ereport(LOG, (errmsg("reading status file: %d th backend is set to unused status", 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("%m"))); 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("%m"))); fclose(fd); return -1; } } if (fflush(fd) != 0) { ereport(WARNING, (errmsg("failed to write status file at: \"%s\"", fnamebuf), errdetail("%m"))); 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("%m"))); fclose(fd); return -1; } if (fsync(fdnum) != 0) { ereport(WARNING, (errmsg("failed to fsync(): \"%s\"", fnamebuf), errdetail("%m"))); 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); /* Reloading 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); } /* 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("%m"))); } 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) { ereport(LOG, (errmsg("shutting down"))); terminate_all_childrens(SIGINT); } /* * Send signal to follow child process and it's children. */ if (follow_pid > 0) { ereport(LOG, (errmsg("terminating all child processes of follow child"))); kill(follow_pid, SIGTERM); kill(-follow_pid, SIGTERM); } 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 update_backend_quarantine_status(void) { /* * Reset the quarantine flag from each backend and set it to con_wait */ int i; WD_STATES wd_state = wd_internal_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 LEADER/COORDINATOR watchdog Pgpool-II and synchronize the * local backend states with the cluster wide status of each node. * * Latter in the function 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_master_node_id = false; int down_node_ids[MAX_NUM_BACKENDS]; int down_node_ids_index = 0; int i; WDPGBackendStatus *backendStatus; /* * Ask the watchdog to get all the backend states from the * Leader/Coordinator Pgpool-II node */ backendStatus = get_pg_backend_status_from_leader_wd_node(); if (!backendStatus) { ereport(WARNING, (errmsg("failed to get the backend status from the leader 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 * leader and in that case we need to use the local backend node * status */ ereport(LOG, (errmsg("I am the leader watchdog node"), errdetail("using the local backend node status"))); pfree(backendStatus); return; } ereport(LOG, (errmsg("leader watchdog node \"%s\" returned status for %d backend nodes", backendStatus->nodeName, backendStatus->node_count))); ereport(DEBUG1, (errmsg("primary node on leader 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_master_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 leader \"%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_master_node_id = true; ereport(LOG, (errmsg("backend:%d is set to UP status", i), errdetail("backend:%d is UP on cluster leader \"%s\"", i, backendStatus->nodeName))); } } } /* * Update primary node id info on the shared memory area if it's different * from the one on leader 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 leader watchdog node \"%s\" is different from local primary node:%d", backendStatus->primary_node_id, backendStatus->nodeName, Req_info->primary_node_id))); /* * leader node returns primary_node_id = -1 when the primary node is * in quarantine state on the leader. 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 leader watchdog 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 leader 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_master_node_id) { Req_info->main_node_id = get_next_main_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 immediate * 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 changed 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 changed 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); process_info[i].client_connection_count = 0; process_info[i].status = WAIT_FOR_CONNECT; process_info[i].connected = 0; process_info[i].wait_for_connect = 0; process_info[i].pooled_connections = 0; } } 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++) { if (process_info[i].pid) process_info[i].need_to_restart = 1; } } /* * Send restart request to worker child. */ kill(worker_pid, SIGUSR1); /* 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(i).backend_hostname, BACKEND_INFO(i).backend_port))); health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i); } } } /* * 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 pg_catalog.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, int hostlen, char *port, int portlen) { char *p; *host = '\0'; *port = '\0'; p = strstr(conninfo, "host"); if (p) { /* skip "host=" */ while (*p && *p++ != '=') ; while (*p && hostlen-- && *p != ' ') *host++ = *p++; *host = '\0'; } p = strstr(conninfo, "port"); if (p) { /* skip "port=" */ while (*p && *p++ != '=') ; while (*p && portlen-- && *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; } /* * Acquire lock on follow primary command execution. Follow primary command * and detach_false_primary must acquire this lock before execution because * they are conflicting each other. If argument "block" is true, this * function will not return until it succeeds in acquiring the lock. This * function returns true if succeeded in acquiring the lock. * * first arg:block is ignored when remote_request is set */ bool pool_acquire_follow_primary_lock(bool block, bool remote_request) { pool_sigset_t oldmask; volatile int follow_primary_count; for (;;) { POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(FOLLOW_PRIMARY_SEM); follow_primary_count = Req_info->follow_primary_count; if (follow_primary_count <= 0) { /* the lock is not held by anyone */ ereport(DEBUG1, (errmsg("pool_acquire_follow_primary_lock: lock was not held by anyone"))); break; } else if (follow_primary_count > 0 && remote_request) { if (Req_info->follow_primary_lock_held_remotely) { /* The lock was already held by remote node and we only * support one remote lock */ ereport(LOG, (errmsg("pool_acquire_follow_primary_lock: received remote locking request while lock is already held by the remote node"))); } else { /* set the flag that watchdog has requested the lock */ Req_info->follow_primary_lock_pending = true; } pool_semaphore_unlock(FOLLOW_PRIMARY_SEM); POOL_SETMASK(&oldmask); /* return and inform that the lock was held by someone */ ereport(DEBUG1, (errmsg("pool_acquire_follow_primary_lock: lock was held by someone %d", follow_primary_count))); return false; } else if (follow_primary_count > 0 && !block) { pool_semaphore_unlock(FOLLOW_PRIMARY_SEM); POOL_SETMASK(&oldmask); /* return and inform that the lock was held by someone */ ereport(DEBUG1, (errmsg("pool_acquire_follow_primary_lock: lock was held by someone %d", follow_primary_count))); return false; } pool_semaphore_unlock(FOLLOW_PRIMARY_SEM); POOL_SETMASK(&oldmask); ereport(DEBUG1, (errmsg("pool_acquire_follow_primary_lock: lock was held by someone %d sleeping...", follow_primary_count))); sleep(1); } /* acquire lock */ Req_info->follow_primary_lock_held_remotely = remote_request; Req_info->follow_primary_count = 1; pool_semaphore_unlock(FOLLOW_PRIMARY_SEM); POOL_SETMASK(&oldmask); ereport(DEBUG1, (errmsg("pool_acquire_follow_primary_lock: succeeded in acquiring lock"))); return true; } /* * Release lock on follow primary command execution. */ void pool_release_follow_primary_lock(bool remote_request) { pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(FOLLOW_PRIMARY_SEM); if (remote_request) { if (Req_info->follow_primary_lock_held_remotely) { /* remote request can only release locks held by remote nodes */ Req_info->follow_primary_count = 0; Req_info->follow_primary_lock_held_remotely = false; ereport(DEBUG1, (errmsg("pool_release_follow_primary_lock relased the remote lock"))); } else if (Req_info->follow_primary_count) { /* * we have received the release lock request from remote * but the lock is not held by remote node. * Just ignore the request */ ereport(DEBUG1, (errmsg("pool_release_follow_primary_lock is not relasing the lock since it was not held by remote node"))); } /* * Silently ignore, if we received the release request from remote while no lock was held. * Also clear the pending lock request, As we only support single remote lock */ Req_info->follow_primary_lock_pending = false; } else /*local request */ { /* * if we have a pending lock request from watchdog * do not remove the actual lock, Just clear the pending flag */ if (Req_info->follow_primary_lock_pending) { Req_info->follow_primary_lock_held_remotely = true; Req_info->follow_primary_count = 1; /* also clear the pending lock flag */ Req_info->follow_primary_lock_pending = false; ereport(DEBUG1, (errmsg("pool_release_follow_primary_lock is not relasing the lock and shifting it to coordinator watchdog node"))); } else { if (Req_info->follow_primary_lock_held_remotely) { /* * Ideally this should not happen. * yet if for some reason our local node is trying to release a lock * that is held by remote node. Just produce a LOG message and release * the lock */ ereport(LOG, (errmsg("pool_release_follow_primary_lock is relasing the remote lock by local request"))); } Req_info->follow_primary_count = 0; Req_info->follow_primary_lock_held_remotely = false; } } pool_semaphore_unlock(FOLLOW_PRIMARY_SEM); POOL_SETMASK(&oldmask); ereport(DEBUG1, (errmsg("pool_release_follow_primary_lock called"))); } /* * Sending log rotation signal to logger process. */ void pool_signal_logrotate(void) { if (!pool_config->logging_collector) { ereport(ERROR, (errmsg("process log rotation request failed"), errdetail("logging_collector is disabled"))); } if (pgpool_logger_pid != 0) { ereport(DEBUG1, (errmsg("sending SIGUSR1 to logger process with PID:%d to rotate log file", pgpool_logger_pid))); if (kill(pgpool_logger_pid, SIGUSR1) != 0) ereport(ERROR, (errmsg("process log rotation request failed"), errdetail("failed to send SIGUSR1 to logger process with PID:%d", pgpool_logger_pid))); } else { ereport(ERROR, (errmsg("process log rotation request failed"), errdetail("logger process PID:%d is not valid", pgpool_logger_pid))); } } /* * ------------------------------------------------------------------------- * Subroutines for failover() begin * ------------------------------------------------------------------------- */ /* * Handle failback request. Called from failover(). */ static int handle_failback_request(FAILOVER_CONTEXT *failover_context, int node_id) { if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || (failover_context->reqkind == NODE_UP_REQUEST && !(RAW_MODE && BACKEND_INFO(node_id).backend_status == CON_DOWN) && VALID_BACKEND(node_id)) || (failover_context->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))); return -1; } 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 */ failover_context->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 ((failover_context->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 */ failover_context->search_primary = false; /* * recalculate the main node id after setting the backend * status of quarantined node, this will bring us to the old * main_node_id that was before the quarantine state */ Req_info->main_node_id = get_next_main_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 */ failover_context->need_to_restart_children = true; failover_context->partial_restart = false; } else if (failover_context->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))); failover_context->need_to_restart_children = false; failover_context->partial_restart = false; } else { failover_context->need_to_restart_children = true; failover_context->partial_restart = false; } } else { /* * The request is a proper failback request and not because of * the update status of quarantined node */ (void) write_status_file(); trigger_failover_command(node_id, pool_config->failback_command, MAIN_NODE_ID, get_next_main_node(), PRIMARY_NODE_ID); } failover_context->sync_required = true; return 0; } /* * Handle failover request. Called from failover(). * return -1 if no node is requested failover. */ static int handle_failover_request(FAILOVER_CONTEXT *failover_context, int node_id) { int cnt = 0; /* number of down node ids */ int i; for (i = 0; i < failover_context->node_count; i++) { if (failover_context->node_id_set[i] != -1 && (BACKEND_INFO(failover_context->node_id_set[i]).quarantine == true || ((RAW_MODE && VALID_BACKEND_RAW(failover_context->node_id_set[i])) || VALID_BACKEND(failover_context->node_id_set[i])))) { ereport(LOG, (errmsg("=== Starting %s. shutdown host %s(%d) ===", (failover_context->reqkind == NODE_QUARANTINE_REQUEST) ? "quarantine" : "degeneration", BACKEND_INFO(failover_context->node_id_set[i]).backend_hostname, BACKEND_INFO(failover_context->node_id_set[i]).backend_port))); BACKEND_INFO(failover_context->node_id_set[i]).backend_status = CON_DOWN; /* set down status */ pool_set_backend_status_changed_time(failover_context->node_id_set[i]); if (failover_context->reqkind == NODE_QUARANTINE_REQUEST) { BACKEND_INFO(failover_context->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 value of * old primary */ if (Req_info->primary_node_id == -1 && BACKEND_INFO(failover_context->node_id_set[i]).quarantine == true && BACKEND_INFO(failover_context->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 = failover_context->node_id_set[i]; failover_context->search_primary = false; } BACKEND_INFO(failover_context->node_id_set[i]).quarantine = false; (void) write_status_file(); } /* save down node */ failover_context->nodes[failover_context->node_id_set[i]] = 1; cnt++; } } if (cnt == 0) { ereport(LOG, (errmsg("failover: no backends are degenerated"))); return -1; } return 0; } /* * Kill child process to prepare failover/failback. */ static void kill_failover_children(FAILOVER_CONTEXT *failover_context, int node_id) { int i, j, k; /* * 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. */ /* * We also need to think about a case when the former primary node did * not exist. In the case we need to restart all children as * well. For example when previous primary node id is 0 and then it * went down, restarted, re-attached without promotion. Then existing * child process loses connection slot to node 0 and keeps on using it * when node 0 comes back. This could result in segfault later on in * the child process because there's no connection to node id 0. * * Actually we need to think about when ALWAYS_PRIMARY flag is set * *but* DISALLOW_TO_FAILOVER flag is not set case. In the case after * primary failover Req_info->primary_node_id is set, but connection * to the primary node does not exist. So we should do full restart if * requested node id is the former primary node. * * See bug 672 for more details. */ if (STREAM && failover_context->reqkind == NODE_UP_REQUEST && failover_context->all_backend_down == false && Req_info->primary_node_id >= 0 && Req_info->primary_node_id != node_id) { /* * The decision to restart/no-restart children for update status * request has already been made */ if (!(failover_context->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))); failover_context->need_to_restart_children = false; failover_context->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 && (failover_context->reqkind == NODE_DOWN_REQUEST || failover_context->reqkind == NODE_QUARANTINE_REQUEST) && failover_context->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))); failover_context->need_to_restart_children = true; failover_context->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))); } } failover_context->need_to_restart_children = true; failover_context->partial_restart = false; } } /* * Exec failover_command if needed. We do not execute failover when request is * quarantine type. Also if the request is to promote specified node, execute * failover command. */ static void exec_failover_command(FAILOVER_CONTEXT *failover_context, int new_main_node_id, int promote_node_id) { int i; if (failover_context->reqkind == NODE_DOWN_REQUEST) { for (i = 0; i < pool_config->backend_desc->num_backends; i++) { if (failover_context->nodes[i]) { /* If this is promoting specified node, new_main_node * should be replaced by the requested node. The requested * node should be REAL_PRIMARY_NODE_ID. */ if (failover_context->request_details & REQ_DETAIL_PROMOTE) { trigger_failover_command(i, pool_config->failover_command, MAIN_NODE_ID, promote_node_id, REAL_PRIMARY_NODE_ID); } else { trigger_failover_command(i, pool_config->failover_command, MAIN_NODE_ID, new_main_node_id, REAL_PRIMARY_NODE_ID); } failover_context->sync_required = true; } } } } /* * Determine new primary node id. Possibly call find_primary_node_repeatedly(). */ static int determine_new_primary_node(FAILOVER_CONTEXT *failover_context, int node_id) { int new_primary; if (failover_context->reqkind == PROMOTE_NODE_REQUEST && VALID_BACKEND(node_id)) { new_primary = node_id; } else if (failover_context->reqkind == NODE_QUARANTINE_REQUEST) { /* * If the quarantine node was the primary node, set the new primary * 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 { 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. * This does not apply to the case when no primary node existed * (Req_info->primary_node_id < 0). In this case * find_primary_node_repeatedly() should be called. */ else if (SL_MODE && failover_context->reqkind == NODE_DOWN_REQUEST) { if (Req_info->primary_node_id >= 0 && 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 (failover_context->search_primary == false) { ereport(DEBUG1, (errmsg("failover 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(); } return new_primary; } /* * Execute follow primary command if necessary. * return new main node id if it needs to be changed. * If not changed, -1 will be returned. */ static int exec_follow_primary_command(FAILOVER_CONTEXT *failover_context, int node_id, int new_primary_node_id) { int follow_cnt = 0; int new_main_node_id = -1; int i; if (!STREAM) return -1; if (*pool_config->follow_primary_command != '\0' || failover_context->reqkind == PROMOTE_NODE_REQUEST) { /* * follow primary command is executed in following cases: * - failover against the current primary * - no primary exists and new primary is created by failover * - promote node request */ if (((failover_context->reqkind == NODE_DOWN_REQUEST) && Req_info->primary_node_id >= 0 && (failover_context->nodes[Req_info->primary_node_id])) || (failover_context->reqkind == NODE_DOWN_REQUEST && Req_info->primary_node_id < 0 && new_primary_node_id >= 0) || (node_id >= 0 && (failover_context->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_node_id >= 0) && (i != new_primary_node_id)) { 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 primary node */ new_main_node_id = get_next_main_node(); ereport(LOG, (errmsg("failover: %d follow backends have been degenerated", follow_cnt))); } } } if ((follow_cnt > 0) && (*pool_config->follow_primary_command != '\0')) { /* exec follow child */ follow_pid = fork_follow_child(Req_info->primary_node_id, new_primary_node_id, Req_info->primary_node_id); } return new_main_node_id; } /* * Now new primary node and new main node are established. * Save them into shared memory. Also update status changed time. */ static void save_node_info(FAILOVER_CONTEXT *failover_context, int new_primary_node_id, int new_main_node_id) { /* Save primary node id */ if (Req_info->primary_node_id != new_primary_node_id) { if (Req_info->primary_node_id >= 0) { pool_set_backend_status_changed_time(Req_info->primary_node_id); } if (new_primary_node_id >= 0) { BACKEND_INFO(new_primary_node_id).role = ROLE_PRIMARY; pool_set_backend_status_changed_time(new_primary_node_id); } } Req_info->primary_node_id = new_primary_node_id; ereport(LOG, (errmsg("failover: set new primary node: %d", Req_info->primary_node_id))); if (new_main_node_id >= 0) { Req_info->main_node_id = new_main_node_id; failover_context->sync_required = true; ereport(LOG, (errmsg("failover: set new main node: %d", Req_info->main_node_id))); } } /* * Rstart child process if needed. */ static void exec_child_restart(FAILOVER_CONTEXT *failover_context, int node_id) { int i, j, k; if (failover_context->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 acquire * 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 (failover_context->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); process_info[i].client_connection_count = 0; process_info[i].status = WAIT_FOR_CONNECT; process_info[i].connected = 0; process_info[i].wait_for_connect = 0; process_info[i].pooled_connections = 0; } } 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 (failover_context->sync_required) wd_failover_end(); if (failover_context->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(i).backend_hostname, BACKEND_INFO(i).backend_port))); health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i); } } } else if (failover_context->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 { #ifdef NOT_USED /* * Temporary black magic. Without this regression 055 does not * finish */ fprintf(stderr, "=== %s done. shutdown host %s(%d) ===", (failover_context->reqkind == NODE_DOWN_REQUEST) ? "Failover" : "Quarantine", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port); #endif ereport(LOG, (errmsg("=== %s done. shutdown host %s(%d) ===", (failover_context->reqkind == NODE_DOWN_REQUEST) ? "Failover" : "Quarantine", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); } failover_context->need_to_restart_pcp = true; } /* * kick wakeup_handler in pcp_child to notice that failover/failback done. */ static void exec_notice_pcp_child(FAILOVER_CONTEXT *failover_context) { int status; int sts; kill(pcp_pid, SIGUSR2); if (failover_context->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"), errdetail("%m"))); 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_fds, pcp_conf_file); ereport(LOG, (errmsg("fork a new PCP child pid %d in failover()", pcp_pid))); } } /* * ------------------------------------------------------------------------- * Subroutines for failover() end * ------------------------------------------------------------------------- */ /* * Create UNIX domain sockets by unix_socket_directories/pcp_socket_dir, * which is an array of string. The number of elements is * "n_listen_addresses". "port" is the port number. A socket array is returned. * The number of elements in the socket array is "n_sockets". */ static int * create_unix_domain_sockets_by_list(struct sockaddr_un *un_addrs, char *group, int permissions, int n_sockets) { int i; int *sockets = NULL; if (un_addrs == NULL) return NULL; sockets = malloc(sizeof(int) * n_sockets); if (sockets == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); for (i = 0; i < n_sockets; i++) { ereport(LOG, (errmsg("create socket files[%d]: %s", i, un_addrs[i].sun_path))); sockets[i] = create_unix_domain_socket(un_addrs[i], group, permissions); } return sockets; } /* * Create INET domain sockets by specified listen address list * "listen_addresses", which is an array of string. The number of elements is * "n_listen_addresses". "port" is the port number. A socket array is returned. * The number of elements in the socket array is "n_sockets". */ static int * create_inet_domain_sockets_by_list(char **listen_addresses, int n_listen_addresses, int port, int *n_sockets) { int *sockets = NULL; int i; *n_sockets = 0; if (listen_addresses == NULL || listen_addresses[0] == NULL) return NULL; for (i = 0; i < n_listen_addresses; i++) { int *inet_fds, *walk; int n = 0; /* number of fds returned from create_inet_domain_sockets(). */ ereport(LOG, (errmsg("listen address[%d]: %s", i, listen_addresses[i]))); inet_fds = create_inet_domain_sockets(listen_addresses[i], port); if (!inet_fds) continue; for (walk = inet_fds; *walk != -1; walk++) n++; sockets = realloc(sockets, sizeof(int) * (n + 1 + *n_sockets)); if (sockets == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); n = 0; for (walk = inet_fds; *walk != -1; walk++) { ereport(DEBUG5, (errmsg("set inet socket: %d to sockets[%d]", inet_fds[n], *n_sockets))); sockets[*n_sockets] = inet_fds[n++]; (*n_sockets)++; } sockets[*n_sockets] = -1; free(inet_fds); } return sockets; } /* * Check and execute pending requests set by signal interrupts. */ static void check_requests(void) { sigset_t sig; /* * Waking child request? */ if (wakeup_request) { wakeup_children(); wakeup_request = 0; } /* * Failover or failback request? */ if (sigusr1_request) { do { sigusr1_request = 0; sigusr1_interrupt_processor(); } while (sigusr1_request == 1); } /* Check pending signals (SIGQUIT/SIGTERRM/SIGINT) */ sigpending(&sig); print_signal_member(&sig); /* * Unblock signals so that SIGQUIT/SIGTERRM/SIGINT can be accepted. * They are all shutdown requests. */ POOL_SETMASK(&UnBlockSig); /* * Reap child request? */ if (sigchld_request) { reaper(); } /* * Configuration file reloading request? */ if (reload_config_request) { reload_config(); reload_config_request = 0; } /* * Block signals again */ POOL_SETMASK(&BlockSig); } static void print_signal_member(sigset_t *sig) { if (sigismember(sig, SIGQUIT)) ereport(LOG, (errmsg("SIGQUIT is member"))); if (sigismember(sig, SIGINT)) ereport(LOG, (errmsg("SIGINT is member"))); if (sigismember(sig, SIGTERM)) ereport(LOG, (errmsg("SIGTERM is member"))); } /* * Function does the house keeping of spare child processes */ static void service_child_processes(void) { int connected_children = Req_info->conn_counter; int idle_children = current_child_process_count - connected_children; static int high_load_counter = 0; ereport(DEBUG2, (errmsg("current_children_count = %d idle_children = %d connected_children = %d high_load_counter = %d", current_child_process_count, idle_children, connected_children, high_load_counter))); if (idle_children > pool_config->max_spare_children) { int ki; int victim_count; int kill_process_info_idxs[MAX_ONE_SHOT_KILLS]; int kill_count = idle_children - pool_config->max_spare_children; int cycle_skip_count_before_scale_down; int cycle_skip_between_scale_down; int one_shot_kill_count; switch (pool_config->process_management_strategy) { case PM_STRATEGY_AGGRESSIVE: cycle_skip_count_before_scale_down = 25; /* roughly 50 seconds */ cycle_skip_between_scale_down = 2; one_shot_kill_count = MAX_ONE_SHOT_KILLS; break; case PM_STRATEGY_LAZY: cycle_skip_count_before_scale_down = 150; /* roughly 300 seconds */ cycle_skip_between_scale_down = 10; one_shot_kill_count = 3; break; case PM_STRATEGY_GENTLE: cycle_skip_count_before_scale_down = 60; /* roughly 120 seconds */ cycle_skip_between_scale_down = 5; one_shot_kill_count = 3; break; default: /* should never come here, but if we do use gentle counts*/ cycle_skip_count_before_scale_down = 60; /* roughly 120 seconds */ cycle_skip_between_scale_down = 5; one_shot_kill_count = 3; break; } /* Do not scale down too quickly */ if (++high_load_counter < cycle_skip_count_before_scale_down || high_load_counter % cycle_skip_between_scale_down) return; memset(kill_process_info_idxs, -1 ,sizeof(kill_process_info_idxs)); if (kill_count > one_shot_kill_count) kill_count = one_shot_kill_count; victim_count = select_victim_processes(kill_process_info_idxs, kill_count); for (ki = 0; ki < victim_count; ki++) { int index = kill_process_info_idxs[ki]; if (index >=0) { if (process_info[index].pid && process_info[index].status == WAIT_FOR_CONNECT) { ereport(DEBUG1, (errmsg("asking child process with pid:%d to kill itself to satisfy max_spare_children", process_info[index].pid), errdetail("child process has %d pooled connections",process_info[index].pooled_connections))); process_info[index].exit_if_idle = true; kill(process_info[index].pid, SIGUSR2); } } } } else { /* Reset the high load counter */ high_load_counter = 0; /*See if we need to spawn new children */ if (idle_children < pool_config->min_spare_children) { int i; int spawned = 0; int new_spawn_no = pool_config->min_spare_children - idle_children; /* Add 25% of max_spare_children */ new_spawn_no += pool_config->max_spare_children / 4; if (new_spawn_no + current_child_process_count > pool_config->num_init_children) { ereport(DEBUG5, (errmsg("we have hit the ceiling, spawning %d child(ren)", pool_config->num_init_children - current_child_process_count))); new_spawn_no = pool_config->num_init_children - current_child_process_count; } if (new_spawn_no <= 0) return; for (i = 0; i < pool_config->num_init_children; i++) { if (process_info[i].pid == 0) { process_info[i].start_time = time(NULL); process_info[i].client_connection_count = 0; process_info[i].status = WAIT_FOR_CONNECT; process_info[i].connected = 0; process_info[i].wait_for_connect = 0; process_info[i].pooled_connections = 0; process_info[i].need_to_restart = 0; process_info[i].exit_if_idle = false; process_info[i].pid = fork_a_child(fds, i); current_child_process_count++; if (++spawned >= new_spawn_no) break; } } } } } /* * Function selects the child processes that can be killed based. * selection criteria is to select the processes with minimum number of * pooled connections. * Returns the total number of identified process and fills the proc_info_arr * with the victim children process_info index */ static int select_victim_processes(int *process_info_idxs, int count) { int i, ki; bool found_enough = false; int selected_count = 0; if (count <= 0) return 0; for (i = 0; i < pool_config->num_init_children; i++) { /* Only the child process in waiting for connect can be terminated */ if (process_info[i].pid && process_info[i].status == WAIT_FOR_CONNECT) { if (selected_count < count) { process_info_idxs[selected_count++] = i; } else { found_enough = true; /* we don't bother selecting the child having least pooled connection with * aggressive strategy */ if (pool_config->process_management_strategy != PM_STRATEGY_AGGRESSIVE) { for (ki = 0; ki < count; ki++) { int old_index = process_info_idxs[ki]; if (old_index < 0 || process_info[old_index].pooled_connections > process_info[i].pooled_connections) { process_info_idxs[ki] = i; found_enough = false; break; } if (process_info[old_index].pooled_connections) found_enough = false; } } } } if (found_enough) break; } return selected_count; } pgpool-II-4.6.0/src/main/health_check.c0000664000175000017500000004132614760007565014544 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 #include #include #ifdef HAVE_CRYPT_H #include #endif #include "pool.h" #include "main/health_check.h" #include "main/pool_internal_comms.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "utils/pool_ip.h" #include "utils/ps_status.h" #include "utils/pool_stream.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "protocol/pool_pg_utils.h" #include "pool_config.h" #include "auth/md5.h" #include "auth/pool_hba.h" volatile POOL_HEALTH_CHECK_STATISTICS *health_check_stats; /* health check stats area in shared memory */ static POOL_CONNECTION_POOL_SLOT * slot; static volatile sig_atomic_t reload_config_request = 0; static volatile sig_atomic_t restart_request = 0; volatile POOL_HEALTH_CHECK_STATISTICS *stats; 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); static bool check_backend_down_request(int node, bool done_requests); #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]; static struct timeval start_time; static struct timeval end_time; long diff_t; POOL_HEALTH_CHECK_STATISTICS mystat; stats = &health_check_stats[*node_id]; /* Set application name */ set_application_name_with_suffix(PT_HEALTH_CHECK, *node_id); 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 per process context */ pool_init_process_context(); /* * Open pool_passwd. */ if (strcmp("", pool_config->pool_passwd)) { pool_reopen_passwd_file(); } 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; /* Initialize health check stats area */ stats->min_health_check_duration = INT_MAX; for (;;) { MemoryContextSwitchTo(HealthCheckMemoryContext); MemoryContextResetAndDeleteChildren(HealthCheckMemoryContext); /* * Since HealthCheckMemoryContext is used for "slot", we need to clear it * so that new slot is allocated later on. */ slot = NULL; bool skipped = false; CHECK_REQUEST; if (pool_config->health_check_params[*node_id].health_check_period <= 0) { stats->min_health_check_duration = 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); stats->total_count++; gettimeofday(&start_time, NULL); stats->last_health_check = time(NULL); result = establish_persistent_connection(*node_id); if (result && slot == NULL) { stats->last_failed_health_check = time(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; stats->fail_count++; 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) { stats->success_count++; stats->last_successful_health_check = time(NULL); /* The node has become reachable again. Reset * the quarantine state */ send_failback_request(*node_id, false, REQ_DETAIL_UPDATE | REQ_DETAIL_WATCHDOG); } else if (result && slot) { /* Health check succeeded */ stats->success_count++; stats->last_successful_health_check = time(NULL); } else if (!result) { /* Health check skipped */ stats->skip_count++; stats->last_skip_health_check = time(NULL); skipped = true; } /* Discard persistent connections */ discard_persistent_connection(*node_id); /* Update health check duration only if health check was not skipped since the duration could be very small (probably 0) if health check is skipped. */ if (!skipped) { gettimeofday(&end_time, NULL); if (end_time.tv_sec > start_time.tv_sec) diff_t = end_time.tv_usec - start_time.tv_usec + 1000000 * (end_time.tv_sec - start_time.tv_sec); else diff_t = end_time.tv_usec - start_time.tv_usec; diff_t /= 1000; stats->total_health_check_duration += diff_t; if (diff_t > stats->max_health_check_duration) stats->max_health_check_duration = diff_t; if (diff_t < stats->min_health_check_duration) stats->min_health_check_duration = diff_t; } memcpy(&mystat, (void *)stats, sizeof(mystat)); 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 comes 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_failback_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) { 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); retry_cnt = pool_config->health_check_params[node].health_check_max_retries; 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; } /* * If health check test is enabled, check if fake down request is * set. If set, discard_persistent_connection will set slot to * NULL. This simulates a connection failure. */ if (pool_config->health_check_test) { if (slot && check_backend_down_request(node, false) == true) { discard_persistent_connection(node); } } 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) { stats->retry_count++; 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); /* Check if we need to refresh max retry count */ if (retry_cnt != pool_config->health_check_params[node].health_check_max_retries) { int ret_cnt; retry_cnt++; ret_cnt = pool_config->health_check_params[node].health_check_max_retries - retry_cnt; if (ret_cnt > stats->max_retry_count) stats->max_retry_count = ret_cnt; } 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_failback_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; } /* * Returns the byte size of health check statistics area */ size_t health_check_stats_shared_memory_size(void) { size_t size; size = MAXALIGN(sizeof(POOL_HEALTH_CHECK_STATISTICS) * MAX_NUM_BACKENDS); elog(LOG, "health_check_stats_shared_memory_size: requested size: %lu", size); return size; } /* * Initialize health check statistics area */ void health_check_stats_init(POOL_HEALTH_CHECK_STATISTICS *addr) { int i; health_check_stats = addr; memset((void *) health_check_stats, 0, health_check_stats_shared_memory_size()); for (i = 0 ;i < MAX_NUM_BACKENDS; i++) { health_check_stats[i].min_health_check_duration = INT_MAX; } } /* * 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 repeating 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("%m"))); 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) - 1); 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 (writebuf) free(writebuf); if (!found) return false; return true; } pgpool-II-4.6.0/src/main/pool_internal_comms.c0000664000175000017500000003111014760007565016173 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. */ /* * pool_internal_comms consists of functions that can be called * from any pgpool-II process to instruct pgpool-II main process to * perform a particular function */ #include #include #include #include "utils/elog.h" #include "utils/pool_signal.h" #include "pool.h" #include "main/pool_internal_comms.h" #include "watchdog/wd_internal_commands.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "pool_config.h" /* * sends the signal to pgpool-II main process to terminate Pgpool-II * process. */ bool terminate_pgpool(char mode, bool error) { pid_t ppid = getppid(); int sig; if (mode == 's') { ereport(DEBUG1, (errmsg("processing shutdown request"), errdetail("sending SIGTERM to the parent process with PID:%d", ppid))); sig = SIGTERM; } else if (mode == 'f') { ereport(DEBUG1, (errmsg("processing shutdown request"), errdetail("sending SIGINT to the parent process with PID:%d", ppid))); sig = SIGINT; } else if (mode == 'i') { ereport(DEBUG1, (errmsg("processing shutdown request"), errdetail("sending SIGQUIT to the parent process with PID:%d", ppid))); sig = SIGQUIT; } else { ereport(error?ERROR:WARNING, (errmsg("error while processing shutdown request"), errdetail("invalid shutdown mode \"%c\"", mode))); return false; } pool_signal_parent(sig); return true; } /* * 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 returns false or throws an error as * soon as first non compliant 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_TRANSACTION; 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 leader 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_TRANSACTION; 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_TRANSACTION; 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; } /* * Request 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); } } 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); } } } bool close_idle_connections(void) { return register_node_operation_request(CLOSE_IDLE_REQUEST, NULL, 0, 0); } pgpool-II-4.6.0/src/main/pgpool_logger.c0000664000175000017500000010105514760007565014775 00000000000000/* -*-pgpool_logger-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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. */ /*------------------------------------------------------------------------- * * From: PostgreSQL * src/backend/postmaster/syslogger.c * Copyright (c) 2004-2020, PostgreSQL Global Development Group *------------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include #include #include #include "pool.h" #include "pool_config.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "parser/pg_list.h" #include "parser/stringinfo.h" #include "utils/ps_status.h" #include "utils/timestamp.h" #include "utils/pool_signal.h" #include "main/pgpool_logger.h" #define DEVNULL "/dev/null" typedef int64 pg_time_t; /* * We read() into a temp buffer twice as big as a chunk, so that any fragment * left after processing can be moved down to the front and we'll still have * room to read a full chunk. */ #define READ_BUF_SIZE (2 * PIPE_CHUNK_SIZE) /* Log rotation signal file path, relative to $PGDATA */ #define LOGROTATE_SIGNAL_FILE "logrotate" /* * GUC parameters. Logging_collector cannot be changed after postmaster * start, but the rest can change at SIGHUP. */ bool redirection_done = false; /* * Private state */ static pg_time_t next_rotation_time; static bool pipe_eof_seen = false; static bool rotation_disabled = false; static FILE *syslogFile = NULL; static FILE *csvlogFile = NULL; static pg_time_t first_syslogger_file_time = 0; static char *last_file_name = NULL; static char *last_csv_file_name = NULL; /* * Buffers for saving partial messages from different backends. * * Keep NBUFFER_LISTS lists of these, with the entry for a given source pid * being in the list numbered (pid % NBUFFER_LISTS), so as to cut down on * the number of entries we have to examine for any one incoming message. * There must never be more than one entry for the same source pid. * * An inactive buffer is not removed from its list, just held for re-use. * An inactive buffer has pid == 0 and undefined contents of data. */ typedef struct { int32 pid; /* PID of source process */ StringInfoData data; /* accumulated data, as a StringInfo */ } save_buffer; #define NBUFFER_LISTS 256 static List *buffer_lists[NBUFFER_LISTS]; int syslogPipe[2] = {-1, -1}; /* * Flags set by interrupt handlers for later service in the main loop. */ static volatile sig_atomic_t got_SIGHUP = false; static volatile sig_atomic_t rotation_requested = false; static void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn(); static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static FILE *logfile_open(const char *filename, const char *mode, bool allow_errors); static void logfile_rotate(bool time_based_rotation, int size_rotation_for); static char *logfile_getname(pg_time_t timestamp, const char *suffix); static void set_next_rotation_time(void); static void sigHupHandler(int sig); static void sigUsr1Handler(int sig); /* * Main entry point for syslogger process * argc/argv parameters are valid only in EXEC_BACKEND case. */ static void SysLoggerMain(int argc, char *argv[]) { char logbuffer[READ_BUF_SIZE]; int bytes_in_logbuffer = 0; char *currentLogDir; char *currentLogFilename; int currentLogRotationAge; pg_time_t now; now = time(NULL); init_ps_display("", "", "", ""); set_ps_display("PgpoolLogger", false); /* * If we restarted, our stderr is already redirected into our own input * pipe. This is of course pretty useless, not to mention that it * interferes with detecting pipe EOF. Point stderr to /dev/null. This * assumes that all interesting messages generated in the syslogger will * come through elog.c and will be sent to write_syslogger_file. */ if (redirection_done) { int fd = open(DEVNULL, O_WRONLY, 0); /* * The closes might look redundant, but they are not: we want to be * darn sure the pipe gets closed even if the open failed. We can * survive running with stderr pointing nowhere, but we can't afford * to have extra pipe input descriptors hanging around. * * As we're just trying to reset these to go to DEVNULL, there's not * much point in checking for failure from the close/dup2 calls here, * if they fail then presumably the file descriptors are closed and * any writes will go into the bitbucket anyway. */ close(fileno(stdout)); close(fileno(stderr)); if (fd != -1) { (void) dup2(fd, fileno(stdout)); (void) dup2(fd, fileno(stderr)); close(fd); } } /* * Also close our copy of the write end of the pipe. This is needed to * ensure we can detect pipe EOF correctly. (But note that in the restart * case, the postmaster already did this.) */ if (syslogPipe[1] >= 0) close(syslogPipe[1]); syslogPipe[1] = -1; /* * Properly accept or ignore signals the postmaster might send us * * Note: we ignore all termination signals, and instead exit only when all * upstream processes are gone, to ensure we don't miss any dying gasps of * broken backends... */ pool_signal(SIGHUP, sigHupHandler); pool_signal(SIGINT, SIG_IGN); pool_signal(SIGTERM, SIG_IGN); pool_signal(SIGQUIT, SIG_IGN); pool_signal(SIGALRM, SIG_IGN); pool_signal(SIGPIPE, SIG_IGN); pool_signal(SIGUSR1, sigUsr1Handler); /* request log rotation */ pool_signal(SIGUSR2, SIG_IGN); /* * Reset some signals that are accepted by postmaster but not here */ pool_signal(SIGCHLD, SIG_DFL); POOL_SETMASK(&UnBlockSig); /* * Remember active logfiles' name(s). We recompute 'em from the reference * time because passing down just the pg_time_t is a lot cheaper than * passing a whole file path in the EXEC_BACKEND case. */ last_file_name = logfile_getname(first_syslogger_file_time, NULL); if (csvlogFile != NULL) last_csv_file_name = logfile_getname(first_syslogger_file_time, ".csv"); /* remember active logfile parameters */ currentLogDir = pstrdup(pool_config->log_directory); currentLogFilename = pstrdup(pool_config->log_filename); currentLogRotationAge = pool_config->log_rotation_age; /* set next planned rotation time */ set_next_rotation_time(); /* * Set up a reusable WaitEventSet object we'll use to wait for our latch, * and (except on Windows) our socket. * * Unlike all other postmaster child processes, we'll ignore postmaster * death because we want to collect final log output from all backends and * then exit last. We'll do that by running until we see EOF on the * syslog pipe, which implies that all other backends have exited * (including the postmaster). */ /* main worker loop */ for (;;) { bool time_based_rotation = false; int size_rotation_for = 0; struct timeval timeout; fd_set rfds; int rc; /* * Process any requests or signals received recently. */ if (got_SIGHUP) { got_SIGHUP = false; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); MemoryContextSwitchTo(oldContext); /* * Check if the log directory or filename pattern changed in * pgpool.conf. If so, force rotation to make sure we're * writing the logfiles in the right place. */ if (strcmp(pool_config->log_directory, currentLogDir) != 0) { pfree(currentLogDir); currentLogDir = pstrdup(pool_config->log_directory); rotation_requested = true; /* * Also, create new directory if not present; ignore errors */ if (mkdir(pool_config->log_directory, S_IREAD | S_IWRITE | S_IEXEC) == -1) { ereport(LOG, (errmsg("pgpool logger, failed to create directory:\"%s\". error:\"%m\"", pool_config->log_directory))); } } if (strcmp(pool_config->log_filename, currentLogFilename) != 0) { pfree(currentLogFilename); currentLogFilename = pstrdup(pool_config->log_filename); rotation_requested = true; } /* * Force a rotation if CSVLOG output was just turned on or off and * we need to open or close csvlogFile accordingly. */ if (((pool_config->log_destination & LOG_DESTINATION_CSVLOG) != 0) != (csvlogFile != NULL)) rotation_requested = true; /* * If rotation time parameter changed, reset next rotation time, * but don't immediately force a rotation. */ if (currentLogRotationAge != pool_config->log_rotation_age) { currentLogRotationAge = pool_config->log_rotation_age; set_next_rotation_time(); } /* * If we had a rotation-disabling failure, re-enable rotation * attempts after SIGHUP, and force one immediately. */ if (rotation_disabled) { rotation_disabled = false; rotation_requested = true; } } if (pool_config->log_rotation_age > 0 && !rotation_disabled) { /* Do a logfile rotation if it's time */ now = (pg_time_t) time(NULL); if (now >= next_rotation_time) rotation_requested = time_based_rotation = true; } if (!rotation_requested && pool_config->log_rotation_size > 0 && !rotation_disabled) { /* Do a rotation if file is too big */ if (ftell(syslogFile) >= pool_config->log_rotation_size * 1024L) { rotation_requested = true; size_rotation_for |= LOG_DESTINATION_STDERR; } if (csvlogFile != NULL && ftell(csvlogFile) >= pool_config->log_rotation_size * 1024L) { rotation_requested = true; size_rotation_for |= LOG_DESTINATION_CSVLOG; } } if (rotation_requested) { /* * Force rotation when both values are zero. It means the request * was sent by pcp_log_rotate. */ if (!time_based_rotation && size_rotation_for == 0) size_rotation_for = LOG_DESTINATION_STDERR | LOG_DESTINATION_CSVLOG; logfile_rotate(time_based_rotation, size_rotation_for); } /* * Calculate time till next time-based rotation, so that we don't * sleep longer than that. We assume the value of "now" obtained * above is still close enough. Note we can't make this calculation * until after calling logfile_rotate(), since it will advance * next_rotation_time. * * Also note that we need to beware of overflow in calculation of the * timeout: with large settings of pool_config->log_rotation_age, next_rotation_time * could be more than INT_MAX msec in the future. In that case we'll * wait no more than INT_MAX msec, and try again. */ timeout.tv_sec = 0; /* Reset usec everytime before calling sellect */ timeout.tv_usec = 0; if (pool_config->log_rotation_age > 0 && !rotation_disabled) { pg_time_t delay; delay = next_rotation_time - now; if (delay > 0) { if (delay > INT_MAX / 1000) delay = INT_MAX / 1000; timeout.tv_sec = delay; } } /* * Sleep until there's something to do */ FD_ZERO(&rfds); FD_SET(syslogPipe[0], &rfds); rc = select(syslogPipe[0] + 1, &rfds, NULL, NULL, timeout.tv_sec?&timeout:NULL); if (rc == 1) { int bytesRead; bytesRead = read(syslogPipe[0], logbuffer + bytes_in_logbuffer, sizeof(logbuffer) - bytes_in_logbuffer); if (bytesRead < 0) { if (errno != EINTR) ereport(LOG, (errmsg("could not read from logger pipe: %m"))); } else if (bytesRead > 0) { bytes_in_logbuffer += bytesRead; process_pipe_input(logbuffer, &bytes_in_logbuffer); continue; } else { /* * Zero bytes read when select() is saying read-ready means * EOF on the pipe: that is, there are no longer any processes * with the pipe write end open. Therefore, the postmaster * and all backends are shut down, and we are done. */ pipe_eof_seen = true; /* if there's any data left then force it out now */ flush_pipe_input(logbuffer, &bytes_in_logbuffer); } } if (pipe_eof_seen) { /* * seeing this message on the real stderr is annoying - so we make * it DEBUG1 to suppress in normal use. */ ereport(DEBUG1, (errmsg("logger shutting down"))); /* * Normal exit from the syslogger is here. Note that we * deliberately do not close syslogFile before exiting; this is to * allow for the possibility of elog messages being generated * inside proc_exit. Regular exit() will take care of flushing * and closing stdio channels. */ proc_exit(0); } } } /* * Postmaster subroutine to start a syslogger subprocess. */ int SysLogger_Start(void) { pid_t sysloggerPid; char *filename; if (!pool_config->logging_collector) return 0; /* * If first time through, create the pipe which will receive stderr * output. * * If the syslogger crashes and needs to be restarted, we continue to use * the same pipe (indeed must do so, since extant backends will be writing * into that pipe). * * This means the postmaster must continue to hold the read end of the * pipe open, so we can pass it down to the reincarnated syslogger. This * is a bit klugy but we have little choice. * * Also note that we don't bother counting the pipe FDs by calling * Reserve/ReleaseExternalFD. There's no real need to account for them * accurately in the postmaster or syslogger process, and both ends of the * pipe will wind up closed in all other postmaster children. */ if (syslogPipe[0] < 0) { if (pipe(syslogPipe) < 0) ereport(FATAL, (errmsg("could not create pipe for syslog: %m"))); } /* * Create log directory if not present; ignore errors */ mkdir(pool_config->log_directory, S_IREAD | S_IWRITE | S_IEXEC); /* * The initial logfile is created right in the postmaster, to verify that * the pool_config->log_directory is writable. We save the reference time so that the * syslogger child process can recompute this file name. * * It might look a bit strange to re-do this during a syslogger restart, * but we must do so since the postmaster closed syslogFile after the * previous fork (and remembering that old file wouldn't be right anyway). * Note we always append here, we won't overwrite any existing file. This * is consistent with the normal rules, because by definition this is not * a time-based rotation. */ first_syslogger_file_time = time(NULL); filename = logfile_getname(first_syslogger_file_time, NULL); syslogFile = logfile_open(filename, "a", false); pfree(filename); /* * Likewise for the initial CSV log file, if that's enabled. (Note that * we open syslogFile even when only CSV output is nominally enabled, * since some code paths will write to syslogFile anyway.) */ if (pool_config->log_destination & LOG_DESTINATION_CSVLOG) { filename = logfile_getname(first_syslogger_file_time, ".csv"); csvlogFile = logfile_open(filename, "a", false); pfree(filename); } switch ((sysloggerPid = fork())) { case -1: ereport(LOG, (errmsg("could not fork system logger: %m"))); return 0; case 0: on_exit_reset(); SetProcessGlobalVariables(PT_LOGGER); /* do the work */ SysLoggerMain(0, NULL); break; default: /* success, in postmaster */ /* now we redirect stderr, if not done already */ if (!redirection_done) { /* * Leave a breadcrumb trail when redirecting, in case the user * forgets that redirection is active and looks only at the * original stderr target file. */ ereport(LOG, (errmsg("redirecting log output to logging collector process"), errhint("Future log output will appear in directory \"%s\".", pool_config->log_directory))); #ifndef WIN32 fflush(stdout); if (dup2(syslogPipe[1], fileno(stdout)) < 0) ereport(FATAL, (errmsg("could not redirect stdout: %m"))); fflush(stderr); if (dup2(syslogPipe[1], fileno(stderr)) < 0) ereport(FATAL, (errmsg("could not redirect stderr: %m"))); /* Now we are done with the write end of the pipe. */ close(syslogPipe[1]); syslogPipe[1] = -1; #else /* * open the pipe in binary mode and make sure stderr is binary * after it's been dup'ed into, to avoid disturbing the pipe * chunking protocol. */ fflush(stderr); fd = _open_osfhandle((intptr_t) syslogPipe[1], _O_APPEND | _O_BINARY); if (dup2(fd, _fileno(stderr)) < 0) ereport(FATAL, (errmsg("could not redirect stderr: %m"))); close(fd); _setmode(_fileno(stderr), _O_BINARY); /* * Now we are done with the write end of the pipe. * CloseHandle() must not be called because the preceding * close() closes the underlying handle. */ syslogPipe[1] = 0; #endif redirection_done = true; } /* postmaster will never write the file(s); close 'em */ fclose(syslogFile); syslogFile = NULL; if (csvlogFile != NULL) { fclose(csvlogFile); csvlogFile = NULL; } return (int) sysloggerPid; } /* we should never reach here */ return 0; } /* -------------------------------- * pipe protocol handling * -------------------------------- */ /* * Process data received through the syslogger pipe. * * This routine interprets the log pipe protocol which sends log messages as * (hopefully atomic) chunks - such chunks are detected and reassembled here. * * The protocol has a header that starts with two nul bytes, then has a 16 bit * length, the pid of the sending process, and a flag to indicate if it is * the last chunk in a message. Incomplete chunks are saved until we read some * more, and non-final chunks are accumulated until we get the final chunk. * * All of this is to avoid 2 problems: * . partial messages being written to logfiles (messes rotation), and * . messages from different backends being interleaved (messages garbled). * * Any non-protocol messages are written out directly. These should only come * from non-Pgpool sources, however (e.g. third party libraries writing to * stderr). * * logbuffer is the data input buffer, and *bytes_in_logbuffer is the number * of bytes present. On exit, any not-yet-eaten data is left-justified in * logbuffer, and *bytes_in_logbuffer is updated. */ static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer) { char *cursor = logbuffer; int count = *bytes_in_logbuffer; int dest = LOG_DESTINATION_STDERR; /* While we have enough for a header, process data... */ while (count >= (int) (offsetof(PipeProtoHeader, data) + 1)) { PipeProtoHeader p; int chunklen; /* Do we have a valid header? */ memcpy(&p, cursor, offsetof(PipeProtoHeader, data)); if (p.nuls[0] == '\0' && p.nuls[1] == '\0' && p.len > 0 && p.len <= PIPE_MAX_PAYLOAD && p.pid != 0 && (p.is_last == 't' || p.is_last == 'f' || p.is_last == 'T' || p.is_last == 'F')) { List *buffer_list; ListCell *cell; save_buffer *existing_slot = NULL, *free_slot = NULL; StringInfo str; chunklen = PIPE_HEADER_SIZE + p.len; /* Fall out of loop if we don't have the whole chunk yet */ if (count < chunklen) break; dest = (p.is_last == 'T' || p.is_last == 'F') ? LOG_DESTINATION_CSVLOG : LOG_DESTINATION_STDERR; /* Locate any existing buffer for this source pid */ buffer_list = buffer_lists[p.pid % NBUFFER_LISTS]; foreach(cell, buffer_list) { save_buffer *buf = (save_buffer *) lfirst(cell); if (buf->pid == p.pid) { existing_slot = buf; break; } if (buf->pid == 0 && free_slot == NULL) free_slot = buf; } if (p.is_last == 'f' || p.is_last == 'F') { /* * Save a complete non-final chunk in a per-pid buffer */ if (existing_slot != NULL) { /* Add chunk to data from preceding chunks */ str = &(existing_slot->data); appendBinaryStringInfo(str, cursor + PIPE_HEADER_SIZE, p.len); } else { /* First chunk of message, save in a new buffer */ if (free_slot == NULL) { /* * Need a free slot, but there isn't one in the list, * so create a new one and extend the list with it. */ free_slot = palloc(sizeof(save_buffer)); buffer_list = lappend(buffer_list, free_slot); buffer_lists[p.pid % NBUFFER_LISTS] = buffer_list; } free_slot->pid = p.pid; str = &(free_slot->data); initStringInfo(str); appendBinaryStringInfo(str, cursor + PIPE_HEADER_SIZE, p.len); } } else { /* * Final chunk --- add it to anything saved for that pid, and * either way write the whole thing out. */ if (existing_slot != NULL) { str = &(existing_slot->data); appendBinaryStringInfo(str, cursor + PIPE_HEADER_SIZE, p.len); write_syslogger_file(str->data, str->len, dest); /* Mark the buffer unused, and reclaim string storage */ existing_slot->pid = 0; pfree(str->data); } else { /* The whole message was one chunk, evidently. */ write_syslogger_file(cursor + PIPE_HEADER_SIZE, p.len, dest); } } /* Finished processing this chunk */ cursor += chunklen; count -= chunklen; } else { /* Process non-protocol data */ /* * Look for the start of a protocol header. If found, dump data * up to there and repeat the loop. Otherwise, dump it all and * fall out of the loop. (Note: we want to dump it all if at all * possible, so as to avoid dividing non-protocol messages across * logfiles. We expect that in many scenarios, a non-protocol * message will arrive all in one read(), and we want to respect * the read() boundary if possible.) */ for (chunklen = 1; chunklen < count; chunklen++) { if (cursor[chunklen] == '\0') break; } /* fall back on the stderr log as the destination */ write_syslogger_file(cursor, chunklen, LOG_DESTINATION_STDERR); cursor += chunklen; count -= chunklen; } } /* We don't have a full chunk, so left-align what remains in the buffer */ if (count > 0 && cursor != logbuffer) memmove(logbuffer, cursor, count); *bytes_in_logbuffer = count; } /* * Force out any buffered data * * This is currently used only at syslogger shutdown, but could perhaps be * useful at other times, so it is careful to leave things in a clean state. */ static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer) { int i; /* Dump any incomplete protocol messages */ for (i = 0; i < NBUFFER_LISTS; i++) { List *list = buffer_lists[i]; ListCell *cell; foreach(cell, list) { save_buffer *buf = (save_buffer *) lfirst(cell); if (buf->pid != 0) { StringInfo str = &(buf->data); write_syslogger_file(str->data, str->len, LOG_DESTINATION_STDERR); /* Mark the buffer unused, and reclaim string storage */ buf->pid = 0; pfree(str->data); } } } /* * Force out any remaining pipe data as-is; we don't bother trying to * remove any protocol headers that may exist in it. */ if (*bytes_in_logbuffer > 0) write_syslogger_file(logbuffer, *bytes_in_logbuffer, LOG_DESTINATION_STDERR); *bytes_in_logbuffer = 0; } /* -------------------------------- * logfile routines * -------------------------------- */ /* * Write text to the currently open logfile * * This is exported so that elog.c can call it when processType is PT_LOGGER; . * This allows the syslogger process to record elog messages of its own, * even though its stderr does not point at the syslog pipe. */ void write_syslogger_file(const char *buffer, int count, int destination) { int rc; FILE *logfile; /* * If we're told to write to csvlogFile, but it's not open, dump the data * to syslogFile (which is always open) instead. This can happen if CSV * output is enabled after postmaster start and we've been unable to open * csvlogFile. There are also race conditions during a parameter change * whereby backends might send us CSV output before we open csvlogFile or * after we close it. Writing CSV-formatted output to the regular log * file isn't great, but it beats dropping log output on the floor. * * Think not to improve this by trying to open csvlogFile on-the-fly. Any * failure in that would lead to recursion. */ logfile = (destination == LOG_DESTINATION_CSVLOG && csvlogFile != NULL) ? csvlogFile : syslogFile; rc = fwrite(buffer, 1, count, logfile); /* * Try to report any failure. We mustn't use ereport because it would * just recurse right back here, but write_stderr is OK: it will write * either to the postmaster's original stderr, or to /dev/null, but never * to our input pipe which would result in a different sort of looping. */ if (rc != count) write_stderr("could not write to log file: %s\n", strerror(errno)); } /* * Open a new logfile with proper permissions and buffering options. * * If allow_errors is true, we just log any open failure and return NULL * (with errno still correct for the fopen failure). * Otherwise, errors are treated as fatal. */ static FILE * logfile_open(const char *filename, const char *mode, bool allow_errors) { FILE *fh; mode_t oumask; /* * Note we do not let pool_config->log_file_mode disable IWUSR, since we certainly want * to be able to write the files ourselves. */ oumask = umask((mode_t) ((~(pool_config->log_file_mode | S_IWUSR)) & (S_IRWXU | S_IRWXG | S_IRWXO))); fh = fopen(filename, mode); umask(oumask); if (fh) { setvbuf(fh, NULL, _IOLBF, 0); #ifdef WIN32 /* use CRLF line endings on Windows */ _setmode(_fileno(fh), _O_TEXT); #endif } else { int save_errno = errno; ereport(allow_errors ? LOG : FATAL, (errmsg("could not open log file \"%s\": %m", filename))); errno = save_errno; } return fh; } /* * perform logfile rotation */ static void logfile_rotate(bool time_based_rotation, int size_rotation_for) { char *filename; char *csvfilename = NULL; pg_time_t fntime; FILE *fh; rotation_requested = false; /* * When doing a time-based rotation, invent the new logfile name based on * the planned rotation time, not current time, to avoid "slippage" in the * file name when we don't do the rotation immediately. */ if (time_based_rotation) fntime = next_rotation_time; else fntime = time(NULL); filename = logfile_getname(fntime, NULL); if (pool_config->log_destination & LOG_DESTINATION_CSVLOG) csvfilename = logfile_getname(fntime, ".csv"); /* * Decide whether to overwrite or append. We can overwrite if (a) * pool_config->log_truncate_on_rotation is set, (b) the rotation was triggered by * elapsed time and not something else, and (c) the computed file name is * different from what we were previously logging into. * * Note: last_file_name should never be NULL here, but if it is, append. */ if (time_based_rotation || (size_rotation_for & LOG_DESTINATION_STDERR)) { if (pool_config->log_truncate_on_rotation && time_based_rotation && last_file_name != NULL && strcmp(filename, last_file_name) != 0) fh = logfile_open(filename, "w", true); else fh = logfile_open(filename, "a", true); if (!fh) { /* * ENFILE/EMFILE are not too surprising on a busy system; just * keep using the old file till we manage to get a new one. * Otherwise, assume something's wrong with pool_config->log_directory and stop * trying to create files. */ if (errno != ENFILE && errno != EMFILE) { ereport(LOG, (errmsg("disabling automatic rotation (use SIGHUP to re-enable)"))); rotation_disabled = true; } if (filename) pfree(filename); if (csvfilename) pfree(csvfilename); return; } fclose(syslogFile); syslogFile = fh; /* instead of pfree'ing filename, remember it for next time */ if (last_file_name != NULL) pfree(last_file_name); last_file_name = filename; filename = NULL; } /* * Same as above, but for csv file. Note that if LOG_DESTINATION_CSVLOG * was just turned on, we might have to open csvlogFile here though it was * not open before. In such a case we'll append not overwrite (since * last_csv_file_name will be NULL); that is consistent with the normal * rules since it's not a time-based rotation. */ if ((pool_config->log_destination & LOG_DESTINATION_CSVLOG) && (csvlogFile == NULL || time_based_rotation || (size_rotation_for & LOG_DESTINATION_CSVLOG))) { if (pool_config->log_truncate_on_rotation && time_based_rotation && last_csv_file_name != NULL && strcmp(csvfilename, last_csv_file_name) != 0) fh = logfile_open(csvfilename, "w", true); else fh = logfile_open(csvfilename, "a", true); if (!fh) { /* * ENFILE/EMFILE are not too surprising on a busy system; just * keep using the old file till we manage to get a new one. * Otherwise, assume something's wrong with pool_config->log_directory and stop * trying to create files. */ if (errno != ENFILE && errno != EMFILE) { ereport(LOG, (errmsg("disabling automatic rotation (use SIGHUP to re-enable)"))); rotation_disabled = true; } if (filename) pfree(filename); if (csvfilename) pfree(csvfilename); return; } if (csvlogFile != NULL) fclose(csvlogFile); csvlogFile = fh; /* instead of pfree'ing filename, remember it for next time */ if (last_csv_file_name != NULL) pfree(last_csv_file_name); last_csv_file_name = csvfilename; csvfilename = NULL; } else if (!(pool_config->log_destination & LOG_DESTINATION_CSVLOG) && csvlogFile != NULL) { /* CSVLOG was just turned off, so close the old file */ fclose(csvlogFile); csvlogFile = NULL; if (last_csv_file_name != NULL) pfree(last_csv_file_name); last_csv_file_name = NULL; } if (filename) pfree(filename); if (csvfilename) pfree(csvfilename); set_next_rotation_time(); } /* * construct logfile name using timestamp information * * If suffix isn't NULL, append it to the name, replacing any ".log" * that may be in the pattern. * * Result is palloc'd. */ static char * logfile_getname(pg_time_t timestamp, const char *suffix) { char *filename; int len; filename = palloc(MAXPGPATH); snprintf(filename, MAXPGPATH, "%s/", pool_config->log_directory); len = strlen(filename); /* treat pool_config->log_filename as a strftime pattern */ strftime(filename + len, MAXPGPATH - len, pool_config->log_filename, localtime(×tamp)); if (suffix != NULL) { len = strlen(filename); if (len > 4 && (strcmp(filename + (len - 4), ".log") == 0)) len -= 4; strlcpy(filename + len, suffix, MAXPGPATH - len); } return filename; } /* * Determine the next planned rotation time, and store in next_rotation_time. */ static void set_next_rotation_time(void) { pg_time_t now; struct tm *tm; int rotinterval; /* nothing to do if time-based rotation is disabled */ if (pool_config->log_rotation_age <= 0) return; /* * The requirements here are to choose the next time > now that is a * "multiple" of the log rotation interval. "Multiple" can be interpreted * fairly loosely. In this version we align to log_timezone rather than * GMT. */ rotinterval = pool_config->log_rotation_age * SECS_PER_MINUTE; /* convert to seconds */ now = (pg_time_t) time(NULL); tm = localtime(&now); now += tm->tm_gmtoff; now -= now % rotinterval; now += rotinterval; now -= tm->tm_gmtoff; next_rotation_time = now; } /* -------------------------------- * signal handler routines * -------------------------------- */ /* * Check to see if a log rotation request has arrived. Should be * called by postmaster after receiving SIGUSR1. */ bool CheckLogrotateSignal(void) { struct stat stat_buf; if (stat(LOGROTATE_SIGNAL_FILE, &stat_buf) == 0) return true; return false; } /* * Remove the file signaling a log rotation request. */ void RemoveLogrotateSignalFiles(void) { unlink(LOGROTATE_SIGNAL_FILE); } /* SIGHUP: set flag to reload config file */ static void sigHupHandler(int sig) { int save_errno = errno; got_SIGHUP = true; errno = save_errno; } /* SIGUSR1: set flag to rotate logfile */ static void sigUsr1Handler(int sig) { int save_errno = errno; rotation_requested = true; errno = save_errno; } pgpool-II-4.6.0/src/pcp_con/0000775000175000017500000000000014760010070012526 500000000000000pgpool-II-4.6.0/src/pcp_con/pcp_child.c0000664000175000017500000002766314760007565014574 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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 "utils/pool_signal.h" #include "utils/pool_ipc.h" #include "utils/ps_status.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "pcp/pcp_worker.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 *fds); static void start_pcp_command_processor_process(int port, int *fds); static void pcp_child_will_die(int code, Datum arg); static void pcp_kill_all_children(int sig); static void reaper(void); static bool pcp_unix_fds_not_isset(int *fds, int num_pcp_fds, fd_set* opt); #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 *fds) { sigjmp_buf local_sigjmp_buf; struct timeval uptime; /* Identify myself via ps */ init_ps_display("", "", "", ""); gettimeofday(&uptime, NULL); 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); /* Initialize per process context */ pool_init_process_context(); 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; /* * Unblock signals */ POOL_SETMASK(&UnBlockSig); 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(fds); if (port > 0) { start_pcp_command_processor_process(port, fds); } } } /* * Accept connection to pcp port */ static int pcp_do_accept(int *fds) { fd_set readmask; fd_set rmask; int rfds; int fd = 0; int afd; int *walk; int nsocks = 0; SockAddr saddr; set_ps_display("PCP: wait for connection request", false); 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); memcpy((char *) &rmask, (char *) &readmask, sizeof(fd_set)); rfds = select(nsocks, &rmask, NULL, NULL, NULL); if (rfds == -1) { if (errno == EAGAIN || errno == EINTR) return -1; ereport(ERROR, (errmsg("unable to accept new pcp connection"), errdetail("select system call failed with error : \"%m\""))); } for (walk = fds; *walk != -1; walk++) { if (FD_ISSET(*walk, &rmask)) { fd = *walk; break; } } memset(&saddr, 0, sizeof(saddr)); saddr.salen = sizeof(saddr.addr); afd = accept(fd, (struct sockaddr *) &saddr.addr, &saddr.salen); 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 : \"%m\""))); } 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))); /* * Set no delay if AF_INET socket. Not sure if this is really necessary * but PostgreSQL does this. */ if (pcp_unix_fds_not_isset(fds, pool_config->num_pcp_socket_directories, &rmask)) /* fds are UNIX domain socket for pcp process */ { int on; 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 \"%m\""))); close(afd); return -1; } } return afd; } static bool pcp_unix_fds_not_isset(int* fds, int num_pcp_fds, fd_set* opt) { int i; for (i = 0; i < num_pcp_fds; i++) { if (!FD_ISSET(fds[i], opt)) continue; return false; } return true; } /* * forks a new pcp worker child */ static void start_pcp_command_processor_process(int port, int *fds) { pid_t pid = fork(); int *walk; if (pid == 0) /* child */ { SetProcessGlobalVariables(PT_PCP_WORKER); on_exit_reset(); /* Close the listen sockets sockets */ for (walk = fds; *walk != -1; walk++) close(*walk); /* 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"), errdetail("%m"))); } else /* parent */ { if (pool_config->log_pcp_processes) 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 if (pool_config->log_pcp_processes) 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 if (pool_config->log_pcp_processes) ereport(LOG, (errmsg("PCP process with pid: %d exits with status %d by signal %d", pid, status, WTERMSIG(status)))); } else if (pool_config->log_pcp_processes || status != 0) 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; ListCell *lc; 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); foreach(lc, pcp_worker_children) { int pid; do { wpid = (pid_t) lfirst_int(lc); pid = waitpid(wpid, NULL, WNOHANG); } while (pid == -1 && errno == EINTR); } 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"), errdetail("%m"))); 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 allowed 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 finished. */ void pcp_mark_recovery_finished(void) { pool_sigset_t oldmask; /* * only pcp worker is allowed 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.6.0/src/pcp_con/pcp_worker.c0000664000175000017500000012514014760007565015007 00000000000000/* -*-pcp_worker.c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include "pool.h" #include "pool_config.h" #include "pcp/pcp_stream.h" #include "pcp/pcp.h" #include "pcp/pcp_worker.h" #include "pcp/recovery.h" #include "auth/md5.h" #include "auth/pool_auth.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "utils/pool_process_reporting.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/ps_status.h" #include "utils/elog.h" #include "watchdog/wd_json_data.h" #include "watchdog/wd_internal_commands.h" #include "main/pool_internal_comms.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, bool switchover); 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_reload_config(PCP_CONNECTION * frontend,char scope); static void process_log_rotate(PCP_CONNECTION * frontend,char scope); static void inform_health_check_stats(PCP_CONNECTION *frontend, char *buf); 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_shutdown_request(PCP_CONNECTION * frontend, char mode, char tos); static void process_set_configuration_parameter(PCP_CONNECTION * frontend, char *buf, int len); static void process_invalidate_query_cache(PCP_CONNECTION * frontend); 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) { /* The request is recovery or pcp shutdown request? */ if (tos == 'O' || tos == 'T') { /* Prevent those pcp requests while processing failover/failback request */ 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 configuration parameter request", false); process_set_configuration_parameter(pcp_frontend, buf, buf_len); break; case 'B': /* status request */ set_ps_display("PCP: processing status request request", false); process_status_request(pcp_frontend); break; case 'C': /* attach node */ set_ps_display("PCP: processing attach node request", false); process_attach_node(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 'F': ereport(DEBUG1, (errmsg("PCP processing request, stop online recovery"))); break; case 'G': /* invalidate query cache */ set_ps_display("PCP: processing invalidate query cache request", false); process_invalidate_query_cache(pcp_frontend); break; case 'H': /* health check stats */ set_ps_display("PCP: processing health check stats request", false); inform_health_check_stats(pcp_frontend, buf); break; case 'I': /* node info */ set_ps_display("PCP: processing node info request", false); inform_node_info(pcp_frontend, buf); 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 'L': /* node count */ set_ps_display("PCP: processing node count request", false); inform_node_count(pcp_frontend); break; case 'N': /* process count */ set_ps_display("PCP: processing process count request", false); inform_process_count(pcp_frontend); break; case 'O': /* recovery request */ set_ps_display("PCP: processing recovery request", false); process_recovery_request(pcp_frontend, buf); break; case 'P': /* process info */ set_ps_display("PCP: processing process info request", false); inform_process_info(pcp_frontend, buf); break; case 'T': case 't': set_ps_display("PCP: processing shutdown request", false); process_shutdown_request(pcp_frontend, buf[0], tos); break; case 'V': /* log rotate */ set_ps_display("PCP: processing log rotation request", false); process_log_rotate(pcp_frontend, buf[0]); break; case 'W': /* watchdog info */ set_ps_display("PCP: processing watchdog info request", false); inform_watchdog_info(pcp_frontend, buf); break; case 'Z': /*reload config file */ set_ps_display("PCP: processing reload config request", false); process_reload_config(pcp_frontend, buf[0]); 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 : \"%m\""))); } if (fcntl(fd, F_SETFL, var & ~O_NONBLOCK) == -1) { ereport(FATAL, (errmsg("unable to connect"), errdetail("fcntl system call failed with error : \"%m\""))); } } /* * 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: %m", passwd_file))); 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, bool switchover) { int flag = 0; if (switchover) flag = REQ_DETAIL_PROMOTE; if (!gracefully) { degenerate_backend_set_ex(&node_id, 1, flag | 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 will 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, flag | 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 will 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(8 * process_count); /* PID is at most 7 characters long */ snprintf(process_count_str, sizeof(process_count_str), "%d", process_count); for (i = 0; i < process_count; i++) { char process_id[8]; 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))); } /* * pcp_process_info */ 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; int *offsets; int n; POOL_REPORT_POOLS *pools; 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"; 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); offsets = pool_report_pools_offsets(&n); /* Second, send process information for all connection_info */ for (i = 0; i < num_proc; i++) { int j; char code[] = "ProcessInfo"; int pool_pid; pool_pid = atoi(pools[i].pool_pid); if (proc_id != 0 && pool_pid != proc_id) continue; pcp_write(frontend, "p", 1); wsize = 0; for (j = 0; j < n; j++) { wsize += strlen((char *)&pools[i] + offsets[j]) + 1; } wsize += sizeof(code) + sizeof(int); wsize = htonl(wsize); /* send packet length to frontend */ pcp_write(frontend, &wsize, sizeof(int)); /* send "this is a record" to frontend */ pcp_write(frontend, code, sizeof(code)); /* send each process info data to frontend */ for (j = 0; j < n; j++) { pcp_write(frontend, (char *)&pools[i] + offsets[j], strlen((char *)&pools[i] + offsets[j]) + 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("watchdog is not enabled"))); wd_index = atoi(buf); json_data = wd_internal_get_watchdog_nodes_json(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 violation of PCP protocol but I think in future we should * shift to more adaptable protocol for data transmission. */ 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) { POOL_REPORT_NODES *nodes; int nrows; int node_id; int wsize; int i; node_id = atoi(buf); if ((node_id != -1) && (pool_get_node_info(node_id) == NULL)) { ereport(ERROR, (errmsg("informing node info failed"), errdetail("invalid node ID : %s", buf))); } else { /* First, send array size of node_info */ char arr_code[] = "ArraySize"; char node_info_size[16]; /* Finally, indicate that all data is sent */ char fin_code[] = "CommandComplete"; nodes = get_nodes(&nrows, node_id); if (node_id == -1) { snprintf(node_info_size, sizeof(node_info_size), "%d", NUM_BACKENDS); } else { snprintf(node_info_size, sizeof(node_info_size), "%d", 1); } pcp_write(frontend, "i", 1); wsize = htonl(sizeof(arr_code) + strlen(node_info_size) + 1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, arr_code, sizeof(arr_code)); pcp_write(frontend, node_info_size, strlen(node_info_size) + 1); do_pcp_flush(frontend); /* Second, send process information for all connection_info */ for (i = 0; i < NUM_BACKENDS ; i++) { char port_str[6]; char status[2]; char quarantine[2]; char weight_str[20]; char role_str[10]; char standby_delay_str[20]; char standby_delay_by_time_str[4]; char status_changed_time_str[20]; char code[] = "NodeInfo"; BackendInfo *bi = NULL; SERVER_ROLE role; if (node_id != -1 && node_id != i) continue; bi = pool_get_node_info(i); if (bi == NULL) ereport(ERROR, (errmsg("informing node info failed"), errdetail("invalid node ID"))); snprintf(port_str, sizeof(port_str), "%d", bi->backend_port); snprintf(status, sizeof(status), "%d", bi->backend_status); snprintf(quarantine, sizeof(quarantine), "%d", bi->quarantine); snprintf(weight_str, sizeof(weight_str), "%f", bi->backend_weight); if (STREAM) { if (Req_info->primary_node_id == i) role = ROLE_PRIMARY; else role = ROLE_STANDBY; } else { if (Req_info->main_node_id == i) role = ROLE_MAIN; else role = ROLE_REPLICA; } snprintf(role_str, sizeof(role_str), "%d", role); snprintf(standby_delay_by_time_str, sizeof(standby_delay_by_time_str), "%d", bi->standby_delay_by_time); 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(quarantine) + 1 + strlen(nodes[i].pg_status) + 1 + strlen(weight_str) + 1 + strlen(role_str) + 1 + strlen(nodes[i].pg_role) + 1 + strlen(standby_delay_by_time_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, quarantine, strlen(quarantine) + 1); pcp_write(frontend, nodes[i].pg_status, strlen(nodes[i].pg_status) + 1); pcp_write(frontend, weight_str, strlen(weight_str) + 1); pcp_write(frontend, role_str, strlen(role_str) + 1); pcp_write(frontend, nodes[i].pg_role, strlen(nodes[i].pg_role) + 1); pcp_write(frontend, standby_delay_by_time_str, strlen(standby_delay_by_time_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); } pcp_write(frontend, "i", 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 node info"), errdetail("retrieved node information from shared memory"))); pfree(nodes); } } /* * Send out health check stats data to pcp client. node id is provided as a * string in buf parameter. * * The protocol starts with 'h', followed by 4-byte packet length integer in * network byte order including self. Each data is represented as a null * terminated string. The order of each data is defined in * POOL_HEALTH_CHECK_STATS struct. */ static void inform_health_check_stats(PCP_CONNECTION *frontend, char *buf) { POOL_HEALTH_CHECK_STATS *stats; POOL_HEALTH_CHECK_STATS *s; int *offsets; int n; int nrows; int i; int node_id; bool node_id_ok = false; int wsize; char code[] = "CommandComplete"; node_id = atoi(buf); if (node_id < 0 || node_id > NUM_BACKENDS) { ereport(ERROR, (errmsg("informing health check stats info failed"), errdetail("invalid node ID %d", node_id))); } stats = get_health_check_stats(&nrows); for (i = 0; i < nrows; i++) { if (atoi(stats[i].node_id) == node_id) { node_id_ok = true; s = &stats[i]; break; } } if (!node_id_ok) { ereport(ERROR, (errmsg("informing health check stats info failed"), errdetail("stats data for node ID %d does not exist", node_id))); } pcp_write(frontend, "h", 1); /* indicate that this is a reply to health check stats request */ wsize = sizeof(code) + sizeof(int); /* Calculate total packet length */ offsets = pool_health_check_stats_offsets(&n); for (i = 0; i < n; i++) { wsize += strlen((char *)s + offsets[i]) + 1; } wsize = htonl(wsize); /* convert to network byte order */ /* send packet length to frontend */ pcp_write(frontend, &wsize, sizeof(int)); /* send "Command Complete" to frontend */ pcp_write(frontend, code, sizeof(code)); /* send each health check stats data to frontend */ for (i = 0; i < n; i++) { pcp_write(frontend, (char *)s + offsets[i], strlen((char *)s + offsets[i]) + 1); } pfree(stats); 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_reload_config(PCP_CONNECTION * frontend, char scope) { char code[] = "CommandComplete"; int wsize; if (scope == 'c' && pool_config->use_watchdog) { ereport(LOG, (errmsg("PCP: sending command to watchdog to reload config cluster"))); if (wd_execute_cluster_command(WD_COMMAND_RELOAD_CONFIG_CLUSTER, NULL) != COMMAND_OK) ereport(ERROR, (errmsg("PCP: error while processing reload config request for cluster"), errdetail("failed to propagate reload config command through watchdog"))); } if(pool_signal_parent(SIGHUP) == -1) { ereport(ERROR, (errmsg("process reload config request failed"), errdetail("failed to signal pgpool parent process"))); } pcp_write(frontend, "z", 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_log_rotate(PCP_CONNECTION * frontend, char scope) { char code[] = "CommandComplete"; int wsize; if (scope == 'c' && pool_config->use_watchdog) { ereport(LOG, (errmsg("PCP: sending command to watchdog to logrotate cluster"))); if (wd_execute_cluster_command(WD_COMMAND_LOGROTATE_CLUSTER, NULL) != COMMAND_OK) ereport(ERROR, (errmsg("PCP: error while processing log rotation request for cluster"), errdetail("failed to propagate log rotation command through watchdog"))); } pool_signal_logrotate(); pcp_write(frontend, "v", 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_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, false); 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 && !(STREAM)) || (STREAM && node_id == PRIMARY_NODE_ID)) { if (STREAM) 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"))); } /* * Process promote node request. This function is tricky. If promote option * is sent from client, calls pool_detach_node() so that failover script * actually promote the specified node and detach current primary. */ static void process_promote_node(PCP_CONNECTION * frontend, char *buf, char tos) { int node_id; int wsize; char code[] = "CommandComplete"; bool gracefully; char node_id_buf[64]; char *p; char promote_option; if (tos == 'J') gracefully = false; else gracefully = true; p = node_id_buf; while (*buf && *buf != ' ') *p++ = *buf++; *p = '\0'; buf += 2; promote_option = *buf; node_id = atoi(node_id_buf); if ((node_id < 0) || (node_id >= pool_config->backend_desc->num_backends)) ereport(ERROR, (errmsg("could not process promote request"), errdetail("node id %d is not valid", node_id))); /* Promoting node is only possible in Streaming Replication mode */ if (!STREAM) { ereport(FATAL, (errmsg("invalid pgpool mode for process promote 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 promote request"), errdetail("specified node is already primary node, can't promote node id %d", node_id))); } ereport(LOG, (errmsg("pcp_promote_node: promote option: %c", promote_option))); if (promote_option == 's') { ereport(DEBUG1, (errmsg("PCP: processing promote node"), errdetail("promoting Node ID %d and shutdown primary node %d", node_id, REAL_PRIMARY_NODE_ID))); pool_detach_node(node_id, gracefully, true); } else { 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); } /* * Process pcp_invalidate_query_cache */ static void process_invalidate_query_cache(PCP_CONNECTION * frontend) { int wsize; char code[] = "CommandComplete"; if (!pool_config->memory_cache_enabled) ereport(ERROR, (errmsg("query cache is not enabled"))); ereport(DEBUG1, (errmsg("PCP: processing invalidate query cache"))); /* Set query cache invalidation request flag */ Req_info->query_cache_invalidate_request = true; pcp_write(frontend, "g", 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_shutdown_request(PCP_CONNECTION * frontend, char mode, char tos) { char code[] = "CommandComplete"; int len; ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("shutdown mode \"%c\"", mode))); /* quickly bail out if invalid mode is specified * because we do not want to propagate the command * with invalid mode over the watchdog network */ if (mode != 's' && mode != 'i' && mode != 'f' ) { ereport(ERROR, (errmsg("PCP: error while processing shutdown request"), errdetail("invalid shutdown mode \"%c\"", mode))); } if (tos == 't' && pool_config->use_watchdog) { WDExecCommandArg wdExecCommandArg; List *args_list = NULL; strncpy(wdExecCommandArg.arg_name, "mode", sizeof(wdExecCommandArg.arg_name) - 1); snprintf(wdExecCommandArg.arg_value, sizeof(wdExecCommandArg.arg_value) - 1, "%c",mode); args_list = lappend(args_list,&wdExecCommandArg); ereport(LOG, (errmsg("PCP: sending command to watchdog to shutdown cluster"))); if (wd_execute_cluster_command(WD_COMMAND_SHUTDOWN_CLUSTER, args_list) != COMMAND_OK) ereport(ERROR, (errmsg("PCP: error while processing shutdown cluster request"), errdetail("failed to propagate shutdown command through watchdog"))); list_free(args_list); } 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); terminate_pgpool(mode, true); } static void process_set_configuration_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 : \"%m\""))); } /* * 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 : \"%m\""))); } 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.6.0/src/pcp_con/recovery.c0000664000175000017500000003364714760007565014504 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2021 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 "pool.h" #include "pool_config.h" #include #include #include "pcp/recovery.h" #include "utils/elog.h" #include "utils/pool_signal.h" #include "libpq-fe.h" #include "main/pool_internal_comms.h" #include "watchdog/wd_internal_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 * main_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. * Main 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 main/primary node */ node_id = MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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) { if(chceck_password_type_is_not_md5(pool_config->recovery_user, pool_config->recovery_password) == -1) { ereport(ERROR, (errmsg("the password of recovery_user %s is invalid format", pool_config->recovery_user), errdetail("recovery_password is not allowed to be md5 hashed format"))); } ereport(ERROR, (errmsg("node recovery failed, unable to connect to main 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. * * "main_backend" is either primary backend node (in streaming replication * mode) or main backend node (in other mode). */ static void exec_recovery(PGconn *conn, BackendInfo * main_backend, BackendInfo * recovery_backend, char stage, int recovery_node) { PGresult *result; char *hostname; char *script; char *main_hostname; if (strlen(recovery_backend->backend_hostname) == 0 || *(recovery_backend->backend_hostname) == '/') hostname = "localhost"; else hostname = recovery_backend->backend_hostname; if (strlen(main_backend->backend_hostname) == 0 || *(main_backend->backend_hostname) == '/') main_hostname = "localhost"; else main_hostname = main_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', '%s')", script, hostname, recovery_backend->backend_data_directory, main_backend->backend_port, recovery_node, recovery_backend->backend_port, main_hostname ); 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: malformed conn_counter (%d) detected. reset it to 0", Req_info->conn_counter))); Req_info->conn_counter = 0; return 0; } return 1; } pgpool-II-4.6.0/src/protocol/0000775000175000017500000000000014760010070012746 500000000000000pgpool-II-4.6.0/src/protocol/pool_proto2.c0000664000175000017500000004250014760001620015312 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(MAIN(backend), nullmap, nbytes); memcpy(nullmap1, nullmap, nbytes); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MAIN_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 main 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(MAIN(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(MAIN(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_MAIN_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 main [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(MAIN(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_MAIN_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 main 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(MAIN(backend), &size, sizeof(int)) < 0) return POOL_END; for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MAIN_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 main [size:%d] and backend no %d [size:%d]", i, ntohl(size), j, ntohl(size1)))); } buf = NULL; /* forward to frontend */ if (IS_MAIN_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_MAIN_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(MAIN(backend), &len, 0); if (string == NULL) return POOL_END; else if (!strncmp(string, "BEGIN", 5)) TSTATE(backend, MAIN_NODE_ID) = 'T'; else if (!strncmp(string, "COMMIT", 6) || !strncmp(string, "ROLLBACK", 8)) TSTATE(backend, MAIN_NODE_ID) = 'I'; len1 = len; string1 = pstrdup(string); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i) || IS_MAIN_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 main(%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(MAIN(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_MAIN_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 main(%d) and %d th backend(%d)", len, i, len1), errhint("main(%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(MAIN(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(MAIN(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_MAIN_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(MAIN(backend), &num_fields, sizeof(short)); num_fields1 = num_fields; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MAIN_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 main(%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(MAIN(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_MAIN_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 main(%d) and %d th backend(%d)", ntohl(len), j, ntohl(len1)))); } } } /* type oid */ pool_read(MAIN(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_MAIN_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 main(%d) and %d th backend(%d)", ntohl(oid), j, ntohl(oid1)))); } } } pool_write(frontend, &oid1, sizeof(int)); /* size */ pool_read(MAIN(backend), &size, sizeof(short)); size1 = size; for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MAIN_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 main(%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(MAIN(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_MAIN_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 main(%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.6.0/src/protocol/child.c0000664000175000017500000015115014760007565014137 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "pool_config.h" #include "pool_config_variables.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_ssl.h" #include "utils/pool_ipc.h" #include "utils/pool_relcache.h" #include "utils/pool_ip.h" #include "utils/pool_stream.h" #include "utils/elog.h" #include "utils/ps_status.h" #include "utils/timestamp.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "protocol/pool_connection_pool.h" #include "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "auth/pool_auth.h" #include "auth/md5.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.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 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 check_exit_request(void); static void enable_authentication_timeout(void); static void disable_authentication_timeout(void); static int wait_for_new_connections(int *fds, 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 log_disconnections(char *database, char *username); 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 child_will_go_down(int code, Datum arg); static int opt_sort(const void *a, const void *b); static bool unix_fds_not_isset(int* fds, int num_unix_fds, fd_set* opt); /* * 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; /* * si modules use SIGUSR2 */ volatile sig_atomic_t sigusr2_received = 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; 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; struct timeval startTime; #ifdef DEBUG bool stop_now = false; #endif /* * If true, connection pool has been initialized. */ static bool connection_pool_initialized = false; /* * 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; /* counter for child_max_connections. "volatile" declaration is necessary * so that this is counted up even if long jump is issued due to * ereport(ERROR). */ volatile int connections_count = 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++) socket_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); } connection_pool_initialized = true; /* * 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(); if (pool_config->log_disconnections) log_disconnections(child_frontend->database, child_frontend->username); } 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++; pool_get_my_process_info()->client_connection_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; } update_pooled_connection_count(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; 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(); check_exit_request(); accepted = 0; /* Destroy session context for just in case... */ pool_session_context_destroy(); front_end_fd = wait_for_new_connections(fds, &saddr); pool_get_my_process_info()->wait_for_connect = 0; if (front_end_fd == OPERATION_TIMEOUT) { if (pool_config->child_life_time > 0 && pool_get_my_process_info()->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; set_process_status(CONNECTING); /* Reset any exit if idle request even if it's pending */ pool_get_my_process_info()->exit_if_idle = false; con_count = connection_count_up(); if (pool_config->reserved_connections > 0) { /* * Check if max connections from clients exceeded. */ 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; gettimeofday(&startTime, NULL); check_config_reload(); validate_backend_connectivity(front_end_fd); child_frontend = get_connection(front_end_fd, &saddr); /* set frontend fd to blocking */ socket_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; } /* * Check whether failover/failback is ongoing and wait for it to * finish. If it actually happened, update the private backend status * because it is possible that a backend maybe went down. */ if (wait_for_failover_to_finish() < 0) pool_initialize_private_backend_status(); /* * Connect to backend. Also do authentication between * frontend <--> pgpool and pgpool <--> backend. */ backend = get_backend_connection(child_frontend); if (!backend) { if (pool_config->log_disconnections) log_disconnections(child_frontend->database, child_frontend->username); pool_close(child_frontend); child_frontend = NULL; continue; } pool_get_my_process_info()->connected = 1; /* * show ps status */ sp = MAIN_CONNECTION(backend)->sp; snprintf(psbuf, sizeof(psbuf), "%s %s %s idle", sp->user, sp->database, remote_ps_data); set_ps_display(psbuf, false); set_process_status(IDLE); /* * 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()); /* * Update number of established connections in the connection pool. */ update_pooled_connection_count(); accepted = 0; connection_count_down(); if (pool_config->log_disconnections) log_disconnections(sp->database, sp->user); /* increment queries counter if necessary */ if (pool_config->child_max_connections > 0) connections_count++; pool_get_my_process_info()->client_connection_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 = MAIN_CONNECTION(backend)->sp; /* * cache 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, or when frontend client exits * abnormally, we don't cache connection to backend. Also we have to * check whether reset query failed. If so, the existing connection to * backend may not be used and we don't want to cache the connection. */ 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)) || reset_query_error) cache_connection = false; } /* * Close frontend connection */ reset_connection(); if (*frontend != NULL) { 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 { ereport(DEBUG1, (errmsg("reading startup packet"), errdetail("guc name: %s value: %s", p, p+strlen(p)+1))); 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 = palloc0(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 their 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; } /* * 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)) { /* * We want to catch and ignore errors in do_command if a * backend is just going down right now. Otherwise * do_command raises an error and disconnects the * connection to frontend. We can safely ignore error from * "SET application_name" command if the backend goes * down. */ PG_TRY(); { do_command(frontend, CONNECTION(backend, i), command_buf, MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_CONNECTION(backend)->key, 0); } PG_CATCH(); { /* ignore the error message */ MemoryContextSwitchTo(oldContext); FlushErrorState(); } PG_END_TRY(); } } pool_add_param(&MAIN(backend)->params, "application_name", sp->application_name); set_application_name_with_string(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, MAIN_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); } } /* * Copy startup packet and return it. * palloc is used. */ 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; } /* * Create a new connection to backend. * Authentication is performed if requested by backend. */ 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) && CONNECTION_SLOT(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); /* do authentication against backend */ 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 SIGQUIT */ static RETSIGTYPE die(int sig) { int save_errno; save_errno = errno; POOL_SETMASK(&BlockSig); #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; } POOL_SETMASK(&UnBlockSig); errno = save_errno; } /* * 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; int main_node_id; /* * DROP DATABASE is ongoing. */ if (ignore_sigusr1) return; for (j = 0; j < pool_config->max_pool; j++, p++) { main_node_id = in_use_backend_id(p); if (main_node_id < 0) continue; if (!CONNECTION_SLOT(p, main_node_id)) continue; if (!CONNECTION_SLOT(p, main_node_id)->sp) continue; if (CONNECTION_SLOT(p, main_node_id)->sp->user == NULL) continue; if (CONNECTION_SLOT(p, main_node_id)->closetime > 0) /* idle connection? */ { bool freed = false; pool_send_frontend_exits(p); for (i = 0; i < NUM_BACKENDS; i++) { if (!CONNECTION_SLOT(p, i)) continue; if (!freed) { pool_free_startup_packet(CONNECTION_SLOT(p, i)->sp); CONNECTION_SLOT(p, i)->sp = NULL; freed = true; } 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); } /* * Enable authentication timeout. */ static void enable_authentication_timeout(void) { if (pool_config->authentication_timeout <= 0) return; pool_alarm(authentication_timeout, pool_config->authentication_timeout); alarm_enabled = true; } /* * Disable authentication timeout. */ static void disable_authentication_timeout(void) { if (alarm_enabled) { pool_undo_alarm(); alarm_enabled = false; } } /* * Send parameter status message to frontend. */ 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(&MAIN(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"))); } } /* * 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->log_disconnections) { if (child_frontend) log_disconnections(child_frontend->database, child_frontend->username); else log_disconnections("",""); } } 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 (connection_pool_initialized) close_all_backend_connections(); } /* * Exit child process. Can be called from signal handlers. */ 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); } /* * 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) { sigusr2_received = 1; } /* 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 main 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_main_node_id = REAL_MAIN_NODE_ID; } static void check_exit_request(void) { /* * Check if exit request is set because of spare children management. */ if (pool_get_my_process_info()->exit_if_idle) { ereport(LOG, (errmsg("Exit flag set"), errdetail("Exiting myself"))); pool_get_my_process_info()->exit_if_idle = 0; child_exit(POOL_EXIT_NO_RESTART); } } static void check_restart_request(void) { /* * Check if restart request is set because of failback event happened. 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 = false; child_exit(POOL_EXIT_AND_RESTART); } } /* * wait_for_new_connections() * functions calls select on sockets and wait for new client * to connect, on successful connection returns the socket descriptor * and returns -1 if timeout has occurred */ static int wait_for_new_connections(int *fds, 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 *timeout; struct timeval timeoutdata; for (walk = fds; *walk != -1; walk++) socket_set_nonblock(*walk); if (SERIALIZE_ACCEPT) set_ps_display("wait for accept lock", false); else set_ps_display("wait for connection request", false); set_process_status(WAIT_FOR_CONNECT); /* * 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()"))); } for (;;) { /* check backend timer is expired */ if (backend_timer_expired) { pool_backend_timer(); backend_timer_expired = 0; } /* prepare select */ memcpy((char *) &rmask, (char *) &readmask, sizeof(fd_set)); if (pool_config->child_life_time > 0) { timeoutdata.tv_sec = 1; timeoutdata.tv_usec = 0; timeout = &timeoutdata; } else { timeout = NULL; } numfds = select(nsocks, &rmask, NULL, NULL, timeout); /* not timeout*/ if (numfds != 0) break; /* timeout */ pool_get_my_process_info()->wait_for_connect++; if (pool_get_my_process_info()->wait_for_connect > pool_config->child_life_time) return OPERATION_TIMEOUT; } 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; } 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 : \"%m\""))); } 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(); } /* wait for failover/failback to finish */ if (wait_for_failover_to_finish() < 0) /* failover/failback occurred. Update private backend status */ pool_initialize_private_backend_status(); 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 : \"%m\""))); return RETRY; } /* * Set no delay if AF_INET socket. Not sure if this is really necessary * but PostgreSQL does this. */ if (unix_fds_not_isset(fds, pool_config->num_unix_socket_directories, &rmask)) { 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 \"%m\""))); close(afd); return -1; } } /* * Make sure that the socket is non blocking. */ socket_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 bool unix_fds_not_isset(int* fds, int num_unix_fds, fd_set* opt) { int i; for (i = 0; i < num_unix_fds; i++) { if (!FD_ISSET(fds[i], opt)) continue; return false; } return true; } 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 : \"%m\""))); 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 : \"%m\""))); } 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 : \"%m\""))); } /* 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; } /* * Connect to backend. Also do authentication between client <--> pgpool and * pgpool <--> backend. */ 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); connection_count_down(); 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; } /* GSSAPI? */ if (sp->major == 1234 && sp->minor == 5680) { ereport(DEBUG1, (errmsg("selecting backend connection"), errdetail("GSSAPI request from client"))); /* sorry, Pgpool-II does not support GSSAPI yet */ pool_write_and_flush(frontend, "N", 1); 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); /* * Do frontend <-> pgpool authentication based on pool_hba.conf. */ 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 != MAIN_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, MAIN_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. * Authentication is performed if requested by 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 log_disconnections(char *database, char *username) { struct timeval endTime; long diff; long secs; int msecs, hours, minutes, seconds; gettimeofday(&endTime, NULL); diff = (long) ((endTime.tv_sec - startTime.tv_sec) * 1000000 + (endTime.tv_usec - startTime.tv_usec)); msecs = (int) (diff % 1000000) / 1000; secs = (long) (diff / 1000000); hours = secs / 3600; secs %= 3600; minutes = secs / 60; seconds = secs % 60; ereport(LOG, (errmsg("frontend disconnection: session time: %d:%02d:%02d.%03d " "user=%s database=%s host=%s%s%s", hours, minutes, seconds, msecs, username, database, remote_host, remote_port[0] ? " port=" : "", remote_port))); } 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); } 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) socket_unset_nonblock(child_frontend->fd); else socket_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); } void set_process_status(ProcessStatus status) { pool_get_my_process_info()->status = status; } pgpool-II-4.6.0/src/protocol/pool_pg_utils.c0000664000175000017500000007100514760007565015733 00000000000000/* * * 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 "protocol/pool_pg_utils.h" #include "protocol/pool_connection_pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_ipc.h" #include "utils/pool_stream.h" #include "utils/pool_ssl.h" #include "utils/elog.h" #include "utils/pool_relcache.h" #include "auth/pool_auth.h" #include "context/pool_session_context.h" #include "pool_config.h" #include "pool_config_variables.h" static int choose_db_node_id(char *str); static void free_persistent_db_connection_memory(POOL_CONNECTION_POOL_SLOT * cp); static void si_enter_critical_region(void); static void si_leave_critical_region(void); /* * 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_persistent_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_persistent_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_persistent_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_persistent_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_persistent_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(); { /* * We used to call EmitErrorReport() to log the error and send an * error message to frontend. However if pcp frontend program * receives an ERROR, it stops processing and terminates, which is not * good. This is problematic especially with pcp_node_info, since it * calls db_node_role(), and db_node_role() calls this function. So if * the target PostgreSQL is down, EmitErrorReport() sends ERROR message * to pcp frontend and it stops (see process_pcp_response() in * src/libs/pcp/pcp.c. To fix this, just eliminate calling * EmitErrorReport(). This will suppress ERROR message but as you can * see the comment in this function "does not ereports in case of an * error", this should have been the right behavior in the first * place. */ 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. */ static void free_persistent_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) */ socket_set_nonblock(cp->con->fd); pool_flush_it(cp->con); socket_unset_nonblock(cp->con->fd); pool_close(cp->con); free_persistent_db_connection_memory(cp); } /* * 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); } 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; } /* * 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, index_user = -1; POOL_SESSION_CONTEXT *ses = pool_get_session_context(false); int tmp; int no_load_balance_node_id = -2; uint64 lowest_delay; int lowest_delay_nodes[NUM_BACKENDS]; /* * -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 user_redirect_preference_list */ if (SL_MODE && pool_config->redirect_usernames) { char *user = MAIN_CONNECTION(ses->backend)->sp->user; /* * Check to see if the user matches any of * user_redirect_preference_list */ index_user = regex_array_match(pool_config->redirect_usernames, user); if (index_user >= 0) { /* Matches */ ereport(DEBUG1, (errmsg("selecting load balance node user matched"), errdetail("username: %s index is %d dbnode is %s weight is %f", user, index_user, pool_config->user_redirect_tokens->token[index_user].right_token, pool_config->user_redirect_tokens->token[index_user].weight_token))); tmp = choose_db_node_id(pool_config->user_redirect_tokens->token[index_user].right_token); if (tmp == -1 || (tmp >= 0 && VALID_BACKEND_RAW(tmp))) suggested_node_id = tmp; } } /* * Check database_redirect_preference_list */ if (SL_MODE && pool_config->redirect_dbnames) { char *database = MAIN_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) { /* * if the database name matches any of * database_redirect_preference_list, * user_redirect_preference_list will be ignored. */ index_user = -1; /* 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_RAW(tmp))) suggested_node_id = tmp; } } /* * Check app_name_redirect_preference_list */ if (SL_MODE && pool_config->redirect_app_names) { char *app_name = MAIN_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 application 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 application name matches any of * app_name_redirect_preference_list, * database_redirect_preference_list will be ignored. */ index_user = -1; index_db = -1; /* Matches */ ereport(DEBUG1, (errmsg("selecting load balance node app name 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_RAW(tmp))) suggested_node_id = tmp; } } } if (suggested_node_id >= 0) { /* * If pgpool is running in Streaming Replication mode and delay_threshold * and prefer_lower_delay_standby are true, we choose the least delayed * node if suggested_node is standby and delayed over delay_threshold. */ if (STREAM && pool_config->prefer_lower_delay_standby && suggested_node_id != PRIMARY_NODE_ID && check_replication_delay(suggested_node_id) < 0) { ereport(DEBUG1, (errmsg("selecting load balance node"), errdetail("suggested backend %d is streaming delayed over delay_threshold", suggested_node_id))); /* * The new load balancing node is selected from the * nodes which have the lowest delay. */ if (pool_config->delay_threshold_by_time > 0) lowest_delay = pool_config->delay_threshold_by_time * 1000; /* convert from milli seconds to micro seconds */ else lowest_delay = pool_config->delay_threshold; /* Initialize */ total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { lowest_delay_nodes[i] = 0; } for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND_RAW(i) && (i != PRIMARY_NODE_ID) && (BACKEND_INFO(i).backend_weight > 0.0)) { if (lowest_delay == BACKEND_INFO(i).standby_delay) { lowest_delay_nodes[i] = 1; total_weight += BACKEND_INFO(i).backend_weight; } else if (lowest_delay > BACKEND_INFO(i).standby_delay) { int ii; lowest_delay = BACKEND_INFO(i).standby_delay; for (ii = 0; ii < NUM_BACKENDS; ii++) { lowest_delay_nodes[ii] = 0; } lowest_delay_nodes[i] = 1; 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 selected_slot = PRIMARY_NODE_ID; total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { if (lowest_delay_nodes[i] == 0) continue; if (selected_slot == PRIMARY_NODE_ID) selected_slot = i; 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; } /* * 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) || (index_user >= 0 && r <= pool_config->user_redirect_tokens->token[index_user].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) || (index_user >= 0 && r > pool_config->user_redirect_tokens->token[index_user].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 = MAIN_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; } } /* * If Streaming Replication mode and delay_threshold and * prefer_lower_delay_standby is true, we elect the most lower delayed * node if suggested_node is standby and delayed over delay_threshold. */ if (STREAM && pool_config->prefer_lower_delay_standby && check_replication_delay(selected_slot) < 0) { ereport(DEBUG1, (errmsg("selecting load balance node"), errdetail("backend id %d is streaming delayed over delay_threshold", selected_slot))); if (pool_config->delay_threshold_by_time > 0) lowest_delay = pool_config->delay_threshold_by_time * 1000; else lowest_delay = pool_config->delay_threshold; total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { lowest_delay_nodes[i] = 0; } for (i = 0; i < NUM_BACKENDS; i++) { if ((i != PRIMARY_NODE_ID) && VALID_BACKEND_RAW(i) && (BACKEND_INFO(i).backend_weight > 0.0)) { if (lowest_delay == BACKEND_INFO(i).standby_delay) { lowest_delay_nodes[i] = 1; total_weight += BACKEND_INFO(i).backend_weight; } else if (lowest_delay > BACKEND_INFO(i).standby_delay) { int ii; lowest_delay = BACKEND_INFO(i).standby_delay; for (ii = 0; ii < NUM_BACKENDS; ii++) { lowest_delay_nodes[ii] = 0; } lowest_delay_nodes[i] = 1; 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 selected_slot = PRIMARY_NODE_ID; total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { if (lowest_delay_nodes[i] == 0) continue; if (selected_slot == PRIMARY_NODE_ID) { selected_slot = i; } 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; } /* * 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 pg_catalog.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; } /* * 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 MAIN_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 = MAIN_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; } /* *--------------------------------------------------------------------------------- * Snapshot Isolation modules * Pgpool-II's native replication mode has not consider snapshot isolation * among backend nodes. This leads to database inconsistency among backend * nodes. A new mode called "snapshot_isolation" solves the problem. * * Consider following example. S1, S2 are concurrent sessions. N1, N2 are * backend nodes. The initial value of t1.i is 0. S2/N2 does see the row * having i = 1 and successfully deletes the row. However S2/N1 does not see * the row having i = 1 since S1/N1 has not committed yet at the when S2/S1 * tries to delete the row. As a result, t1.i is not consistent among N1 and * N2. There's no way to avoid this in the native replication mode. So we * propose the new mode which uses snapshot isolation (i.e. REPEATABLE READ or * SERIALIZABLE mode in PostgreSQL) and controlling the timing of snapshot * acquisition in a transaction and commit timing. The algorithm was proposed * in "Pangea: An Eager Database Replication Middleware guaranteeing Snapshot * Isolation without Modification of Database Servers" * (http://www.vldb.org/pvldb/vol2/vldb09-694.pdf). * * S1/N1: BEGIN; * S1/N2: BEGIN; * S1/N1: UPDATE t1 SET i = i + 1; -- i = 1 * S1/N2: UPDATE t1 SET i = i + 1; -- i = 1 * S1/N2: COMMIT; * S2/N1: BEGIN; * S2/N2: BEGIN; * S2/N1: DELETE FROM t1 WHERE i = 1; * S2/N2: DELETE FROM t1 WHERE i = 1; * S1/N1: COMMIT; * S2/N2: COMMIT; * S2/N1: COMMIT; *--------------------------------------------------------------------------------- */ #ifdef SI_DEBUG_LOG #define SI_DEBUG_LOG_LEVEL LOG #else #define SI_DEBUG_LOG_LEVEL DEBUG5 #endif /* * Enter critical region. All SI operations must be protected by this. */ static void si_enter_critical_region(void) { elog(SI_DEBUG_LOG_LEVEL, "si_enter_critical_region called"); pool_semaphore_lock(SI_CRITICAL_REGION_SEM); } /* * Leave critical region. */ static void si_leave_critical_region(void) { elog(SI_DEBUG_LOG_LEVEL, "si_leave_critical_region called"); pool_semaphore_unlock(SI_CRITICAL_REGION_SEM); } /* * Returns true if snapshot is already prepared in this session. */ bool si_snapshot_prepared(void) { POOL_SESSION_CONTEXT *session; session = pool_get_session_context(true); return session->si_state == SI_SNAPSHOT_PREPARED; } /* * Returns true if the command will acquire snapshot. */ bool si_snapshot_acquire_command(Node *node) { return !is_start_transaction_query(node) && !IsA(node, VariableSetStmt) && !IsA(node, VariableShowStmt); } /* * Acquire snapshot */ void si_acquire_snapshot(void) { POOL_SESSION_CONTEXT *session; session = pool_get_session_context(true); if (session->si_state == SI_NO_SNAPSHOT) { for (;;) { si_enter_critical_region(); elog(SI_DEBUG_LOG_LEVEL, "si_acquire_snapshot called: counter: %d", si_manage_info->snapshot_counter); if (si_manage_info->commit_counter > 0) { si_manage_info->commit_waiting_children[my_proc_id] = getpid(); si_leave_critical_region(); elog(SI_DEBUG_LOG_LEVEL, "si_acquire_snapshot left critical region"); sleep(1); } else break; } si_manage_info->snapshot_counter++; si_leave_critical_region(); } } /* * Notice that snapshot is acquired */ void si_snapshot_acquired(void) { POOL_SESSION_CONTEXT *session; int i; session = pool_get_session_context(true); if (session->si_state == SI_NO_SNAPSHOT) { si_enter_critical_region(); elog(SI_DEBUG_LOG_LEVEL, "si_snapshot_acquired called: counter: %d", si_manage_info->snapshot_counter); si_manage_info->snapshot_counter--; if (si_manage_info->snapshot_counter == 0) { /* wakeup all waiting children */ for (i = 0; i < pool_config->num_init_children ; i++) { pid_t pid = si_manage_info->snapshot_waiting_children[i]; if (pid > 0) { elog(SI_DEBUG_LOG_LEVEL, "si_snapshot_acquired: send SIGUSR2 to %d", pid); kill(pid, SIGUSR2); si_manage_info->snapshot_waiting_children[i] = 0; } } } si_leave_critical_region(); session->si_state = SI_SNAPSHOT_PREPARED; } } /* * Commit request */ void si_commit_request(void) { POOL_SESSION_CONTEXT *session; session = pool_get_session_context(true); elog(SI_DEBUG_LOG_LEVEL, "si_commit_request called"); if (session->si_state == SI_SNAPSHOT_PREPARED) { for (;;) { si_enter_critical_region(); if (si_manage_info->snapshot_counter > 0) { si_manage_info->snapshot_waiting_children[my_proc_id] = getpid(); si_leave_critical_region(); sleep(1); } else break; } elog(SI_DEBUG_LOG_LEVEL, "si_commit_request: commit_counter: %d", si_manage_info->commit_counter); si_manage_info->commit_counter++; si_leave_critical_region(); } } /* * Notice that commit is done */ void si_commit_done(void) { POOL_SESSION_CONTEXT *session; int i; session = pool_get_session_context(true); elog(SI_DEBUG_LOG_LEVEL, "si_commit_done called"); if (session->si_state == SI_SNAPSHOT_PREPARED) { si_enter_critical_region(); elog(SI_DEBUG_LOG_LEVEL, "si_commit_done: commit_counter: %d", si_manage_info->commit_counter); si_manage_info->commit_counter--; if (si_manage_info->commit_counter == 0) { /* wakeup all waiting children */ for (i = 0; i < pool_config->num_init_children ; i++) { pid_t pid = si_manage_info->commit_waiting_children[i]; if (pid > 0) { elog(SI_DEBUG_LOG_LEVEL, "si_commit_done: send SIGUSR2 to %d", pid); kill(pid, SIGUSR2); si_manage_info->commit_waiting_children[i] = 0; } } } si_leave_critical_region(); session->si_state = SI_NO_SNAPSHOT; } } /* * Check replication delay and returns the status. * Return values: * 0: no delay or not in streaming repplication mode or * delay_threshold(_by_time) is set to 0 * -1: delay exceeds delay_threshold_by_time * -2: delay exceeds delay_threshold */ int check_replication_delay(int node_id) { BackendInfo *bkinfo; if (!STREAM) return 0; bkinfo = pool_get_node_info(node_id); /* * Check delay_threshold_by_time. bkinfo->standby_delay is in * microseconds while delay_threshold_by_time is in milliseconds. We need * to multiply delay_threshold_by_time by 1000 to normalize. */ if (pool_config->delay_threshold_by_time > 0 && bkinfo->standby_delay > pool_config->delay_threshold_by_time*1000) return -1; /* * Check delay_threshold. */ if (pool_config->delay_threshold > 0 && bkinfo->standby_delay > pool_config->delay_threshold) return -2; return 0; } pgpool-II-4.6.0/src/protocol/pool_process_query.c0000664000175000017500000041704414760007565017017 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "parser/pg_config_manual.h" #include "rewrite/pool_timestamp.h" #include "main/pool_internal_comms.h" #include "protocol/pool_process_query.h" #include "protocol/pool_proto_modules.h" #include "protocol/pool_connection_pool.h" #include "protocol/pool_pg_utils.h" #include "protocol/protocol_defs.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "utils/pool_ssl.h" #include "utils/ps_status.h" #include "utils/pool_signal.h" #include "utils/pool_select_walker.h" #include "utils/pool_relcache.h" #include "utils/pool_stream.h" #include "utils/statistics.h" #include "context/pool_session_context.h" #include "context/pool_query_context.h" #include "query_cache/pool_memqcache.h" #include "auth/pool_hba.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" #define IDLE_SESSION_TIMEOUT_ERROR_CODE "57P05" 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(char *message, int major); static int extract_message(POOL_CONNECTION * backend, char *error_code, int major, char class, bool unread); static int detect_postmaster_down_error(POOL_CONNECTION * backend, 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_standbys_command_complete(unsigned char *kind_list, int num_backends, int main_node); 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 * backends. */ 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(); } /* * Reset error flag while processing reset queries. * The flag is set to on inside pool_send_and_wait(). */ reset_query_error = false; 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); backend->info->client_idle_duration = 0; 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); backend->info->client_idle_duration = 0; if (status != POOL_CONTINUE) return status; else if (!cont) /* Detected admin shutdown */ return status; } else { /* * If we have pending data in main, we need to process * it */ if (pool_ssl_pending(MAIN(backend)) || !pool_read_buffer_is_empty(MAIN(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 main, we need * to process it */ if (IS_MAIN_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 main 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 (MAIN_REPLICA) { int sendlen; /* * In native replication 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 * MAIN_NODE_ID will be pointing * to the standby node. And we * will get stuck if we keep * waiting for the current main * 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 main first * and then standbys. So if it * arrives standby first, we should * try to read from main, 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 discard and read %c packet from main", kind, i, kind))); pool_read_with_error(CONNECTION(backend, MAIN_NODE_ID), &kind, sizeof(kind), "reading message kind from backend"); pool_unread(CONNECTION(backend, MAIN_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; } /* * Process query cache invalidation request if any. */ if (pool_config->memory_cache_enabled) { volatile bool invalidate_request = Req_info->query_cache_invalidate_request; if (invalidate_request) { /* * Delete all query cache in shared memory or memcached. */ clear_query_cache(); Req_info->query_cache_invalidate_request = false; } } } } /* * 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 second, 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 occurred 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 status 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_DEBUG, (errmsg("unable to flush data to frontend"), errdetail("frontend error occurred 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_DEBUG, (errmsg("unable to flush data to frontend"), errdetail("frontend error occurred 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 protected 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) */ socket_set_nonblock(CONNECTION(backend, i)->fd); pool_flush_it(CONNECTION(backend, i)); socket_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_SESSION_CONTEXT *session_context; /* Get session context */ session_context = pool_get_session_context(false); pool_read(MAIN(backend), &len, sizeof(len)); len = ntohl(len); len -= 4; len1 = len; p = pool_read2(MAIN(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 native replication mode, other * backends will not receive the message. So we should skip other nodes * otherwise we will hang in pool_read. */ if (!MAIN_REPLICA || kind != 'A') { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MAIN_NODE_ID(i)) { 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 main(%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", "Notification response", * "Row description", "No data" and "Close Complete". * 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' || kind == 'T' || kind == 'n' || kind == '3') { pool_write_and_flush(frontend, p1, len1); } else if (session_context->flush_pending) { pool_write_and_flush(frontend, p1, len1); ereport(DEBUG5, (errmsg("SimpleForwardToFrontend: flush pending request. kind: %c", kind))); } else { pool_write(frontend, p1, len1); } session_context->flush_pending = false; 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 occurred 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; } /* * Handle parameter status message */ 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 = NULL; /* pointer to parameter + value string buffer */ 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[MAIN_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_MAIN_NODE_ID(i)) { int pos; len1 = len; /* * To suppress Coverity false positive warning. Actually * being IS_MAIN_NODE_ID(i)) true only happens in a loop. So * we don't need to worry about to leak memory previously * allocated in parambuf. But Coverity is not smart enough * to realize it. */ if (parambuf) pfree(parambuf); parambuf = palloc(len); memcpy(parambuf, p, len); pool_add_param(&CONNECTION(backend, i)->params, name, value); if (!strcmp("application_name", name)) { set_application_name_with_string(pool_find_name(&CONNECTION(backend, i)->params, name, &pos)); } } else { /* * Except "in_hot_standby" parameter, complain the message length difference. */ if (strcmp(name, "in_hot_standby")) { pool_emit_log_for_message_length_diff(len_array, name); } } #ifdef DEBUG pool_param_debug_print(&MAIN(backend)->params); #endif } } if (parambuf) { status = pool_write(frontend, parambuf, len1); pfree(parambuf); } else ereport(ERROR, (errmsg("ParameterStatus: failed to obtain parameter name, value from the main node."))); 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; /* 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); if (pool_config->memory_cache_enabled) { pool_discard_current_temp_query_cache(); } return 1; } /* * Returns true if the SQL statement is regarded as read SELECT from syntax's * point of view. However callers need to do additional checking such as if the * SELECT does not have write functions or not to make sure that the SELECT is * semantically read SELECT. * * For followings this function returns true: * - SELECT/WITH without FOR UPDATE/SHARE * (for PREPARE, this function checks its "query" member of PrepareStmt) * - COPY TO STDOUT * - EXPLAIN * - EXPLAIN ANALYZE and query is SELECT not including writing functions * - SHOW * * Note that for SELECT INTO this function returns false. */ bool is_select_query(Node *node, char *sql) { bool prepare = false; if (node == NULL) return false; if (sql == NULL) { elog(WARNING, "is_select_query called without SQL string"); return false; } if (!pool_config->allow_sql_comments && pool_config->ignore_leading_white_space) { /* ignore leading white spaces */ while (*sql && isspace(*sql)) sql++; } /* * If it's PREPARE, then we check the actual query specified in "AS" * clause. */ if (IsA(node, PrepareStmt)) { PrepareStmt *prepare_statement = (PrepareStmt *) node; prepare = true; node = (Node *) (prepare_statement->query); } 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 SQL comment is not allowed, the query must start with certain characters. * However if it's PREPARE, we should skip the check. */ 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 == ';' || prepare); 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) || is_rollback_to_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; } /* * Returns true if SQL is transaction rollback to command */ bool is_rollback_to_query(Node *node) { TransactionStmt *stmt; if (node == NULL || !IsA(node, TransactionStmt)) return false; stmt = (TransactionStmt *) node; return stmt->kind == TRANS_STMT_ROLLBACK_TO; } /* * 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 socket_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))); socket_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 occurred, 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 backend 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 receive one of: * * N: Notice response E: Error response C: Command 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 * length */ 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\" \"%s\"", string, query))); } } } /* * 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 length 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 main node 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 receive one of: * * N: Notice response C: Command 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 main node only in * load balance mode. Problem is, if the query failed, main 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 main 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 query 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 occurred 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 Complete" 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 protocol with named * statement/portal if we are processing extended query since simple * query breaks unnamed statements/portals. The name of named * statement/unnamed 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 popped 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 describe message if the query is SELECT. */ if (!strncasecmp(query, "SELECT", strlen("SELECT"))) { /* * Send describe 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) { int etype; /* * 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. * However if the process type is main process, we should not * exit the process. */ if (processType == PT_WORKER) { /* * sleep appropriate time to avoid pool_worker_child * exit/fork storm. */ sleep(pool_config->sr_check_period); } if (processType == PT_MAIN) etype = ERROR; else etype = FATAL; ereport(etype, (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; /* * "Command 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_fields: %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 = ntohs(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 = ntohl(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 necessary * 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, MAIN_NODE_ID, qbuf); if (lock_kind == 1) { if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { do_query(MAIN(backend), qbuf, &result, MAJOR(backend)); } else { status = do_command(frontend, MAIN(backend), qbuf, MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_CONNECTION(backend)->key, 0); } } else if (lock_kind == 2) { do_query(MAIN(backend), qbuf, &result, MAJOR(backend)); } else { POOL_SELECT_RESULT *result; /* issue row lock command */ do_query(MAIN(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, MAIN_NODE_ID, qbuf); /* issue row lock command */ do_query(MAIN(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, MAIN_NODE_ID, qbuf); if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { do_query(MAIN(backend), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } else { status = do_command(frontend, MAIN(backend), qbuf, MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_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_MAIN_NODE_ID(i)) { if (deadlock_detected) status = do_command(frontend, CONNECTION(backend, i), POOL_ERROR_QUERY, PROTO_MAJOR_V3, MAIN_CONNECTION(backend)->pid, MAIN_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(CONNECTION(backend, i), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } else { status = do_command(frontend, CONNECTION(backend, i), qbuf, PROTO_MAJOR_V3, MAIN_CONNECTION(backend)->pid, MAIN_CONNECTION(backend)->key, 0); } } else if (lock_kind == 2 || lock_kind == 3) { 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, MAIN_NODE_ID, "LOCK TABLE pgpool_catalog.insert_lock IN SHARE ROW EXCLUSIVE MODE"); if (do_command(frontend, MAIN(backend), "LOCK TABLE pgpool_catalog.insert_lock IN SHARE ROW EXCLUSIVE MODE", PROTO_MAJOR_V3, MAIN_CONNECTION(backend)->pid, MAIN_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, MAIN_NODE_ID, qbuf); do_query(MAIN(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, MAIN_NODE_ID, qbuf); status = do_command(frontend, MAIN(backend), qbuf, PROTO_MAJOR_V3, MAIN_CONNECTION(backend)->pid, MAIN_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); String *v; if (strcmp(elem->defname, "delimiter") == 0) { v = (String *) elem->arg; copy_delimiter = v->sval[0]; } else if (strcmp(elem->defname, "null") == 0) { if (copy_null) pfree(copy_null); v = (String *) elem->arg; copy_null = MemoryContextStrdup(TopMemoryContext, v->sval); } } } 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 standbys status are 'C' (Command Complete) */ static bool is_all_standbys_command_complete(unsigned char *kind_list, int num_backends, int main_node) { int i; int ok = true; for (i = 0; i < num_backends; i++) { if (i == main_node || 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; session_context->flush_pending = msg->flush_pending; 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 (MAIN_REPLICA) { ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("main node id: %d", MAIN_NODE_ID))); read_kind_from_one_backend(frontend, backend, (char *) &kind, MAIN_NODE_ID); /* * If we received a notification message in native replication 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 main node %d", MAIN_NODE_ID))); if (msg) pool_pending_message_free_pending_message(msg); return; } pool_unread(CONNECTION(backend, MAIN_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 returns 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))); log_backend_messages(kind, i); /* * Read and forward notice messages to frontend */ 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); } /* * Read and forward ParameterStatus messages to frontend */ else if (kind == 'S') { int len2; pool_read(CONNECTION(backend, i), &len, sizeof(len)); len2 = len; len = htonl(len) - 4; p = pool_read2(CONNECTION(backend, i), len); if (p) { value = p + strlen(p) + 1; ereport(DEBUG5, (errmsg("ParameterStatus message from backend: %d", i), errdetail("parameter name: \"%s\" value: \"%s\"", p, value))); if (IS_MAIN_NODE_ID(i)) { int pos; pool_add_param(&CONNECTION(backend, i)->params, p, value); if (!strcmp("application_name", p)) { set_application_name_with_string(pool_find_name(&CONNECTION(backend, i)->params, p, &pos)); } } /* forward to frontend */ pool_write(frontend, &kind, 1); pool_write(frontend, &len2, sizeof(len2)); pool_write_and_flush(frontend, p, len); } 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 kind is ERROR Response, accumulate statistics data. */ for (i = 0; i < NUM_BACKENDS; i++) { int unread_len; char *unread_p; char *p; int len; if (VALID_BACKEND(i)) { if (kind_list[i] == 'E') { int major = MAJOR(CONNECTION(backend, i)); if (major == PROTO_MAJOR_V3) { pool_read(CONNECTION(backend, i), &len, sizeof(len)); unread_len = sizeof(len); unread_p = palloc(ntohl(len)); memcpy(unread_p, &len, sizeof(len)); len = ntohl(len); len -= 4; unread_p = repalloc(unread_p, sizeof(len) + len); p = pool_read2(CONNECTION(backend, i), len); memcpy(unread_p + sizeof(len), p, len); unread_len += len; error_stat_count_up(i, extract_error_kind(unread_p + sizeof(len), PROTO_MAJOR_V3)); pool_unread(CONNECTION(backend, i), unread_p, unread_len); pfree(unread_p); } else if (major == PROTO_MAJOR_V2) { unread_p = pool_read_string(CONNECTION(backend, i), &unread_len, 0); error_stat_count_up(i, extract_error_kind(unread_p, PROTO_MAJOR_V2)); pool_unread(CONNECTION(backend, i), unread_p, unread_len); } } } } 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 primary 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 pending 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 primary or standby. * So we check not only the standby but primary node. */ if (session_context->load_balance_node_id != MAIN_NODE_ID && (kind_list[MAIN_NODE_ID] == 'Z' || kind_list[session_context->load_balance_node_id] == 'Z') && SL_MODE) { POOL_CONNECTION *s; char *buf; int len; if (kind_list[MAIN_NODE_ID] == 'Z') s = CONNECTION(backend, session_context->load_balance_node_id); else s = CONNECTION(backend, MAIN_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 standby 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 main/replica mode, if primary gets an error at commit, while * other standbys 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 (MAIN_REPLICA && query_context->parse_tree && is_commit_query(query_context->parse_tree) && kind_list[MAIN_NODE_ID] == 'E' && is_all_standbys_command_complete(kind_list, NUM_BACKENDS, MAIN_NODE_ID)) { *decided_kind = kind_list[MAIN_NODE_ID]; ereport(LOG, (errmsg("reading backend data packet kind. Error on primary while all standbys 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 main node's kind */ trust_kind = kind_list[MAIN_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 main/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; StringInfoData msg; initStringInfo(&msg); appendStringInfoString(&msg, "kind mismatch among backends. "); appendStringInfoString(&msg, "Possible last query was: \""); appendStringInfoString(&msg, query_string_buffer); appendStringInfoString(&msg, "\" kind details are:"); for (i = 0; i < NUM_BACKENDS; i++) { if (kind_list[i]) { if (kind_list[i] == 'E' || kind_list[i] == 'N') { char *m; appendStringInfo(&msg, "%d[%c: ", i, kind_list[i]); if (pool_extract_error_message(false, CONNECTION(backend, i), MAJOR(backend), true, &m) == 1) { appendStringInfoString(&msg, m); appendStringInfoString(&msg, "]"); pfree(m); } else appendStringInfoString(&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, RAW_PARSE_DEFAULT, 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) { appendStringInfoString(&msg, "["); appendStringInfoString(&msg, sent_msg->query_context->original_query); appendStringInfoString(&msg, "]"); } } } } /* free_parser(); */ } } else appendStringInfo(&msg, " %d[%c]", i, kind_list[i]); } } 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 = MAIN_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); set_process_status(COMMAND_EXECUTE); } /* 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, /* CREATE TABLE */ T_DefineStmt, /* CREATE AGGREGATE, OPERATOR, TYPE */ T_DropStmt, /* DROP TABLE etc. */ T_TruncateStmt, T_CommentStmt, T_FetchStmt, T_IndexStmt, /* CREATE INDEX */ T_CreateFunctionStmt, T_AlterFunctionStmt, /* * T_DoStmt, Our parser does not support yet */ T_RenameStmt, /* ALTER AGGREGATE etc. */ T_RuleStmt, /* CREATE RULE */ T_NotifyStmt, T_ListenStmt, T_UnlistenStmt, T_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_RAW(i) && CONNECTION_SLOT(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), MAIN_CONNECTION(backend)->pid, MAIN_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. Called by ReadyForQuery(), assuming that the * ReadyForQuery packet kind has been already eaten by the caller and the * query in progress flag is set. At returning, the ReadyForQuery packet * length and the transaction state should be left in the backend buffers * EXCEPT for backends that do not satisfy VALID_BACKEND macro. This is * required because the caller later on calls pool_message_length() which * retrieves the packet length and the transaction state from the backends * that satisfy VALID_BACKEND macro. */ POOL_STATUS end_internal_transaction(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; int len; char tstate; pool_sigset_t oldmask; if (!REPLICATION) return POOL_CONTINUE; /* * 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 primary. */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND_RAW(i) && !IS_MAIN_NODE_ID(i) && INTERNAL_TRANSACTION_STARTED(backend, i)) { if (MAJOR(backend) == PROTO_MAJOR_V3 && VALID_BACKEND(i)) { /* * Skip rest of Ready for Query packet for backends * satisfying VALID_BACKEND macro because they should have * been already received the data, which is not good for * do_command(). */ 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), MAIN_CONNECTION(backend)->pid, MAIN_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; /* * Explicitly set the tx state to 'Idle'. This is necessary * because ReadyForQuery only takes care VALID_BACKEND. */ TSTATE(backend, i) = 'I'; if (MAJOR(backend) == PROTO_MAJOR_V3 && !VALID_BACKEND(i)) { /* * Skip rest of Ready for Query packet for the backend * that does not satisfy VALID_BACKEND. */ pool_read(CONNECTION(backend, i), &len, sizeof(len)); pool_read(CONNECTION(backend, i), &tstate, sizeof(tstate)); } } } /* Commit on main */ if (INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID)) { if (MAJOR(backend) == PROTO_MAJOR_V3 && VALID_BACKEND(MAIN_NODE_ID)) { /* * Skip rest of Ready for Query packet for backends * satisfying VALID_BACKEND macro because they should have * been already received the data, which is not good for * do_command(). */ pool_read(CONNECTION(backend, MAIN_NODE_ID), &len, sizeof(len)); pool_read(CONNECTION(backend, MAIN_NODE_ID), &tstate, sizeof(tstate)); } per_node_statement_log(backend, MAIN_NODE_ID, "COMMIT"); PG_TRY(); { if (do_command(frontend, MAIN(backend), "COMMIT", MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_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, MAIN_NODE_ID) = false; PG_RE_THROW(); } PG_END_TRY(); INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID) = false; /* * Explicitly set the tx state to 'Idle'. This is necessary * because ReadyForQuery only takes care VALID_BACKEND. */ TSTATE(backend, MAIN_NODE_ID) = 'I'; if (MAJOR(backend) == PROTO_MAJOR_V3 && !VALID_BACKEND(MAIN_NODE_ID)) { /* * Skip rest of Ready for Query packet for the backend * that does not satisfy VALID_BACKEND. */ pool_read(CONNECTION(backend, MAIN_NODE_ID), &len, sizeof(len)); pool_read(CONNECTION(backend, MAIN_NODE_ID), &tstate, sizeof(tstate)); } } } PG_CATCH(); { POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); POOL_SETMASK(&oldmask); pool_unset_failed_transaction(); return POOL_CONTINUE; } /* * Returns true if error message contains PANIC or FATAL. */ static bool is_panic_or_fatal_error(char *message, int major) { char *str; str = extract_error_kind(message, major); if (strncasecmp("PANIC", str, 5) == 0 || strncasecmp("FATAL", str, 5) == 0) return true; return false; } /* * Look for token in the given ERROR response message, and return the message * pointer in the message if 'V' or 'S' token found. * Other wise returns "unknown". */ char * extract_error_kind(char *message, int major) { char *ret = "unknown"; if (major == PROTO_MAJOR_V3) { for (;;) { char id; id = *message++; if (id == '\0') return ret; /* V is never localized. Only available 9.6 or later. */ if (id == 'V') return message; if (id == 'S') return message; else { while (*message++) ; continue; } } } else { if (strncmp(message, "PANIC", 5) == 0 || strncmp(message, "FATAL", 5) == 0) return message; } return ret; } 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_session_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; } int detect_idle_session_timeout_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, IDLE_SESSION_TIMEOUT_ERROR_CODE, major, 'E', true); if (r == SPECIFIED_ERROR) ereport(DEBUG1, (errmsg("detecting idle session timeout error"), errdetail("idle 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 message 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 response 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 cannot 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 \"%m\""))); } /* select timeout */ if (fds == 0) { backend->info->client_idle_duration++; if (*InRecovery == RECOVERY_INIT && pool_config->client_idle_limit > 0) { idle_count++; if (idle_count > pool_config->client_idle_limit) { ereport(FRONTEND_DEBUG, (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_DEBUG, (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_DEBUG, (pool_error_code("57000"), errmsg("connection terminated due to online recovery"), errdetail("child connection forced to terminate due to client_idle_limit:-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 occurred 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 conflict 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_session_timeout expired */ r = detect_idle_in_transaction_session_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 session timeout"))); } /* * connection was terminated due to idle_session_timeout expired */ r = detect_idle_session_timeout_error(CONNECTION(backend, i), MAJOR(backend)); if (r == SPECIFIED_ERROR) { ereport(FATAL, (pool_error_code(IDLE_SESSION_TIMEOUT_ERROR_CODE), errmsg("terminating connection due to idle session 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 if (pool_config->failover_on_backend_shutdown) { 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 occurred on frontend socket"))); else if (FD_ISSET(frontend->fd, &readmask)) { status = ProcessFrontendResponse(frontend, backend); if (status != POOL_CONTINUE) return status; } } if (FD_ISSET(MAIN(backend)->fd, &exceptmask)) ereport(FATAL, (errmsg("unable to read from backend socket"), errdetail("exception occurred on backend socket"))); else if (FD_ISSET(MAIN(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_MAIN_NODE_ID:%d pool_is_node_to_be_sent_in_current_query:%d my_backend_status:%d", RAW_MODE, REAL_MAIN_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 stack 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 returned from backend. * * The saved packets will be popped 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 primary 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); ereport(DEBUG1, (errmsg("pool_push_pending_data: num_pending_messages: %d", num_pending_messages))); 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); len -= sizeof(len); buf = NULL; if (len > 0) { 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.6.0/src/protocol/pool_connection_pool.c0000664000175000017500000006553314760007565017306 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 #include "pool.h" #include "context/pool_query_context.h" #include "utils/pool_stream.h" #include "utils/palloc.h" #include "pool_config.h" #include "utils/elog.h" #include "utils/memutils.h" #include "protocol/pool_connection_pool.h" #include "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "main/pool_internal_comms.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); #define TMINTMAX 0x7fffffff /* * 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 (MAIN_CONNECTION(connection_pool) && MAIN_CONNECTION(connection_pool)->sp && MAIN_CONNECTION(connection_pool)->sp->major == protoMajor && MAIN_CONNECTION(connection_pool)->sp->user != NULL && strcmp(MAIN_CONNECTION(connection_pool)->sp->user, user) == 0 && strcmp(MAIN_CONNECTION(connection_pool)->sp->database, database) == 0) { int sock_broken = 0; int j; /* mark this connection is under use */ MAIN_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"))); /* * It is possible that one of backend just broke. sleep 1 * second to wait for failover occurres, then wait for the * failover finishes. */ sleep(1); wait_for_failover_to_finish(); 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; int main_node_id; 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 (in_use_backend_id(p) < 0) /* is this connection pool out of use? */ { 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 = TMINTMAX; pool_index = 0; for (i = 0; i < pool_config->max_pool; i++) { main_node_id = in_use_backend_id(p); if (main_node_id < 0) elog(ERROR, "no in use backend found"); /* this should not happen */ ereport(DEBUG1, (errmsg("creating connection pool"), errdetail("user: %s database: %s closetime: %ld", CONNECTION_SLOT(p, main_node_id)->sp->user, CONNECTION_SLOT(p, main_node_id)->sp->database, CONNECTION_SLOT(p, main_node_id)->closetime))); if (CONNECTION_SLOT(p, main_node_id)->closetime < closetime) { closetime = CONNECTION_SLOT(p, main_node_id)->closetime; oldestp = p; pool_index = i; } p++; } p = oldestp; main_node_id = in_use_backend_id(p); if (main_node_id < 0) elog(ERROR, "no in use backend found"); /* this should not happen */ 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, CONNECTION_SLOT(p, main_node_id)->sp->user, CONNECTION_SLOT(p, main_node_id)->sp->database))); for (i = 0; i < NUM_BACKENDS; i++) { if (CONNECTION_SLOT(p, i) == NULL) 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 (!MAIN_CONNECTION(p)) continue; if (!MAIN_CONNECTION(p)->sp) continue; if (MAIN_CONNECTION(p)->sp->user == NULL) continue; if (p != backend && MAIN_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) { 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 (!MAIN_CONNECTION(p)) continue; if (!MAIN_CONNECTION(p)->sp) continue; if (MAIN_CONNECTION(p)->sp->user == NULL) continue; /* timer expire? */ if (MAIN_CONNECTION(p)->closetime) { int freed = 0; ereport(DEBUG1, (errmsg("backend timer handler called"), errdetail("expire time: %ld", MAIN_CONNECTION(p)->closetime + pool_config->connection_life_time))); if (now >= (MAIN_CONNECTION(p)->closetime + pool_config->connection_life_time)) { /* discard expired connection */ ereport(DEBUG1, (errmsg("backend timer handler called"), errdetail("expired user: \"%s\" database: \"%s\"", MAIN_CONNECTION(p)->sp->user, MAIN_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 (MAIN_CONNECTION(p)->closetime < nearest) nearest = MAIN_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); } update_pooled_connection_count(); 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 \"%m\""))); 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 \"%m\"", addr.sun_path))); return -1; } break; } return fd; } /* * Connect 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; socket_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\"", host, port), errdetail("%m"))); 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. * Richard 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", host, port), errdetail("%m"))); return false; } /* Non Solaris case */ if (error != 0) { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\", getsockopt() failed", host, port), errdetail("%m"))); 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 error \"%m\""))); } close(fd); return false; } } break; } socket_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"), errdetail("%m"))); 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"), errdetail("%m"))); 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"), errdetail("%m"))); 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; volatile BACKEND_STATUS status; 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. */ status = BACKEND_INFO(i).backend_status; if (status != CON_UP && 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]) = status; my_main_node_id = Req_info->main_node_id; 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 main_node_id is not updated, then update it */ if (Req_info->main_node_id == i) { int old_main = Req_info->main_node_id; Req_info->main_node_id = get_next_main_node(); ereport(LOG, (errmsg("main node %d is down. Update main node to %d", old_main, Req_info->main_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->info[i].client_idle_duration = 0; 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; } /* * 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. */ 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++) { int backend_id = in_use_backend_id(p); if (backend_id < 0) continue; if (CONNECTION_SLOT(p, backend_id) == NULL) continue; if (CONNECTION_SLOT(p, backend_id)->sp == NULL) continue; if (CONNECTION_SLOT(p, backend_id)->sp->user == NULL) continue; pool_send_frontend_exits(p); } POOL_SETMASK(&oldmask); } /* * Return number of established connections in the connection pool. * This is called when a client disconnects to pgpool. */ void update_pooled_connection_count(void) { int i; int count = 0; POOL_CONNECTION_POOL *p = pool_connection_pool; for (i = 0; i < pool_config->max_pool; i++, p++) { if (MAIN_CONNECTION(p)) count++; } pool_get_my_process_info()->pooled_connections = count; } /* * Return the first node id in use. * If no node is in use, return -1. */ int in_use_backend_id(POOL_CONNECTION_POOL *pool) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (pool->slots[i]) return i; } return -1; } pgpool-II-4.6.0/src/protocol/pool_proto_modules.c0000664000175000017500000042031314760007565017000 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "pool_config.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 "utils/ps_status.h" #include "utils/pool_signal.h" #include "utils/pool_ssl.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "query_cache/pool_memqcache.h" #include "main/pool_internal_comms.h" #include "pool_config_variables.h" #include "utils/psqlscan.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 POOL_STATUS send_prepare(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, POOL_SENT_MESSAGE * message); static int *find_victim_nodes(int *ntuples, int nmembers, int main_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); static void si_get_snapshot(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, Node *node, bool tstate_check); static bool check_transaction_state_and_abort(char *query, Node *node, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static bool multi_statement_query(char *buf); static void check_prepare(List *parse_tree_list, int len, char *contents); static POOL_QUERY_CONTEXT *create_dummy_query_context(void); /* * 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. * If frontend == NULL, we are called in case of reset queries. */ 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"; static char *sq_health_check_stats = "pool_health_check_stats"; static char *sq_backend_stats = "pool_backend_stats"; 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; bool use_minimal; /* * If query string is shorter than this, we do not run * multi_statement_query() to avoid its overhead. */ #define LENGTHY_QUERY_STRING 1024*10 /* 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)); /* * Check if extended query protocol message ended. If not, reject the * query and raise an error to terminate the session to avoid hanging up. * However if we are processing a reset query (frontend == NULL), we skip * the check as we don't want to raise a error. */ if (SL_MODE) { if (frontend != NULL && (pool_is_doing_extended_query_message() || pool_pending_message_head_message())) ereport(FATAL, (errmsg("simple query \"%s\" arrived before ending an extended query message", 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. * Also query cache is disabled, we should not fetch from query cache. */ if (pool_config->memory_cache_enabled && is_likely_select && !pool_is_writing_transaction() && TSTATE(backend, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) != 'E' && !query_cache_disabled()) { 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, false, &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); /* Is query string long? */ if (len > LENGTHY_QUERY_STRING) { /* * Check whether the query is multi statement or not. */ if (multi_statement_query(contents)) { elog(DEBUG5, "multi statement query found"); query_context->is_multi_statement = true; use_minimal = false; /* never use minimal parser */ } else { query_context->is_multi_statement = false; /* * Do not use minimal parser if we are in native replication or * snapshot isolation mode. */ if (REPLICATION) use_minimal = false; else use_minimal = true; } } else { use_minimal = false; } /* Parse SQL string */ parse_tree_list = raw_parser(contents, RAW_PARSE_DEFAULT, len, &error, use_minimal); if (len <= LENGTHY_QUERY_STRING) { /* we have not checked whether multi-statement query or not */ if (list_length(parse_tree_list) > 1) query_context->is_multi_statement = true; else query_context->is_multi_statement = false; } 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 * primary in native replication 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; } } if (query_context->is_multi_statement) { /* * Check parse tree list and if it includes PREPARE statement in the * second or subsequent parse tree, create "sent_message" entry so * that bind message can find them later on (PREPARE is usually * executed by EXECUTE, but it's possible that a client feels free to * use PREPARE then bind and execute messages). If PREPARE is in the * first parse tree, it will be processed subsequent code path. */ check_prepare(parse_tree_list, len, contents); } 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); /* * Check if the transaction is in abort status. If so, we do nothing * and just return an error message to frontend, execpt for * transaction COMMIT or ROLLBACK (TO) command. */ if (check_transaction_state_and_abort(contents, node, frontend, backend) == false) { pool_ps_idle_display(backend); pool_query_context_destroy(query_context); pool_set_skip_reading_from_backends(); return POOL_CONTINUE; } /* * 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 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, PgpoolQueryCacheStmt)) { VariableSetStmt *vnode = (VariableSetStmt *) node; if (query_cache_delete_by_stmt(vnode->name, backend)) elog(NOTICE, "query cache deleted. query: \"%s\"", vnode->name); else elog(NOTICE, "query cache does not exist for query: \"%s\"", vnode->name); pool_ps_idle_display(backend); send_complete_and_ready(frontend, backend, "SET", -1); 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); } else if (!strcmp(sq_health_check_stats, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("health check stats"))); show_health_check_stats(frontend, backend); } else if (!strcmp(sq_backend_stats, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("backend stats"))); show_backend_stats(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]); } } } } /* * If we are in SI mode, start an internal transaction if needed. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { start_internal_transaction(frontend, backend, node); } /* * From now on it is possible that query is actually sent to backend. * So we need to acquire snapshot while there's no committing backend * in snapshot isolation mode except while processing reset queries. * For this purpose, we send a query to know whether the transaction * is READ ONLY or not. Sending actual user's query is not possible * because it might cause rw-conflict, which in turn causes a * deadlock. */ si_get_snapshot(frontend, backend, node, !INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID)); /* * 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 */ close_idle_connections(); /* * 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) { /* * Take care of PREPARE/EXECUTE. */ POOL_SENT_MESSAGE *msg = NULL; if (IsA(node, PrepareStmt)) { msg = session_context->uncompleted_message; } else if (IsA(node, ExecuteStmt)) { /* * EXECUTE needs to refer to information of PREPARE. */ 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); else { /* * Take care the case when the previous PREPARE * message has been sent to other than primary node in * SL mode. In this case, we send a PREPARE message to * the primary node to keep up the * disable_load_balance_on_write rule. */ if (SL_MODE && pool_config->load_balance_mode && pool_is_writing_transaction() && TSTATE(backend, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) == 'T' && pool_config->disable_load_balance_on_write != DLBOW_OFF) { if (send_prepare(frontend, backend, msg) != POOL_CONTINUE) return POOL_END; } } } /* 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 streaming replication mode, we send BEGIN to standbys * instead. The original_query which is BEGIN READ WRITE is sent * to primary. The rewritten_query 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 main node's response, and could execute * the query concurrently. In snapshot isolation mode we cannot * do this optimization because we need to wait for main node's * response first. */ if (pool_config->num_init_children == 1 && pool_config->backend_clustering_mode != CM_SNAPSHOT_ISOLATION) { /* 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 main node */ pool_send_and_wait(query_context, 1, MAIN_NODE_ID); /* Check specific errors */ specific_error = check_errors(backend, MAIN_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) + 1; 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, MAIN_NODE_ID); } else { /* * If commit command and Snapshot Isolation mode, wait for until * snapshot prepared. */ if (commit && pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { si_commit_request(); } /* * Send the query to other than main node. */ pool_send_and_wait(query_context, -1, MAIN_NODE_ID); } /* * Send "COMMIT" or "ROLLBACK" to only main node if query is * "COMMIT" or "ROLLBACK" */ if (commit) { pool_send_and_wait(query_context, 1, MAIN_NODE_ID); /* * If we are in the snapshot isolation mode, we need to declare * that commit has been done. This would wake up other children * waiting for acquiring snapshot. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { si_commit_done(); session_context->transaction_read_only = false; } } } else { pool_send_and_wait(query_context, 1, MAIN_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; int num_rows; char *p; /* 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))); /* obtain number of returning rows */ p = contents + strlen(contents) + 1; memcpy(&num_rows, p, sizeof(num_rows)); 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; /* * If execute message's parameter is not 0, set partial_fetch flag to true * so that subsequent execute message knows that the portal started with * partial fetching. */ if (num_rows != 0) { query_context->partial_fetch = true; elog(DEBUG1, "set partial_fetch in execute"); } elog(DEBUG1, "execute: partial_fetch: %d", query_context->partial_fetch); 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID)))); /* log query to log file if necessary */ if (pool_config->log_statement) ereport(LOG, (errmsg("statement: %s", query))); /* * Fetch memory cache if possible. Also if atEnd is false or the execute * message has 0 row argument, we maybe able to use cache. * If partial_fetch is true, cannot use cache. */ if (pool_config->memory_cache_enabled && !pool_is_writing_transaction() && (TSTATE(backend, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) != 'E') && pool_is_likely_select(query) && !query_cache_disabled() && (query_context->atEnd || num_rows == 0) && !query_context->partial_fetch) { 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID)))); len = strlen(query) + 1; search_query = MemoryContextStrdup(query_context->memory_context, query); ereport(DEBUG1, (errmsg("Execute: checking 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. */ /* * If we are in streaming replication mode and use extended query * protocol, pass the information atEnd which represents whether all * rows in the portal has been already retrieved. If so, * pool_fetch_from_memory_cache will return "CommandComplete 0" cache. */ status = pool_fetch_from_memory_cache(frontend, backend, search_query, query_context->atEnd, &foundp); if (status != POOL_CONTINUE) return status; if (foundp) { #ifdef DEBUG extern bool stop_now; #endif 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; } /* show ps status */ query_ps_status(query, backend); 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 main node */ pool_extended_send_and_wait(query_context, "E", len, contents, 1, MAIN_NODE_ID, false); /* Check specific errors */ specific_error = check_errors(backend, MAIN_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, MAIN_NODE_ID, false); } else { /* * If commit command and Snapshot Isolation mode, wait for until * snapshot prepared. */ if (commit && pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { si_commit_request(); } pool_extended_send_and_wait(query_context, "E", len, contents, -1, MAIN_NODE_ID, false); } /* * send "COMMIT" or "ROLLBACK" to only main node if query is * "COMMIT" or "ROLLBACK" */ if (commit) { pool_extended_send_and_wait(query_context, "E", len, contents, 1, MAIN_NODE_ID, false); /* * If we are in the snapshot isolation mode, we need to declare * that commit has been done. This would wake up other children * waiting for acquiring snapshot. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { si_commit_done(); session_context->transaction_read_only = false; } } } else /* streaming replication mode */ { POOL_PENDING_MESSAGE *pmsg; if (!foundp) { pool_extended_send_and_wait(query_context, "E", len, contents, 1, MAIN_NODE_ID, true); pool_extended_send_and_wait(query_context, "E", len, contents, -1, MAIN_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); /* 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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, RAW_PARSE_DEFAULT, 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 * primary in native replication 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 * necessary. */ 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]); } } } } /* * If we are in SI mode, start an internal transaction if needed. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION) { start_internal_transaction(frontend, backend, node); } /* * Get snapshot if needed. */ si_get_snapshot(frontend, backend, node, !INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID)); /* * Decide where to send query */ pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE && strlen(name) != 0) pool_setall_node_to_be_sent(query_context); 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 main replica mode, we send * BEGIN instead of it to 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) && MAIN_REPLICA) { query_context->rewritten_query = pstrdup("BEGIN"); } } /* * If not in streaming or logical replication mode, send "SYNC" message if not in a transaction. */ if (!SL_MODE) { char kind; if (TSTATE(backend, MAIN_NODE_ID) != 'T') { int i; /* * Temporarily unset query in progress so that all live backend * are processed. */ pool_unset_query_in_progress(); /* 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') { /* * It is possible that parameter status message was sent from * backend. */ if (kind == 'S') { if (ParameterStatus(frontend, backend) != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to process parameter status message"))); /* expecting ready for query message */ kind = pool_read_kind(backend); if (kind != 'Z') ereport(ERROR, (errmsg("unable to parse the query"), errdetail("invalid read kind \"%c\" returned from backend after Sync message sent", kind))); } else ereport(ERROR, (errmsg("unable to parse the query"), errdetail("invalid read kind \"%c\" returned from backend after Sync message sent", 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 main node completing the query"))); pool_extended_send_and_wait(query_context, "P", len, contents, 1, MAIN_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 main node, pgpool send a error query to another nodes. */ deadlock_detected = detect_deadlock_error(MAIN(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, MAIN_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 main node"))); pool_send_and_wait(error_qc, -1, MAIN_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, MAIN_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(); pool_extended_send_and_wait(query_context, "P", len, contents, 1, MAIN_NODE_ID, true); pool_extended_send_and_wait(query_context, "P", len, contents, -1, MAIN_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_unset_query_in_progress(); } else { pool_extended_send_and_wait(query_context, "P", len, contents, 1, MAIN_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"))); } /* * Since now that fresh portal is created, we reset atEnd and * partial_fetch flag. */ query_context->atEnd = false; query_context->partial_fetch = false; /* * 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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; } if (pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE && TSTATE(backend, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) == 'T') { pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); } /* * 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 main node 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, MAIN_NODE_ID, nowait); pool_extended_send_and_wait(query_context, "B", len, contents, -1, MAIN_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); } 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); } query_context = NULL; if (msg) query_context = msg->query_context; else if (!msg && *contents == 'P') { /* * It is possible that client wants to use the portal created by * DECLARE CURSOR or pl/pgSQL function. If so, the describe message * should only be sent to primary node. */ query_context = create_dummy_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 main node completing the query"))); nowait = SL_MODE; pool_set_query_in_progress(); pool_extended_send_and_wait(query_context, "D", len, contents, 1, MAIN_NODE_ID, nowait); pool_extended_send_and_wait(query_context, "D", len, contents, -1, MAIN_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_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"))); /* * For 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 main node completing the query"))); pool_set_query_in_progress(); if (!SL_MODE) { pool_extended_send_and_wait(query_context, "C", len, contents, 1, MAIN_NODE_ID, false); pool_extended_send_and_wait(query_context, "C", len, contents, -1, MAIN_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 we do not send the bind message, 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, MAIN_NODE_ID, true); pool_extended_send_and_wait(query_context, "C", len, contents, -1, MAIN_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); 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)); } 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; victim_nodes = find_victim_nodes(session_context->ntuples, NUM_BACKENDS, MAIN_NODE_ID, &number_of_nodes); if (victim_nodes) { int i; StringInfoData msg; initStringInfo(&msg); appendStringInfoString(&msg, "ReadyForQuery: Degenerate backends:"); for (i = 0; i < number_of_nodes; i++) appendStringInfo(&msg, " %d", victim_nodes[i]); ereport(LOG, (errmsg("processing ready for query message"), errdetail("%s", msg.data))); pfree(msg.data); initStringInfo(&msg); appendStringInfoString(&msg, "ReadyForQuery: Number of affected tuples are:"); for (i = 0; i < NUM_BACKENDS; i++) appendStringInfo(&msg, " %d", session_context->ntuples[i]); ereport(LOG, (errmsg("processing ready for query message"), errdetail("%s", msg.data))); pfree(msg.data); 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 (REPLICATION && allow_close_transaction) { bool internal_transaction_started = INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID); /* * If we are running in snapshot isolation mode and started an * internal transaction, wait until snapshot is prepared. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION && internal_transaction_started) { si_commit_request(); } /* close an internal transaction */ if (internal_transaction_started) if (end_internal_transaction(frontend, backend) != POOL_CONTINUE) return POOL_END; /* * If we are running in snapshot isolation mode and started an * internal transaction, notice that commit is done. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION && internal_transaction_started) { si_commit_done(); /* reset transaction readonly flag */ session_context->transaction_read_only = false; } } 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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 of node %d '%c'(%02x)", i, kind , kind))); /* * The transaction state to be returned to frontend is main node's. */ if (i == (MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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[MAIN_NODE_ID] == POOL_EXECUTE_COMPLETE) { pool_handle_query_cache(backend, session_context->query_context->query_w_hex, node, state, false); 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, false); } } } /* * 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[MAIN_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 && (MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) != i) { per_node_statement_log(backend, i, "COMMIT"); if (do_command(frontend, CONNECTION(backend, i), "COMMIT", MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_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 message 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) { /* * Discard current temp query cache. This is necessary for the * case of clustering mode is not either streaming or logical * replication. Because in the cases the cache has been already * discarded upon receiving CommandComplete. */ pool_discard_current_temp_query_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(MAIN(backend), &len, sizeof(len)); len = ntohl(len); len -= sizeof(int32); len1 = len; /* number of parameters in rewritten query is just discarded */ pool_read(MAIN(backend), &num_dmy, sizeof(int16)); len -= sizeof(int16); p = pool_read2(MAIN(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_MAIN_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 main(%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); } 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') { /* * If data remains in the frontend write buffer, flush it * now. */ pool_flush(frontend); elog(DEBUG5, "pending data flushed to frontend due to a flush message"); pool_set_doing_extended_query_message(); pool_pending_message_set_flush_request(); } 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 forward 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 forward 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 */ if (pool_is_doing_extended_query_message()) { char *message; /* Log the error message which was possibly missed till * a sync message was sent */ if (pool_extract_error_message(false, MAIN(backend), PROTO_MAJOR_V3, true, &message) == 1) { ereport(LOG, (errmsg("Error message from backend: DB node id: %d message: \"%s\"", MAIN_NODE_ID, message))); pfree(message); } } /* Forward the error message to frontend */ status = ErrorResponse3(frontend, backend); pool_unset_command_success(); if (TSTATE(backend, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_NODE_ID) != 'I') { pool_set_failed_transaction(); /* Remove ongoing CREATE/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; } pool_get_session_context(false)->flush_pending = false; } 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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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; } /* * Flush (H) or Sync (S) messages should be ignored while in * the COPY IN mode. */ else if (kind == 'H' || kind == 'S') 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; } } } /* * Wait till backend responds */ if (copyin) { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_flush(CONNECTION(backend, i)); /* * Check response from the backend. First check SSL and read * buffer of the backend. It is possible that there's an error * message in the buffer if the COPY command went wrong. * Otherwise wait for data arrival to the backend socket. */ if (!pool_ssl_pending(CONNECTION(backend, i)) && pool_read_buffer_is_empty(CONNECTION(backend, i)) && 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 (MAIN_REPLICA && TSTATE(backend, PRIMARY_NODE_ID) == 'T' && PRIMARY_NODE_ID != MAIN_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_MAIN_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 main 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:main, S:replica) * * 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 MAIN * 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; static char *error_messages[] = { "received deadlock error message from main node. query: %s", "received serialization failure error message from main node. query: %s", "received SET TRANSACTION ISOLATION LEVEL must be called before any query error. query: %s", "received query cancel error message from main node. query: %s" }; StringInfoData msg; session_context = pool_get_session_context(true); if (!session_context) return; 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--; initStringInfo(&msg); appendStringInfoString(&msg, error_messages[specific_error]); ereport(LOG, (errmsg(msg.data, query))); pfree(msg.data); } /* * 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))); } /* * Make per DB node statement notice message */ void per_node_statement_notice(POOL_CONNECTION_POOL * backend, int node_id, char *query) { if (pool_config->notice_per_node_statement) ereport(NOTICE, (errmsg("DB node id: %d statement: %s", node_id, query))); } /* * Make backend message log when log_backend_messages is on. */ void log_backend_messages(unsigned char kind, int backend_id) { /* * Map table for message kind and message label */ typedef struct { unsigned char kind; /* message kind */ char *label; /* message label */ } BackendMessage; static BackendMessage message_label[] = { {'1', "ParseComplete"}, {'2', "BindComplete"}, {'3', "CloseComplete"}, {'A', "NotificationResponse"}, {'C', "CommandComplete"}, {'D', "DataRow"}, {'E', "ErrorResponse"}, {'G', "CopyInResponse"}, {'H', "CopyOutResponse"}, {'I', "EmptyQueryResponse"}, {'K', "BackendKeyData"}, {'N', "NoticeResponse"}, {'R', "AuthenticationRequest"}, {'S', "ParameterStatus"}, {'T', "RowDescription"}, {'V', "FunctionCallResponse"}, {'W', "CopyBothResponse"}, {'Z', "ReadyForQuery"}, {'n', "NoData"}, {'s', "PortalSuspended"}, {'t', "ParameterDescription"}, {'v', "NegotiateProtocolVersion"}, {'c', "CopyDone"}, {'d', "CopyData"}, }; /* store last kind for each backend */ static unsigned char kind_cache[MAX_NUM_BACKENDS]; /* number of repetitions of each kind */ static int kind_count[MAX_NUM_BACKENDS]; int kind_num = sizeof(message_label)/sizeof(BackendMessage); char *label; static char *last_label; int i; /* do nothing if log_backend_messages is disabled */ if (pool_config->log_backend_messages == BGMSG_NONE) return; /* check backend_id */ if (backend_id < 0) { elog(WARNING, "log_backend_messages: invalid backend_id: %d", backend_id); return; } label = NULL; /* search matched message label */ for (i = 0; i < kind_num; i++) { if (kind == message_label[i].kind) { label = message_label[i].label; break; } } if (label == NULL) { elog(WARNING, "log_backend_messages: no label found for kind \"%c\" from backend_id: %d", kind, backend_id); return; } /* is the setting verbose? */ if (pool_config->log_backend_messages == BGMSG_VERBOSE) { /* log everything unconditionally */ ereport(LOG, (errmsg("%s message from backend %d", label, backend_id))); return; } /* just to make sure the setting is terse */ if (pool_config->log_backend_messages != BGMSG_TERSE) { elog(ERROR, "unexpected log_backend_messages option: %d", pool_config->log_backend_messages); return; } /* * From now on We can assume that log_backend_messages is set to terse */ /* same kind as before? */ if (kind != kind_cache[backend_id]) { /* is the kind new? */ if (kind_count[backend_id] == 0) { /* this is new kind. save the label */ last_label = label; } else { /* same kind was repeated */ ereport(LOG, (errmsg("last %s message from backend %d repeated %d times", last_label, backend_id, kind_count[backend_id]))); kind_count[backend_id] = 0; } ereport(LOG, (errmsg("%s message from backend %d", label, backend_id))); /* save kind for this backend */ kind_cache[backend_id] = kind; } else /* same kind is repeated */ kind_count[backend_id]++; } /* * Check kind and produce error message. * Return message kind. * All data read in this function is returned to stream. */ char 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 kind; } 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); } return kind; } /* * Send parse message to primary/main node and wait for reply if particular * message is not yet parsed on the primary/main 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_main_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 * happen if parse_before_bind is called with a bind message * using the 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))); /* named statement? */ 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); } /* 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); /* 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 main 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; } /* * Send PREPARE message to primary node and wait for reply if particular * message is not yet PREPAREd on the primary node but PREPAREd on other * node. Caller must provide the PREPARED message information as "message" * argument. */ static POOL_STATUS send_prepare(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, POOL_SENT_MESSAGE * message) { int node_id; bool backup[MAX_NUM_BACKENDS]; POOL_QUERY_CONTEXT *qc, *new_qc; char qbuf[1024]; POOL_SELECT_RESULT *res; elog(DEBUG1, "send_prepare called"); if (!SL_MODE) { elog(DEBUG1, "send_prepare: not SL_MODE"); return POOL_CONTINUE; } /* set target backend node id */ node_id = PRIMARY_NODE_ID; /* create copy of where_to_send map */ qc = message->query_context; memcpy(backup, qc->where_to_send, sizeof(qc->where_to_send)); if (message->kind != 'Q' || qc->where_to_send[node_id]) { ereport(DEBUG1, (errmsg("send_prepare"), errdetail("no need to re-send PREPARE kind: %c where_to_send: %d", message->kind, qc->where_to_send[node_id]))); return POOL_CONTINUE; } /* * we are in streaming replication mode and the PREPARE message has * not been sent to primary yet. */ /* * Prepare modified query context This is a copy of original PREPARE * query context except the query sending destination is changed to * primary node. */ 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[node_id] = 1; new_qc->virtual_main_node_id = node_id; new_qc->load_balance_node_id = node_id; /* named statement? */ if (message->name[0] != '\0') { /* * Before sending the PREPARE message to the primary, we need to * DEALLOCATE the named statement. Otherwise we will get an error * from backend if an identical named statement already exists. */ /* check to see if the named statement exists on primary node */ snprintf(qbuf, sizeof(qbuf), "SELECT count(*) FROM pg_prepared_statements WHERE name = '%s'", message->name); elog(DEBUG1, "send_prepare: %s to backend: %d", qbuf, node_id); do_query(CONNECTION(backend, node_id), qbuf, &res, MAJOR(backend)); if (res && res->data[0] && strcmp(res->data[0], "0")) { free_select_result(res); /* * The same named statement exists, We need to send DEALLOCATE * message */ snprintf(qbuf, sizeof(qbuf), "DEALLOCATE %s", message->name); /* send DEALLOCATE message to primary node */ elog(DEBUG1, "send_prepare: %s to backend: %d", qbuf, node_id); do_query(CONNECTION(backend, node_id), qbuf, &res, MAJOR(backend)); } free_select_result(res); } /* send PREPARE message to primary node */ elog(DEBUG1, "send_prepare: sending PREPARE to primary node"); do_query(CONNECTION(backend, node_id), message->query_context->original_query, &res, MAJOR(backend)); free_select_result(res); /* replace the query context of PREPARE message with new query context */ message->query_context = new_qc; /* * Replace query contex in the session context with the new query context * so that subsequent EXECUTE will be sent to primary node. */ pool_get_session_context(true)->query_context = new_qc; /* recover where_to_send map */ 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. * main_node: The main 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 main_node >= 0, winner would be the * main and other nodes who has same number of tuples as the main. * * 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 main_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) { /* Main node is specified? */ if (main_node < 0) return NULL; /* * If main node is specified, let it and others who has same ntuples * win. */ majority_ntuples = ntuples[main_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 */ /* Main node is specified? */ if (main_node < 0) return NULL; /* * If main node is specified, let it and others who has same * ntuples win. */ majority_ntuples = ntuples[main_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 already 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); 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 except "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, MAIN_REPLICA ? PRIMARY_NODE_ID : REAL_MAIN_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(); } } } /* * read message length (V3 only) */ int pool_read_message_length(POOL_CONNECTION_POOL * cp) { int length, length0; int i; /* read message from main node */ pool_read(CONNECTION(cp, MAIN_NODE_ID), &length0, sizeof(length0)); length0 = ntohl(length0); ereport(DEBUG5, (errmsg("reading message length"), errdetail("slot: %d length: %d", MAIN_NODE_ID, length0))); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i) || IS_MAIN_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 main node */ pool_read(CONNECTION(cp, MAIN_NODE_ID), &length0, sizeof(length0)); length0 = ntohl(length0); length_array[MAIN_NODE_ID] = length0; ereport(DEBUG5, (errmsg("reading message length"), errdetail("main slot: %d length: %d", MAIN_NODE_ID, length0))); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MAIN_NODE_ID(i)) { pool_read(CONNECTION(cp, i), &length, sizeof(length)); length = ntohl(length); ereport(DEBUG5, (errmsg("reading message length"), errdetail("main slot: %d length: %d", i, length))); if (length != length0) { ereport(DEBUG1, (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]; } /* * By given message length array, emit log message to complain the difference. * If no difference, no log is emitted. * If "name" is not NULL, it is added to the log message. */ void pool_emit_log_for_message_length_diff(int *length_array, char *name) { int length0, /* message length of main node id */ length; int i; length0 = length_array[MAIN_NODE_ID]; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { length = length_array[i]; if (length != length0) { if (name != NULL) ereport(LOG, (errmsg("ParameterStatus \"%s\": node %d message length %d is different from main node message length %d", name, i, length_array[i], length0))); else ereport(LOG, (errmsg("node %d message length %d is different from main node message length %d", i, length_array[i], length0))); } } } } /* * Read kind from all valid backend */ 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)); log_backend_messages(kind, i); if (IS_MAIN_NODE_ID(i)) { kind0 = kind; } else { if (kind != kind0) { char *message; if (kind0 == 'E') { if (pool_extract_error_message(false, MAIN(cp), MAJOR(cp), true, &message) == 1) { ereport(LOG, (errmsg("pool_read_kind: error message from main 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 main(%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_MAIN_NODE_ID(i)) { data0 = data; } else { if (data != data0) { ereport(ERROR, (errmsg("unable to read int value"), errdetail("data does not match between between main(%x) slot[%d] (%x)", data0, i, data))); } } } return data; } /* * Acquire snapshot in snapshot isolation mode. * If tstate_check is true, check the transaction state is 'T' (idle in transaction). * In case of starting an internal transaction, this should be false. */ static void si_get_snapshot(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, Node * node, bool tstate_check) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(true); if (!session_context) return; /* * From now on it is possible that query is actually sent to backend. * So we need to acquire snapshot while there's no committing backend * in snapshot isolation mode except while processing reset queries. * For this purpose, we send a query to know whether the transaction * is READ ONLY or not. Sending actual user's query is not possible * because it might cause rw-conflict, which in turn causes a * deadlock. */ if (pool_config->backend_clustering_mode == CM_SNAPSHOT_ISOLATION && (!tstate_check || (tstate_check && TSTATE(backend, MAIN_NODE_ID) == 'T')) && si_snapshot_acquire_command(node) && !si_snapshot_prepared() && frontend && frontend->no_forward == 0) { int i; si_acquire_snapshot(); for (i = 0; i < NUM_BACKENDS; i++) { static char *si_query = "SELECT current_setting('transaction_read_only')"; POOL_SELECT_RESULT *res; /* We cannot use VALID_BACKEND macro here because load balance * node has not been decided yet. */ if (!VALID_BACKEND_RAW(i)) continue; do_query(CONNECTION(backend, i), si_query, &res, MAJOR(backend)); if (res) { if (res->data[0] && !strcmp(res->data[0], "on")) session_context->transaction_read_only = true; else session_context->transaction_read_only = false; free_select_result(res); } per_node_statement_log(backend, i, si_query); } si_snapshot_acquired(); } } /* * Check if the transaction is in abort status. If so, we do nothing and just * return error message and ready for query message to frontend, then return * false to caller. */ static bool check_transaction_state_and_abort(char *query, Node *node, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int len; if (TSTATE(backend, MAIN_NODE_ID) != 'E') return true; /* * Are we in failed transaction and the command is not a transaction close * command? */ if (pool_is_failed_transaction() && !is_commit_or_rollback_query(node)) { StringInfoData buf; initStringInfo(&buf); appendStringInfo(&buf, "statement: %s", query); /* send an error message to frontend */ pool_send_error_message( frontend, MAJOR(backend), "25P02", "current transaction is aborted, commands ignored until end of transaction block", buf.data, "", __FILE__, __LINE__); pfree(buf.data); /* send ready for query to frontend */ pool_write(frontend, "Z", 1); len = 5; len = htonl(len); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, "E", 1); pool_flush(frontend); return false; } return true; } /* * Return true if query in buf is multi statement query. * We import PostgreSQL's psqlscan() for the purpose. * As far as I know this is the most accurate and cheap way. */ static bool multi_statement_query(char *queries) { PsqlScanState sstate; promptStatus_t prompt; PsqlScanResult sr; PQExpBufferData lbuf; int num_semicolons = 0; bool done = false; /* * callback functions for our flex lexer. need this to prevent crash when * psqlscan tries to parse psql variable statements (:variable). */ const PsqlScanCallbacks psqlscan_callbacks = { NULL }; initPQExpBuffer(&lbuf); /* initialize line buffer */ sstate = psql_scan_create(&psqlscan_callbacks); /* create scan state */ /* add the query string to the scan state */ psql_scan_setup(sstate, queries, strlen(queries), 0, true); for (;;) { resetPQExpBuffer(&lbuf); sr = psql_scan(sstate, &lbuf, &prompt); /* run scanner */ switch(sr) { case PSCAN_SEMICOLON: /* found command-ending semicolon */ num_semicolons++; break; case PSCAN_BACKSLASH: /* found backslash command */ break; case PSCAN_INCOMPLETE: /* end of line, SQL statement incomplete */ case PSCAN_EOL: /* end of line, SQL possibly complete */ /* * If we have already seen ";" and this time something is * transferred into buffer, we assume that the last query is * not terminated by ";". We should treat this as a multi * statement query. So we count up the semicolon counter. */ if (num_semicolons > 0 && lbuf.len > 0) { num_semicolons++; } done = true; break; default: break; } if (done) break; } /* we are done */ termPQExpBuffer(&lbuf); psql_scan_finish(sstate); psql_scan_destroy(sstate); return num_semicolons > 1; } /* * Check given parse tree list and if it is a multi statement and includes * PREPARE statement in the second or subsequent parse tree, create * "sent_message" entry so that bind message can find them later on. * parse_tree_list: raw parse tree list (list of RawStmt) * len: full query string length * contents: full query string */ static void check_prepare(List *parse_tree_list, int len, char *contents) { Node *node; RawStmt *rstmt; POOL_QUERY_CONTEXT *query_context; ListCell *l; POOL_SENT_MESSAGE *message; /* sanity check */ if (list_length(parse_tree_list) <= 1) return; foreach (l, parse_tree_list) { if (l == list_head(parse_tree_list)) /* skip the first parse tree */ continue; rstmt = (RawStmt *) lfirst(l); node = (Node *) rstmt->stmt; /* pick one parse tree */ if (!IsA(node, PrepareStmt)) /* PREPARE? */ continue; query_context = pool_init_query_context(); /* initialize query context */ query_context->is_multi_statement = true; /* this is a multi statement query */ pool_start_query(query_context, contents, len, node); /* start query context */ pool_where_to_send(query_context, query_context->original_query, /* set query destination */ query_context->parse_tree); message = pool_create_sent_message('Q', len, contents, 0, /* create sent message */ ((PrepareStmt *) node)->name, query_context); pool_add_sent_message(message); /* add it to the sent message list */ } } /* * Create a dummy query context using get_dummy_insert_query_node(). The * query destination is also set. As a side effect, query in progress flag is * set. */ static POOL_QUERY_CONTEXT *create_dummy_query_context(void) { POOL_QUERY_CONTEXT *query_context; Node *node; MemoryContext old_context; char *query = "UNKNOWN QUERY"; query_context = pool_init_query_context(); old_context = MemoryContextSwitchTo(query_context->memory_context); node = get_dummy_insert_query_node(); pool_start_query(query_context, query, strlen(query), node); pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); MemoryContextSwitchTo(old_context); return query_context; } pgpool-II-4.6.0/src/protocol/CommandComplete.c0000664000175000017500000004536414760007565016134 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "protocol/pool_process_query.h" #include "parser/pg_config_manual.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 forward_command_complete(POOL_CONNECTION * frontend, char *packet, int packetlen); static int forward_empty_query(POOL_CONNECTION * frontend, char *packet, int packetlen); static int forward_packet_to_frontend(POOL_CONNECTION * frontend, char kind, char *packet, int packetlen); static void process_clear_cache(POOL_CONNECTION_POOL * backend); static bool check_alter_role_statement(AlterRoleStmt *stmt); 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 necessary 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 main node. */ else { con = MAIN(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); } /* * Check if a transaction start command was issued by a multi statement * query by looking at the command tag. We cannot look into the parse tree * because our parse tree is only the first query in the multi statement. */ if (SL_MODE && session_context->query_context && session_context->query_context->is_multi_statement) { if (!strcmp(p1, "BEGIN")) { /* * If the query was a transaction starting command, remember it * until it gets committed or roll backed. */ elog(DEBUG1, "Call set_tx_started_by_multi_statement_query() in CommandComplete"); set_tx_started_by_multi_statement_query(); } else if (!strcmp(p1, "COMMIT") || !strcmp(p1, "ROLLBACK")) { /* * It is possible that the multi statement query included both * BEGIN and COMMIT/ROLLBACK, or just COMMIT/ROLLBACK command. In * this case we forget that a transaction was started by multi * statement query. */ elog(DEBUG1, "Call unset_tx_started_by_multi_statement_query() in CommandComplete"); unset_tx_started_by_multi_statement_query(); } } /* * 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 = forward_command_complete(frontend, p1, len1); else status = forward_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 doing extended query, register the SELECT result to temp * query cache now. */ if (pool_is_doing_extended_query_message()) { char *query; Node *node; char state; if (session_context->query_context == NULL) { elog(WARNING, "expected query_contex is NULL"); return POOL_END; } query = session_context->query_context->query_w_hex; node = pool_get_parse_tree(); state = TSTATE(backend, MAIN_NODE_ID); /* * If some rows have been fetched by an execute with non 0 row option, * we do not create cache. */ pool_handle_query_cache(backend, query, node, state, session_context->query_context->partial_fetch); /* * CommandComplete guarantees that all rows have been fetched. We * can unconditionally set atEnd flag. */ session_context->query_context->atEnd = true; } } 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 previous 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 necessary 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 CREATE/DROP temp table status */ pool_temp_tables_commit_pending(); /* Forget a transaction was started by multi statement query */ unset_tx_started_by_multi_statement_query(); /* * Query cache enabled and REVOKE was issued in this transaction? */ if (pool_config->memory_cache_enabled && query_cache_disabled_tx()) { /* * Clear all the query cache. */ clear_query_cache(); /* Unset query cache disabled in this transaction */ unset_query_cache_disabled_tx(); } } else if (stmt->kind == TRANS_STMT_ROLLBACK) { /* Remove ongoing CREATE/DROP temp table status */ pool_temp_tables_remove_pending(); /* Forget a transaction was started by multi statement query */ unset_tx_started_by_multi_statement_query(); /* Unset query cache disabled in this transaction */ unset_query_cache_disabled_tx(); } } 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, MAIN_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, MAIN_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); if (!session_context->temp_tables) return; next = lnext(session_context->temp_tables, cell); } } } else if (IsA(node, VariableSetStmt)) { VariableSetStmt *stmt = (VariableSetStmt *) node; /* SET ROLE or SESSION AUTHORIZATION command? */ if (stmt->kind == VAR_SET_VALUE && (!strcmp(stmt->name, "role") || !strcmp(stmt->name, "session_authorization"))) /* disable query cache in this session */ set_query_cache_disabled(); } else if (IsA(node, GrantStmt)) { GrantStmt *stmt = (GrantStmt *) node; /* REVOKE? */ if (stmt->is_grant) return; /* Clear query cache */ process_clear_cache(backend); } else if (IsA(node, AlterTableStmt) || IsA(node, AlterDatabaseStmt) || IsA(node, AlterDatabaseSetStmt)) { /* Clear query cache */ process_clear_cache(backend); } else if (IsA(node, AlterRoleStmt)) { if (check_alter_role_statement(castNode(AlterRoleStmt, node))) { /* Clear query cache */ process_clear_cache(backend); } } } /* * Check whether the ALTER ROLE statement needs query cache invalidation. * stmt must be AlterRoleStmt. */ static bool check_alter_role_statement(AlterRoleStmt *stmt) { ListCell *l; foreach(l, stmt->options) { DefElem *elm = (DefElem *) lfirst(l); /* * We want to detect other than ALTER ROLE foo WITH PASSWORD or * WITH CONNECTION LIMIT case. It does not change any privilege of the * role. */ if (strcmp(elm->defname, "password") && strcmp(elm->defname, "connectionlimit")) return true; } return false; } /* * 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 main node. */ session_context->ntuples[MAIN_NODE_ID] = rows; for (i = 0; i < NUM_BACKENDS; i++) { if (!IS_MAIN_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 main(%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) { StringInfoData msg; initStringInfo(&msg); appendStringInfoString(&msg, "pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: \""); appendStringInfoString(&msg, query_string_buffer); appendStringInfoString(&msg, "\""); pool_send_error_message(frontend, MAJOR(backend), "XX001", msg.data, "", "check data consistency between main and other db node", __FILE__, __LINE__); ereport(LOG, (errmsg("%s", msg.data))); pfree(msg.data); initStringInfo(&msg); appendStringInfoString(&msg, "CommandComplete: Number of affected tuples are:"); for (i = 0; i < NUM_BACKENDS; i++) appendStringInfo(&msg, " %d", session_context->ntuples[i]); ereport(LOG, (errmsg("processing command complete"), errdetail("%s", msg.data))); pfree(msg.data); } else { if (command_complete) { if (forward_command_complete(frontend, packet, packetlen) < 0) return POOL_END; } else { if (forward_empty_query(frontend, packet, packetlen) < 0) return POOL_END; } } return POOL_CONTINUE; } /* * Forward Command complete packet to frontend */ static int forward_command_complete(POOL_CONNECTION * frontend, char *packet, int packetlen) { return forward_packet_to_frontend(frontend, 'C', packet, packetlen); } /* * Forward Empty query response to frontend */ static int forward_empty_query(POOL_CONNECTION * frontend, char *packet, int packetlen) { return forward_packet_to_frontend(frontend, 'I', packet, packetlen); } /* * Forward packet to frontend */ static int forward_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; } /* * Process statements that need clearing query cache */ static void process_clear_cache(POOL_CONNECTION_POOL * backend) { /* Query cache enabled? */ if (!pool_config->memory_cache_enabled) return; /* Streaming replication mode? */ if (SL_MODE) { /* * Are we inside a transaction? */ if (TSTATE(backend, MAIN_NODE_ID ) == 'T') { /* * Disable query cache in this transaction. * All query cache will be cleared at commit. */ set_query_cache_disabled_tx(); } else if (TSTATE(backend, MAIN_NODE_ID ) == 'I') /* outside transaction */ { /* * Clear all the query cache. */ clear_query_cache(); } } else { /* * Are we inside a transaction? */ if (TSTATE(backend, MAIN_NODE_ID ) == 'T') { /* Inside user started transaction? */ if (!INTERNAL_TRANSACTION_STARTED(backend, MAIN_NODE_ID)) { /* * Disable query cache in this transaction. * All query cache will be cleared at commit. */ set_query_cache_disabled_tx(); } else { /* * Clear all the query cache. */ clear_query_cache(); } } else if (TSTATE(backend, MAIN_NODE_ID ) == 'I') /* outside transaction */ { /* * Clear all the query cache. */ clear_query_cache(); } } } pgpool-II-4.6.0/src/query_cache/0000775000175000017500000000000014760010070013375 500000000000000pgpool-II-4.6.0/src/query_cache/pool_memqcache.c0000664000175000017500000034056614760007565016472 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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_catalog.pg_database WHERE datname = '%s'" #include "pool.h" #include #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 "protocol/pool_process_query.h" #include "parser/parsenodes.h" #include "context/pool_session_context.h" #include "query_cache/pool_memqcache.h" #include "utils/pool_ssl.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" #include "utils/pool_ipc.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); #ifdef USE_MEMCACHED static int delete_all_cache_on_memcached(void); #endif static char *create_fake_cache(size_t *len); /* * 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("committing 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("committing SELECT results to cache storage"), errdetail("search key : \"%s\"", tmpkey))); memcpy(cachekey.hashkey, tmpkey, 32); memqcache_expire = pool_config->memqcache_expire; ereport(DEBUG1, (errmsg("committing 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("committing 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("committing 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("committing 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("committing 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("committing relation cache to cache storage"), errdetail("search key : \"%s\"", tmpkey))); memcpy(cachekey.hashkey, tmpkey, 32); memqcache_expire = pool_config->relcache_expire; ereport(DEBUG1, (errmsg("committing 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("committing 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("committing 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("committing 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: deleting 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. * * If use_fake_cache is true, make up "CommandComplete 0" result and use it. */ POOL_STATUS pool_fetch_from_memory_cache(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *contents, bool use_fake_cache, bool *foundp) { char *qcache; size_t qcachelen; volatile int sts; pool_sigset_t oldmask; ereport(DEBUG1, (errmsg("pool_fetch_from_memory_cache called"))); *foundp = false; POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(POOL_MEMQ_SHARED_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); /* * If use_fake_cache is true, make up "CommandComplete (0)" response. */ if (use_fake_cache) { pfree(qcache); qcache = create_fake_cache(&qcachelen); elog(DEBUG2, "fake_cach: len: %ld", qcachelen); } 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 = MAIN(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; } /* * Make up response packet for "CommandComplete (SELECT 0)" message. */ static char * create_fake_cache(size_t *len) { char *qcache, *p; int32 mlen; /* message length including self */ static char* msg = "SELECT 0"; *len = sizeof(char) + /* message kind */ sizeof(int32) + /* packet length including self */ sizeof(msg); /* Command Complete message with 0 row returned */ mlen = *len - 1; /* message length does not include message kind */ mlen = htonl(mlen); p = qcache = palloc(*len); *p++ = 'C'; memcpy(p, &mlen, sizeof(mlen)); p += sizeof(mlen); strncpy(p, msg, strlen(msg) + 1); return qcache; } /* * 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 FORCE QUERY CACHE comment exists, cache it unconditionally. */ if (!strncasecmp(query, FORCE_QUERY_CACHE, FORCE_QUERY_CACHE_COMMENT_SZ)) return true; /* * If NO QUERY CACHE comment exists, do not cache unconditionally. */ if (!strncasecmp(query, NO_QUERY_CACHE, NO_QUERY_CACHE_COMMENT_SZ)) return false; /* * Check cache unsafe table list first. */ if (pool_config->num_cache_unsafe_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_unsafe_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 SELECT uses row security enabled tables, it's not allowed to cache. */ if (pool_has_row_security(node)) return false; /* * If the table is in the cache_safe_memqcache_table_list, allow to cache * even if it is VIEW or unlogged table. */ if (pool_config->num_cache_safe_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_safe_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_unsafe_list(const char *table_name) { if (pool_config->num_cache_unsafe_memqcache_table_list > 0 && pattern_compare((char *) table_name, WRITELIST, "cache_unsafe_memqcache_table_list") == 1) { return true; } return false; } /* * Return true If the SELECTed table is in cache_safe list. */ bool pool_is_table_in_safe_list(const char *table_name) { if (pool_config->num_cache_safe_memqcache_table_list > 0 && pattern_compare((char *) table_name, READONLYLIST, "cache_safe_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: statement 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; } /* * Extract table oids contained in memqcache_oiddir by database oid. */ 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; path = psprintf("%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))); pfree(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); pfree(path); return 0; } rtn = tmp; } rtn[num_oids] = atol(dp->d_name); num_oids++; } pfree(path); 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, MAIN_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; POOL_CONNECTION_POOL *backend; backend = pool_get_session_context(false)->backend; query = psprintf(DATABASE_TO_OID_QUERY, dbname); do_query(MAIN(backend), query, &res, MAJOR(backend)); pfree(query); 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; 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\"", dir), errdetail("%m"))); 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; } path = psprintf("%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\"", path), errdetail("%m"))); pfree(path); return; } } pfree(path); 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 */ path = psprintf("%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\"", path), errdetail("%m"))); pfree(path); 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\"", path), errdetail("%m"))); close(fd); pfree(path); 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\"", path), errdetail("%m"))); 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\"", path), errdetail("%m"))); close(fd); pfree(path); 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\"", path), errdetail("%m"))); close(fd); pfree(path); return; } close(fd); pfree(path); } } /* * Discard all oid maps at Pgpool-II startup. * This is necessary for shmem case. */ void pool_discard_oid_maps(void) { char *command; command = psprintf("/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 \"%m\""))); pfree(command); } /* * Discard all oid maps contained in database specified by dboid. */ void pool_discard_oid_maps_by_db(int dboid) { char *command; if (pool_is_shmem_cache()) { command = psprintf("/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 \"%m\""))); pfree(command); } } /* * 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; 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\"", dir), errdetail("%m"))); 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; } } path = psprintf("%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\"", path), errdetail("%m"))); pfree(path); return; } } pfree(path); 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 */ path = psprintf("%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:\"%m\"", path))); pfree(path); 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\"", path), errdetail("%m"))); close(fd); pfree(path); return; } for (;;) { sts = read(fd, (char *) &buf, len); if (sts == -1) { ereport(WARNING, (errmsg("memcache: invalidating query cache, failed to read file:\"%s\"", path), errdetail("%m"))); close(fd); pfree(path); 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); pfree(path); return; } break; } if (unlinkp) { unlink(path); } pfree(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 strcmp and to save a few cycle. */ bool pool_is_shmem_cache(void) { return pool_config->memqcache_method == SHMEM_CACHE; } /* * 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; elog(DEBUG1, "shared_memory_cache_size: %zu", size); 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_segment_get_chunk(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_shmem_lock(POOL_MEMQ_EXCLUSIVE_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); pool_init_whole_cache_blocks(); } PG_CATCH(); { pool_shmem_unlock(); PG_RE_THROW(); } PG_END_TRY(); pool_shmem_unlock(); } #ifdef USE_MEMCACHED /* * delete all query cache on memcached */ static int delete_all_cache_on_memcached(void) { memcached_return rc; rc = memcached_flush(memc, 0); /* delete all cache on memcached */ if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_BUFFERED) { ereport(LOG, (errmsg("failed to delete all cache on memcached, error:\"%s\"", memcached_strerror(memc, rc)))); return 0; } return 1; } #endif /* * Clear query cache on shmem or memcached */ void clear_query_cache(void) { /* * Clear all the shared memory cache and oid maps. */ if (pool_is_shmem_cache()) { pool_clear_memory_cache(); ereport(LOG, (errmsg("all query cache in shared memory deleted"))); } else #ifdef USE_MEMCACHED { /* * Clear all the memcached cache and oid maps. */ delete_all_cache_on_memcached(); pool_discard_oid_maps(); ereport(LOG, (errmsg("all query cache in memcached deleted"))); } #else { ereport(WARNING, (errmsg("failed to clear cache on memcached, memcached support is not enabled"))); } #endif } /* * Return shared memory cache address */ static void * pool_memory_cache_address(void) { return shmem; } /* * Initialize whole cache blocks */ void pool_init_whole_cache_blocks(void) { int blocks = pool_get_memqcache_blocks(); int i; for (i = 0; i < blocks; i++) { pool_init_cache_block(i); } } /* * 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); elog(DEBUG1, "shared_memory_fsmm_size: %zu", size); 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_segment_get_chunk(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_segment_get_chunk(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. * XXX actually this is not a clock algorithm because it does not have "reference" bit. * It's like a simple FIFO. * See https://en.wikipedia.org/wiki/Page_replacement_algorithm#Clock for more details. * It would be nice if we could use true clock algorithm someday. */ 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); /* Remove all items in this block from hash table */ 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 not 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(); } /* 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 (difftime(now, cih->timestamp) > cih->expire) { /* * We need to acquire an exclusive lock before removing the cache * entry. Since a lock escalation from shared lock to exclusive * lock is not supported, we need to release the lock then acquire * an exclusive lock. */ pool_shmem_unlock(); pool_shmem_lock(POOL_MEMQ_EXCLUSIVE_LOCK); /* * There is a window between pool_shmem_unlock() and * pool_shmem_lock(). We need to get POOL_CACHEID and * POOL_CACHE_ITEM_HEADER again because they could have been * modified by someone else. */ c = pool_hash_search(query_hash); if (!c) { return NULL; } cih = item_header(block_address(c->blockid), c->itemid); 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 the 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 #undef LOCK_TRACE static int memq_lock_fd = 0; /* * Acquire lock: XXX giant lock */ void pool_shmem_lock(POOL_MEMQ_LOCK_TYPE type) { if (memq_lock_fd == 0) { char *path; path = psprintf("%s/%s", pool_config->logdir, QUERY_CACHE_LOCK_FILE); memq_lock_fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (memq_lock_fd == -1) { ereport(FATAL, (errmsg("Failed to open lock file for query cache \"%s\"", path), errdetail("%m"))); } pfree(path); } #ifdef LOCK_TRACE elog(LOG, "LOCK TRACE: try to acquire lock %s", type == POOL_MEMQ_EXCLUSIVE_LOCK? "LOCK_EX" : "LOCK_SH"); #endif if (pool_is_shmem_cache() && !is_shmem_locked) { if (flock(memq_lock_fd, type == POOL_MEMQ_EXCLUSIVE_LOCK? LOCK_EX : LOCK_SH)) { ereport(FATAL, (errmsg("Failed to lock file for query cache"), errdetail("%m"))); } #ifdef LOCK_TRACE elog(LOG, "LOCK TRACE: acquire lock %s", type == POOL_MEMQ_EXCLUSIVE_LOCK? "LOCK_EX" : "LOCK_SH"); #endif is_shmem_locked = true; } } /* * Release lock */ void pool_shmem_unlock(void) { if (pool_is_shmem_cache() && is_shmem_locked) { if (flock(memq_lock_fd, LOCK_UN)) { ereport(FATAL, (errmsg("Failed to unlock file for query cache"), errdetail("%m"))); } #ifdef LOCK_TRACE elog(LOG, "LOCK TRACE: unlock"); #endif 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() + (uint64)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); } /* * Discard temp query cache in the current query context */ void pool_discard_current_temp_query_cache(void) { POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; POOL_TEMP_QUERY_CACHE * temp_cache; session_context = pool_get_session_context(true); query_context = session_context->query_context; if (query_context) { temp_cache = query_context->temp_cache; if (temp_cache) { pool_discard_temp_query_cache(temp_cache); query_context->temp_cache = NULL; } } } /* * 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 Command Complete handle query cache. For streaming * replication mode and extended query at Command 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, bool partial_fetch) { 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 (!partial_fetch && pool_is_cache_safe() && !query_cache_disabled()) { 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(POOL_MEMQ_EXCLUSIVE_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_discard_current_temp_query_cache(); } /* * 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 (partial_fetch) /* cannot create cache because of partial fetch */ { /* 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(POOL_MEMQ_EXCLUSIVE_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 cacheable 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_MEMQ_EXCLUSIVE_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_MEMQ_EXCLUSIVE_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_MEMQ_EXCLUSIVE_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_segment_get_chunk(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_segment_get_chunk(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_segment_get_chunk(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; } size_t pool_hash_size(int nelements) { size_t size; int nelements2; /* number of rounded up hash keys */ int shift; POOL_HASH_HEADER hh; /* Round up to power of 2 */ shift = 32; nelements2 = 1; do { nelements2 <<= 1; shift--; } while (nelements2 < nelements); size = (char *) &hh.elements - (char *) &hh + sizeof(POOL_HEADER_ELEMENT) * nelements2; size += sizeof(POOL_HASH_ELEMENT) * nelements2; elog(DEBUG1, "pool_hash_size: %zu", size); return size; } /* * 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_PENDING_MESSAGE *msg; int num_msgs; int msg_cnt = 0; session_context = pool_get_session_context(false); msg = pool_pending_message_head_message(); num_msgs = list_length(session_context->pending_messages); if (msg) { /* * If pending message found, we should extract data from the target * backend. */ int backend_id; backend_id = pool_pending_message_get_target_backend_id(msg); pool_pending_message_free_pending_message(msg); backend = CONNECTION(session_context->backend, backend_id); timeout = -1; } else timeout = 0; /* Send flush message 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); } /* read one message from backend */ pool_read(backend, &kind, 1); /* * Count up number of received messages to compare with the number of * pending messages */ switch(kind) { case '1': /* parse complete */ case '2': /* bind complete */ case '3': /* close complete */ case 'C': /* command complete */ case 's': /* portal suspended */ case 'T': /* row description */ msg_cnt++; /* count up number of messages */ elog(DEBUG1, "count up message %c msg_cnt: %d", kind, msg_cnt); break; case 'E': /* ErrorResponse */ /* * If we receive ErrorResponse, it is likely that the last * Execute caused an error and we can stop reading messsages * from backend. */ timeout = 0; break; default: /* we do not count other messages */ break; } /* * If msg count is greater than or equal to the number of pending * messages, it is likely all necessary backend messages have been * already seen. */ if (msg_cnt >= num_msgs) { /* * Set timeout to 0 so that we do not need to wait for responses * from backend in vain. */ timeout = 0; elog(DEBUG1, "num_msgs: %d msg_cnt: %d", num_msgs, msg_cnt); } 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); } /* * Public API to invalidate query cache specified by the table/database oids. */ void InvalidateQueryCache(int tableoid, int dboid) { pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(POOL_MEMQ_EXCLUSIVE_LOCK); /* Invalidate query cache */ pool_invalidate_query_cache(1, &tableoid, true, dboid); pool_semaphore_unlock(QUERY_CACHE_STATS_SEM); POOL_SETMASK(&oldmask); } /* * Public API to invalidate query cache specified by query string. Returns * true for successfully query cache invalidation. If the query cache was not * found, returns false. Note that this function does not remove any entry in * a table oid file. That may leave a garbage in the file (which is ignored * by the auto cache invalidation) but it's not worth the trouble to remove * the entry since it's relatively expensive. It needs to rewrite the whole * file in the worst case. */ bool query_cache_delete_by_stmt(char *query, POOL_CONNECTION_POOL * backend) { bool rtn = true; pool_sigset_t oldmask; char key[MAX_KEY]; POOL_CACHEID *cacheid; POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(POOL_MEMQ_EXCLUSIVE_LOCK); /* encode md5key */ encode_key(query, key, backend); if (pool_is_shmem_cache()) { POOL_QUERY_HASH hashkey; memcpy(hashkey.query_hash, key, POOL_MD5_HASHKEYLEN); cacheid = pool_hash_search(&hashkey); if (cacheid == NULL) rtn = false; else pool_delete_item_shmem_cache(cacheid); } #ifdef USE_MEMCACHED else { if (delete_cache_on_memcached(key) == 0) rtn = false; } #else { ereport(WARNING, (errmsg("failed to delete query cache on memcached, memcached support is not enabled"))); } #endif pool_semaphore_unlock(QUERY_CACHE_STATS_SEM); POOL_SETMASK(&oldmask); return rtn; } pgpool-II-4.6.0/src/redhat/0000775000175000017500000000000014760010071012355 500000000000000pgpool-II-4.6.0/src/redhat/pgpool.init0000664000175000017500000000763014760007565014506 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 supports 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.6.0/src/redhat/pgpool_rhel.sysconfig0000664000175000017500000000027714760007565016561 00000000000000# Options for pgpool # -n: don't run in daemon mode. does not detach control tty # -d: debug mode. lots of debug information will be printed #OPTS=" -d -n" OPTS=" -n" STOP_OPTS=" -m fast" pgpool-II-4.6.0/src/redhat/pgpool_rhel6.sysconfig0000664000175000017500000000025114760007565016637 00000000000000# Options for pgpool # -n: don't run in daemon mode. does not detach control tty # -d: debug mode. lots of debug information will be printed #OPTS=" -d -n" OPTS=" -n" pgpool-II-4.6.0/src/redhat/pgpool.conf.sample.patch0000664000175000017500000000521314760001620017023 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.6.0/src/redhat/pcp_unix_domain_path.patch0000664000175000017500000000104714760001620017510 00000000000000*** src/include/pcp/pcp_stream.h 2020-07-31 09:24:10.835496879 +0900 --- pcp_stream.h 2020-07-31 09:24:02.598396128 +0900 *************** *** 49,54 **** extern int pcp_write(PCP_CONNECTION * pc, void *buf, int len); extern int pcp_flush(PCP_CONNECTION * pc); ! #define UNIX_DOMAIN_PATH "/tmp" #endif /* PCP_STREAM_H */ --- 49,54 ---- extern int pcp_write(PCP_CONNECTION * pc, void *buf, int len); extern int pcp_flush(PCP_CONNECTION * pc); ! #define UNIX_DOMAIN_PATH "/var/run/postgresql" #endif /* PCP_STREAM_H */ pgpool-II-4.6.0/src/redhat/pgpool_log.patch0000664000175000017500000001066014760007565015500 00000000000000*** src/sample/pgpool.conf.sample 2022-02-10 12:49:15.079700949 +0900 --- pgpool.conf.sample 2022-02-22 11:05:17.073517397 +0900 *************** *** 186,192 **** # - Where to log - ! #log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. --- 186,192 ---- # - Where to log - ! log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. *************** *** 252,268 **** # panic # This is used when logging to stderr: ! #logging_collector = off # Enable capturing of stderr # into log files. # (change requires restart) # -- Only used if logging_collector is on --- ! #log_directory = '/tmp/pgpool_logs' # directory where log files are written, # can be absolute ! #log_filename = 'pgpool-%Y-%m-%d_%H%M%S.log' # log file name pattern, # can include strftime() escapes --- 252,268 ---- # panic # This is used when logging to stderr: ! logging_collector = on # Enable capturing of stderr # into log files. # (change requires restart) # -- Only used if logging_collector is on --- ! log_directory = '/var/log/pgpool_log' # directory where log files are written, # can be absolute ! log_filename = 'pgpool-%a.log' # log file name pattern, # can include strftime() escapes *************** *** 270,276 **** # creation mode for log files, # begin with 0 to use octal notation ! #log_truncate_on_rotation = off # If on, an existing log file with the # same name as the new log file will be # truncated rather than appended to. --- 270,276 ---- # creation mode for log files, # begin with 0 to use octal notation ! log_truncate_on_rotation = on # If on, an existing log file with the # same name as the new log file will be # truncated rather than appended to. *************** *** 280,290 **** # off, meaning append to existing files # in all cases. ! #log_rotation_age = 1d # Automatic rotation of logfiles will # happen after that (minutes)time. # 0 disables time based rotation. ! #log_rotation_size = 10MB # Automatic rotation of logfiles will # happen after that much (KB) log output. # 0 disables size based rotation. --- 280,290 ---- # off, meaning append to existing files # in all cases. ! log_rotation_age = 1d # Automatic rotation of logfiles will # happen after that (minutes)time. # 0 disables time based rotation. ! log_rotation_size = 0 # Automatic rotation of logfiles will # happen after that much (KB) log output. # 0 disables size based rotation. pgpool-II-4.6.0/src/redhat/pgpool.service0000664000175000017500000000057514760001620015166 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.6.0/src/redhat/pgpool_socket_dir.patch0000664000175000017500000000503714760007565017047 00000000000000*** src/sample/pgpool.conf.sample 2023-11-07 20:38:38.890984731 +0900 --- pgpool.conf.sample 2023-11-09 13:22:19.179462724 +0900 *************** *** 40,46 **** #port = 9999 # Port number # (change requires restart) ! #unix_socket_directories = '/tmp' # Unix domain socket path(s) # The Debian package defaults to # /var/run/postgresql --- 40,46 ---- #port = 9999 # Port number # (change requires restart) ! unix_socket_directories = '/var/run/postgresql' # Unix domain socket path(s) # The Debian package defaults to # /var/run/postgresql *************** *** 67,73 **** #pcp_port = 9898 # Port number for pcp # (change requires restart) ! #pcp_socket_dir = '/tmp' # Unix domain socket path(s) for pcp # The Debian package defaults to # /var/run/postgresql --- 67,73 ---- #pcp_port = 9898 # Port number for pcp # (change requires restart) ! pcp_socket_dir = '/var/run/postgresql' # Unix domain socket path(s) for pcp # The Debian package defaults to # /var/run/postgresql *************** *** 736,742 **** # 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 --- 736,742 ---- # Authentication key for watchdog communication # (change requires restart) ! wd_ipc_socket_dir = '/var/run/postgresql' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql pgpool-II-4.6.0/src/redhat/pgpool_sudoers.d0000664000175000017500000000011014760007565015514 00000000000000postgres ALL=NOPASSWD: /sbin/ip postgres ALL=NOPASSWD: /usr/sbin/arping pgpool-II-4.6.0/src/redhat/pgpool_tmpfiles.d0000664000175000017500000000004714760001620015646 00000000000000d /run/pgpool 0755 postgres postgres - pgpool-II-4.6.0/src/rewrite/0000775000175000017500000000000014760010070012566 500000000000000pgpool-II-4.6.0/src/rewrite/pool_timestamp.c0000664000175000017500000013732314760007565015736 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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" #include "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.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 * instead 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_catalog.pg_get_expr(d.adbin, d.adrelid), coalesce((pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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_catalog.pg_get_expr(d.adbin, d.adrelid), coalesce((pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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_catalog.pg_get_expr(d.adbin, d.adrelid), coalesce((pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_catalog.pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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 = pg_catalog.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'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'timestamp with time zone'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'date'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time'::pg_catalog.regtype::pg_catalog.oid OR" \ " a.atttypid = 'time with time zone'::pg_catalog.regtype::pg_catalog.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 = pg_catalog.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 value is required then return ts_const. Otherwise 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; if (!IsA(node, A_Const)) return false; a_const = (A_Const *) node; if (IsA(&a_const->val, String) && a_const->val.sval.sval && strcmp(str, a_const->val.sval.sval) == 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; else if (list_length(typename->names) == 1 && strcmp(name, strVal(linitial(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 MAIN node */ static char * get_current_timestamp(POOL_CONNECTION_POOL * backend) { POOL_SELECT_RESULT *res; static char timestamp[64]; do_query(MAIN(backend), "SELECT pg_catalog.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. * Otherwise, 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.sval.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, MergeStmt)) { MergeStmt *m_stmt = (MergeStmt *) stmt; ListCell *temp; /* USING data_source */ raw_expression_tree_walker( (Node *) m_stmt->sourceRelation, rewrite_timestamp_walker, (void *) &ctx); /* ON join_condition */ raw_expression_tree_walker( (Node *) m_stmt->joinCondition, rewrite_timestamp_walker, (void *) &ctx); foreach(temp, m_stmt->mergeWhenClauses) { raw_expression_tree_walker( lfirst(temp), rewrite_timestamp_walker, (void *) &ctx); } raw_expression_tree_walker( (Node *) m_stmt->withClause, 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->objtype == 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 additional 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.sval.sval = 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 parameters 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 parameters. */ 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); } } /* otherwise, 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(MAIN(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.sval.type = T_String; con->val.sval.sval = 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_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_MergeWhenClause: { MergeWhenClause *mergeWhenClause = (MergeWhenClause *) node; if (walker(mergeWhenClause->condition, context)) return true; if (walker(mergeWhenClause->targetList, context)) return true; if (walker(mergeWhenClause->values, context)) return true; } break; case T_MergeAction: { MergeAction *action = (MergeAction *) node; if (walker(action->targetList, context)) return true; if (walker(action->qual, 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.6.0/src/rewrite/pool_lobj.c0000664000175000017500000001634514760001620014643 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 "protocol/pool_process_query.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, MAIN_NODE_ID, qbuf); status = do_command(frontend, MAIN(backend), qbuf, MAJOR(backend), MAIN_CONNECTION(backend)->pid, MAIN_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, MAIN_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, MAIN_NODE_ID, GET_MAX_LOBJ_KEY); do_query(MAIN(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.6.0/src/sample/0000775000175000017500000000000014760010071012367 500000000000000pgpool-II-4.6.0/src/sample/scripts/0000775000175000017500000000000014760010071014056 500000000000000pgpool-II-4.6.0/src/sample/scripts/failover.sh.sample0000775000175000017500000000535114760007565017446 00000000000000#!/bin/bash # This script is run by failover_command. set -o xtrace # Special values: # 1) %d = failed node id # 2) %h = failed node hostname # 3) %p = failed node port number # 4) %D = failed node database cluster path # 5) %m = new main node id # 6) %H = new main node hostname # 7) %M = old main node id # 8) %P = old primary node id # 9) %r = new main port number # 10) %R = new main database cluster path # 11) %N = old primary node hostname # 12) %S = old primary node port number # 13) %% = '%' character FAILED_NODE_ID="$1" FAILED_NODE_HOST="$2" FAILED_NODE_PORT="$3" FAILED_NODE_PGDATA="$4" NEW_MAIN_NODE_ID="$5" NEW_MAIN_NODE_HOST="$6" OLD_MAIN_NODE_ID="$7" OLD_PRIMARY_NODE_ID="$8" NEW_MAIN_NODE_PORT="$9" NEW_MAIN_NODE_PGDATA="${10}" OLD_PRIMARY_NODE_HOST="${11}" OLD_PRIMARY_NODE_PORT="${12}" PGHOME=/usr/pgsql-17 REPL_SLOT_NAME=$(echo ${FAILED_NODE_HOST,,} | tr -- -. _) POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" echo failover.sh: start: failed_node_id=$FAILED_NODE_ID failed_host=$FAILED_NODE_HOST \ old_primary_node_id=$OLD_PRIMARY_NODE_ID new_main_node_id=$NEW_MAIN_NODE_ID new_main_host=$NEW_MAIN_NODE_HOST ## If there's no main node anymore, skip failover. if [ $NEW_MAIN_NODE_ID -lt 0 ]; then echo failover.sh: All nodes are down. Skipping failover. exit 0 fi ## Test passwordless SSH ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NEW_MAIN_NODE_HOST} ls /tmp > /dev/null if [ $? -ne 0 ]; then echo failover.sh: passwordless SSH to ${POSTGRESQL_STARTUP_USER}@${NEW_MAIN_NODE_HOST} failed. Please setup passwordless SSH. exit 1 fi ## If Standby node is down, skip failover. if [ $OLD_PRIMARY_NODE_ID != "-1" -a $FAILED_NODE_ID != $OLD_PRIMARY_NODE_ID ]; then # If Standby node is down, drop replication slot. ${PGHOME}/bin/psql -h ${OLD_PRIMARY_NODE_HOST} -p ${OLD_PRIMARY_NODE_PORT} postgres \ -c "SELECT pg_drop_replication_slot('${REPL_SLOT_NAME}');" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo ERROR: failover.sh: drop replication slot \"${REPL_SLOT_NAME}\" failed. You may need to drop replication slot manually. fi echo failover.sh: end: standby node is down. Skipping failover. exit 0 fi ## Promote Standby node. echo failover.sh: primary node is down, promote new_main_node_id=$NEW_MAIN_NODE_ID on ${NEW_MAIN_NODE_HOST}. ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NEW_MAIN_NODE_HOST} ${PGHOME}/bin/pg_ctl -D ${NEW_MAIN_NODE_PGDATA} -w promote if [ $? -ne 0 ]; then echo ERROR: failover.sh: promote failed exit 1 fi echo failover.sh: end: new_main_node_id=$NEW_MAIN_NODE_ID on ${NEW_MAIN_NODE_HOST} was successfully promoted to primary exit 0 pgpool-II-4.6.0/src/sample/scripts/follow_primary.sh.sample0000775000175000017500000001104414760007661020675 00000000000000#!/bin/bash # This script is run after failover_command to synchronize the Standby with the new Primary. set -o xtrace # Special values: # 1) %d = node id # 2) %h = hostname # 3) %p = port number # 4) %D = node database cluster path # 5) %m = new primary node id # 6) %H = new primary node hostname # 7) %M = old main node id # 8) %P = old primary node id # 9) %r = new primary port number # 10) %R = new primary database cluster path # 11) %N = old primary node hostname # 12) %S = old primary node port number # 13) %% = '%' character NODE_ID="$1" NODE_HOST="$2" NODE_PORT="$3" NODE_PGDATA="$4" NEW_PRIMARY_NODE_ID="$5" NEW_PRIMARY_NODE_HOST="$6" OLD_MAIN_NODE_ID="$7" OLD_PRIMARY_NODE_ID="$8" NEW_PRIMARY_NODE_PORT="$9" NEW_PRIMARY_NODE_PGDATA="${10}" PGHOME=/usr/pgsql-17 REPLUSER=repl PCP_USER=pgpool PGPOOL_PATH=/usr/bin PCP_PORT=9898 REPL_SLOT_NAME=$(echo ${NODE_HOST,,} | tr -- -. _) POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" echo follow_primary.sh: start: Standby node ${NODE_ID} # Check the connection status of Standby ${PGHOME}/bin/pg_isready -h ${NODE_HOST} -p ${NODE_PORT} > /dev/null 2>&1 if [ $? -ne 0 ]; then echo follow_primary.sh: node_id=${NODE_ID} is not running. skipping follow primary command exit 0 fi # Test passwordless SSH ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NEW_PRIMARY_NODE_HOST} ls /tmp > /dev/null if [ $? -ne 0 ]; then echo follow_main.sh: passwordless SSH to ${POSTGRESQL_STARTUP_USER}@${NEW_PRIMARY_NODE_HOST} failed. Please setup passwordless SSH. exit 1 fi # Get PostgreSQL major version PGVERSION=`${PGHOME}/bin/psql -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${NODE_PGDATA}/myrecovery.conf else RECOVERYCONF=${NODE_PGDATA}/recovery.conf fi # Synchronize Standby with the new Primary. echo follow_primary.sh: pg_rewind for node ${NODE_ID} # Run checkpoint command to update control file before running pg_rewind ${PGHOME}/bin/psql -h ${NEW_PRIMARY_NODE_HOST} -p ${NEW_PRIMARY_NODE_PORT} postgres -c "checkpoint;" # Create replication slot "${REPL_SLOT_NAME}" ${PGHOME}/bin/psql -h ${NEW_PRIMARY_NODE_HOST} -p ${NEW_PRIMARY_NODE_PORT} postgres \ -c "SELECT pg_create_physical_replication_slot('${REPL_SLOT_NAME}');" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo follow_primary.sh: create replication slot \"${REPL_SLOT_NAME}\" failed. You may need to create replication slot manually. fi ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${NODE_HOST} " set -o errexit ${PGHOME}/bin/pg_ctl -w -m f -D ${NODE_PGDATA} stop ${PGHOME}/bin/pg_rewind -D ${NODE_PGDATA} --source-server=\"user=${POSTGRESQL_STARTUP_USER} host=${NEW_PRIMARY_NODE_HOST} port=${NEW_PRIMARY_NODE_PORT} dbname=postgres\" [ -d \"${NODE_PGDATA}\" ] && rm -rf ${NODE_PGDATA}/pg_replslot/* cat > ${RECOVERYCONF} << EOT primary_conninfo = 'host=${NEW_PRIMARY_NODE_HOST} port=${NEW_PRIMARY_NODE_PORT} user=${REPLUSER} application_name=${NODE_HOST} passfile=''/var/lib/pgsql/.pgpass''' recovery_target_timeline = 'latest' primary_slot_name = '${REPL_SLOT_NAME}' EOT 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\" ${NODE_PGDATA}/postgresql.conf touch ${NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi ${PGHOME}/bin/pg_ctl -l /dev/null -w -D ${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 ${NODE_ID} if [ $? -ne 0 ]; then echo ERROR: follow_primary.sh: end: pcp_attach_node failed exit 1 fi else # If start Standby failed, drop replication slot "${REPL_SLOT_NAME}" ${PGHOME}/bin/psql -h ${NEW_PRIMARY_NODE_HOST} -p ${NEW_PRIMARY_NODE_PORT} postgres \ -c "SELECT pg_drop_replication_slot('${REPL_SLOT_NAME}');" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo ERROR: follow_primary.sh: drop replication slot \"${REPL_SLOT_NAME}\" failed. You may need to drop replication slot manually. fi echo ERROR: follow_primary.sh: end: follow primary command failed exit 1 fi echo follow_primary.sh: end: follow primary command is completed successfully exit 0 pgpool-II-4.6.0/src/sample/scripts/pgpool_remote_start.sample0000775000175000017500000000223714760007565021316 00000000000000#!/bin/bash # This script is run after recovery_1st_stage to start Standby node. set -o xtrace DEST_NODE_HOST="$1" DEST_NODE_PGDATA="$2" PGHOME=/usr/pgsql-17 POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" echo pgpool_remote_start: start: remote start Standby node $DEST_NODE_HOST ## Test passwordless SSH ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} ls /tmp > /dev/null if [ $? -ne 0 ]; then echo ERROR: pgpool_remote_start: passwordless SSH to ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} failed. Please setup passwordless SSH. exit 1 fi ## Start Standby node ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} " $PGHOME/bin/pg_ctl -l /dev/null -w -D ${DEST_NODE_PGDATA} status if [ \$? -eq 0 ]; then exit 0 fi $PGHOME/bin/pg_ctl -l /dev/null -w -D ${DEST_NODE_PGDATA} start " if [ $? -ne 0 ]; then echo ERROR: pgpool_remote_start: ${DEST_NODE_HOST} PostgreSQL start failed. exit 1 fi echo pgpool_remote_start: end: PostgreSQL on ${DEST_NODE_HOST} is started successfully. exit 0 pgpool-II-4.6.0/src/sample/scripts/recovery_1st_stage.sample0000775000175000017500000000616314760007565021040 00000000000000#!/bin/bash # This script is executed by "recovery_1st_stage" to recovery a Standby node. set -o xtrace 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="$7" PGHOME=/usr/pgsql-17 REPLUSER=repl REPL_SLOT_NAME=$(echo ${DEST_NODE_HOST,,} | tr -- -. _) POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" echo recovery_1st_stage: start: pg_basebackup for Standby node $DEST_NODE_ID ## Test passwordless SSH ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} ls /tmp > /dev/null if [ $? -ne 0 ]; then echo recovery_1st_stage: passwordless SSH to ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} failed. Please setup passwordless SSH. exit 1 fi ## Get PostgreSQL major version PGVERSION=`${PGHOME}/bin/psql -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 "${REPL_SLOT_NAME}" ${PGHOME}/bin/psql -h ${PRIMARY_NODE_HOST} -p ${PRIMARY_NODE_PORT} postgres \ -c "SELECT pg_create_physical_replication_slot('${REPL_SLOT_NAME}');" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo ERROR: recovery_1st_stage: create replication slot \"${REPL_SLOT_NAME}\" failed. You may need to create replication slot manually. fi ## Execute pg_basebackup to recovery Standby node ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST " set -o errexit [ -d \"${DEST_NODE_PGDATA}\" ] && rm -rf ${DEST_NODE_PGDATA} ${PGHOME}/bin/pg_basebackup -h $PRIMARY_NODE_HOST -U $REPLUSER -p $PRIMARY_NODE_PORT -D $DEST_NODE_PGDATA -X stream 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' primary_slot_name = '${REPL_SLOT_NAME}' EOT 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 touch ${DEST_NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi sed -i \ -e \"s/#*port = .*/port = ${DEST_NODE_PORT}/\" \ ${DEST_NODE_PGDATA}/postgresql.conf " if [ $? -ne 0 ]; then ${PGHOME}/bin/psql -h ${PRIMARY_NODE_HOST} -p ${PRIMARY_NODE_PORT} postgres \ -c "SELECT pg_drop_replication_slot('${REPL_SLOT_NAME}');" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo ERROR: recovery_1st_stage: drop replication slot \"${REPL_SLOT_NAME}\" failed. You may need to drop replication slot manually. fi echo ERROR: recovery_1st_stage: end: pg_basebackup failed. online recovery failed exit 1 fi echo recovery_1st_stage: end: recovery_1st_stage is completed successfully exit 0 pgpool-II-4.6.0/src/sample/scripts/replication_mode_recovery_1st_stage.sample0000775000175000017500000000707714760007565024442 00000000000000#!/bin/bash # This script is executed by "recovery_1st_stage" to recovery a Standby node. set -o xtrace MAIN_NODE_PGDATA="$1" # main node dabatase cluster path DEST_NODE_HOST="$2" # hostname of the DB node to be recovered DEST_NODE_PGDATA="$3" # database cluster path of the DB node to be recovered MAIN_NODE_PORT="$4" # main node port number DEST_NODE_ID="$5" # node id of the DB node to be recovered DEST_NODE_PORT="$6" # port number of the DB node to be recovered MAIN_NODE_HOST="$7" # main node hostname PGHOME=/usr/pgsql-17 ARCHIVEDIR=/var/lib/pgsql/archivedir REPLUSER=repl MAX_DURATION=60 POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" echo recovery_1st_stage: start: pg_basebackup for Standby node $DEST_NODE_ID ## Test passwordless SSH ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} ls /tmp > /dev/null if [ $? -ne 0 ]; then echo recovery_1st_stage: passwordless SSH to ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} failed. Please setup passwordless SSH. exit 1 fi ## Get PostgreSQL major version PGVERSION=`${PGHOME}/bin/psql -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 ## Execute pg_basebackup to recovery Standby node ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${DEST_NODE_HOST} " set -o errexit [ -d \"${DEST_NODE_PGDATA}\" ] && rm -rf ${DEST_NODE_PGDATA} [ -d \"${ARCHIVEDIR}\" ] && rm -rf ${ARCHIVEDIR}/* ${PGHOME}/bin/pg_basebackup -h ${MAIN_NODE_HOST} -U ${REPLUSER} -p ${MAIN_NODE_PORT} -D ${DEST_NODE_PGDATA} -X stream cat > ${RECOVERYCONF} << EOT primary_conninfo = 'host=${MAIN_NODE_HOST} port=${MAIN_NODE_PORT} user=${REPLUSER} application_name=${DEST_NODE_HOST} passfile=''/var/lib/pgsql/.pgpass''' recovery_target_timeline = 'latest' restore_command = 'scp ${SSH_OPTIONS} ${MAIN_NODE_HOST}:${ARCHIVEDIR}/%f %p' EOT 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 touch ${DEST_NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi sed -i \ -e \"s/#*port = .*/port = ${DEST_NODE_PORT}/\" \ -e \"s@#*archive_command = .*@archive_command = 'cp \\\"%p\\\" \\\"${ARCHIVEDIR}/%f\\\"'@\" \ ${DEST_NODE_PGDATA}/postgresql.conf " if [ $? -ne 0 ]; then echo ERROR: recovery_1st_stage: end: pg_basebackup failed. online recovery failed exit 1 fi # start target server as a streaming replication standby server ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST " $PGHOME/bin/pg_ctl -l /dev/null -w -D $DEST_NODE_PGDATA start " # wait till the standby catches up primary server or # $MAX_DURATION seconds passes sec=0 while [ $sec -lt $MAX_DURATION ] do sec=`expr $sec + 1` result=`psql -h ${MAIN_NODE_HOST} -p ${MAIN_NODE_PORT} -c "SELECT sent_lsn = replay_lsn FROM pg_stat_replication where application_name = '${DEST_NODE_HOST}'" postgres|sed -n 3p|sed 's/ //'` echo "result: $result" if [ "$result" = "t" ];then sec=$MAX_DURATION fi sleep 1 done echo recovery_1st_stage: end: recovery_1st_stage is completed successfully exit 0 pgpool-II-4.6.0/src/sample/scripts/replication_mode_recovery_2nd_stage.sample0000775000175000017500000000347314760007565024412 00000000000000#!/bin/bash # Online recovery 2nd stage script set -o xtrace MAIN_NODE_PGDATA="$1" # main node dabatase cluster path DEST_NODE_HOST="$2" # hostname of the DB node to be recovered DEST_NODE_PGDATA="$3" # database cluster path of the DB node to be recovered MAIN_NODE_PORT="$4" # main node port number DEST_NODE_ID="$5" # node id of the DB node to be recovered DEST_NODE_PORT="$6" # port number of the DB node to be recovered MAIN_NODE_HOST="$7" # main node hostname PGHOME=/usr/pgsql-17 ARCHIVEDIR=/var/lib/pgsql/archivedir # archive log directory POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" # Force to flush current value of sequences to xlog ${PGHOME}/bin/psql -h $MAIN_NODE_HOST -p $MAIN_NODE_PORT -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1| while read i do if [ "$i" != "" ]; then psql -h $MAIN_NODE_HOST -p $MAIN_NODE_PORT -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i fi done if [ $? -ne 0 ]; then echo ERROR: recovery_2nd_stage: failed. exit 1 fi psql -h $MAIN_NODE_HOST -p $MAIN_NODE_PORT -c "SELECT pgpool_switch_xlog('$ARCHIVEDIR')" template1 if [ $? -ne 0 ]; then echo ERROR: recovery_2nd_stage: pgpool_switch_xlog failed. exit 1 fi # start target server as a streaming replication standby server ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@$DEST_NODE_HOST " $PGHOME/bin/pg_ctl -l /dev/null -w -D $DEST_NODE_PGDATA promote " if [ $? -ne 0 ]; then echo ERROR: recovery_2nd_stage: promote failed. exit 1 fi echo recovery_2nd_stage: end: recovery_2nd_stage is completed successfully exit 0 pgpool-II-4.6.0/src/sample/scripts/escalation.sh.sample0000775000175000017500000000202414760007565017753 00000000000000#!/bin/bash # This script is run by wd_escalation_command to bring down the virtual IP on other pgpool nodes # before bringing up the virtual IP on the new active pgpool node. set -o xtrace POSTGRESQL_STARTUP_USER=postgres SSH_KEY_FILE=id_rsa_pgpool SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/${SSH_KEY_FILE}" SSH_TIMEOUT=5 PGPOOLS=(server1 server2 server3) VIP=192.168.100.50 DEVICE=enp0s8 CIDR_NETMASK=24 for pgpool in "${PGPOOLS[@]}"; do [ "$HOSTNAME" = "${pgpool}" ] && continue timeout ${SSH_TIMEOUT} ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${pgpool} " /sbin/ip addr show dev ${DEVICE} | grep ${VIP} > /dev/null 2>&1 " if [ $? -eq 0 ]; then timeout ${SSH_TIMEOUT} ssh -T ${SSH_OPTIONS} ${POSTGRESQL_STARTUP_USER}@${pgpool} " /usr/bin/sudo /sbin/ip addr del ${VIP}/${CIDR_NETMASK} dev ${DEVICE} " if [ $? -ne 0 ]; then echo ERROR: escalation.sh: failed to release VIP on ${pgpool}. fi fi done exit 0 pgpool-II-4.6.0/src/sample/scripts/aws_eip_if_cmd.sh.sample0000775000175000017500000000300714760007565020563 00000000000000#!/bin/bash CMD=$1 ELASTIC_IP=$2 AWSCLI=$3 TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/instance-id) ALLOCATION_ID=$(aws ec2 describe-addresses --query "Addresses[?PublicIp=='${ELASTIC_IP}'].AllocationId" --output text) if [ "${CMD}" == "up" ]; then echo "running if_up_cmd" echo "associate Elastic IP ${ELASTIC_IP} with instance ${INSTANCE_ID}" ${AWSCLI} ec2 associate-address \ --instance-id ${INSTANCE_ID} \ --allocation-id ${ALLOCATION_ID} if [ $? -ne 0 ]; then echo "ERROR: failed to associates Elastic IP ${ELASTIC_IP} with instance ${INSTANCE_ID}" >&2 exit 1 fi elif [ "${CMD}" == "down" ]; then echo "running if_down_cmd" ASSOCIATION_ID=$(${AWSCLI} ec2 describe-addresses \ --query "Addresses[?PublicIp=='${ELASTIC_IP}'].AssociationId" --output text) if [ -z "${ASSOCIATION_ID}" ]; then echo "ERROR: failed to retrieve ASSOCIATION_ID while bringing down Elastic IP ${ELASTIC_IP}" >&2 exit 1 fi echo "disassociate Elastic IP ${ELASTIC_IP} from instance ${INSTANCE_ID}" ${AWSCLI} ec2 disassociate-address --association-id ${ASSOCIATION_ID} if [ $? -ne 0 ]; then echo "ERROR: failed to disassociate Elastic IP ${ELASTIC_IP} from instance ${INSTANCE_ID}" >&2 exit 1 fi fi echo "Elastic IP ${ELASTIC_IP} ${CMD} successfully" exit 0 pgpool-II-4.6.0/src/sample/scripts/aws_rtb_if_cmd.sh.sample0000775000175000017500000000477214760007565020607 00000000000000#!/bin/bash CMD=$1 VIP=$2 LOCAL_INTERFACE=$3 ROUTE_TABLE_ID=$4 AWSCLI=$5 TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/instance-id) MAC_ADDR=$(ip -br link show dev ${LOCAL_INTERFACE} | tr -s ' ' | cut -d ' ' -f3) NETWORK_INTERFACE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDR}/interface-id) if [ "${CMD}" == "up" ]; then echo "running if_up_cmd" for rtb in $(echo ${ROUTE_TABLE_ID} | sed -e 's/,/ /g'); do echo "create route entry for ${VIP}/32 if it doesn't exist" ${AWSCLI} ec2 create-route --route-table-id ${rtb} \ --destination-cidr-block ${VIP}/32 --network-interface-id ${NETWORK_INTERFACE_ID} if [ $? -ne 0 ]; then echo "replace route entry for ${VIP}/32" ${AWSCLI} ec2 replace-route --route-table-id ${rtb} \ --destination-cidr-block ${VIP}/32 --network-interface-id ${NETWORK_INTERFACE_ID} if [ $? -ne 0 ]; then echo "ERROR: failed to replace route entry for ${VIP}/32" >&2 exit 1 fi fi done echo "assign virtual IP ${VIP}/32 to local network interface ${LOCAL_INTERFACE}" /usr/bin/sudo /sbin/ip addr add ${VIP}/32 dev ${LOCAL_INTERFACE} label ${LOCAL_INTERFACE}:1 if [ $? -ne 0 ]; then echo "ERROR: failed to assign virtual IP ${VIP}/32" >&2 exit 1 fi elif [ "${CMD}" == "down" ]; then echo "running if_down_cmd" echo "remove virtual IP ${VIP}/32 from local network interface ${LOCAL_INTERFACE}" /usr/bin/sudo /sbin/ip addr del ${VIP}/32 dev ${LOCAL_INTERFACE} if [ $? -ne 0 ]; then echo "ERROR: failed to remove virtual IP ${VIP}/32" >&2 fi for rtb in $(echo ${ROUTE_TABLE_ID} | sed -e 's/,/ /g'); do echo "remove route entry for ${VIP}/32" ${AWSCLI} ec2 delete-route --route-table-id ${rtb} --destination-cidr-block ${VIP}/32 if [ $? -ne 0 ]; then echo "ERROR: failed to remove route from route table ${rtb}" >&2 fi done echo "remove remaining route entry if any" ip route show to exact ${VIP}/32 dev ${LOCAL_INTERFACE} | xargs -r ip route delete ip route show table local to exact ${VIP}/32 dev ${LOCAL_INTERFACE} | xargs -r ip route delete fi echo "virtual IP ${VIP} ${CMD} successfully" exit 0 pgpool-II-4.6.0/src/sample/pgpool.pam0000664000175000017500000000010714760001620014304 00000000000000#%PAM-1.0 auth required pam_permit.so account required pam_permit.so pgpool-II-4.6.0/src/sample/pgpool.conf.sample0000664000175000017500000015023314760007565015760 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. # #------------------------------------------------------------------------------ # BACKEND CLUSTERING MODE # Choose one of: 'streaming_replication', 'native_replication', # 'logical_replication', 'slony', 'raw' or 'snapshot_isolation' # (change requires restart) #------------------------------------------------------------------------------ backend_clustering_mode = 'streaming_replication' #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - #listen_addresses = 'localhost' # what host name(s) or IP address(es) to listen on; # comma-separated list of addresses; # defaults to 'localhost'; use '*' for all # (change requires restart) #port = 9999 # Port number # (change requires restart) #unix_socket_directories = '/tmp' # Unix domain socket path(s) # The Debian package defaults to # /var/run/postgresql # (change requires restart) #unix_socket_group = '' # The Owner group of Unix domain socket(s) # (change requires restart) #unix_socket_permissions = 0777 # Permissions of Unix domain socket(s) # (change requires restart) #reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_children - reserved_connections. # - pgpool Communication Manager Connection Settings - #pcp_listen_addresses = 'localhost' # what host name(s) or IP address(es) for pcp process to listen on; # comma-separated list of addresses; # defaults to 'localhost'; use '*' for all # (change requires restart) #pcp_port = 9898 # Port number for pcp # (change requires restart) #pcp_socket_dir = '/tmp' # Unix domain socket path(s) 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_PRIMARY #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 = 1min # 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' # SSL private key file # (change requires restart) #ssl_cert = 'server.crt' # SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # 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_crl_file = '' # SSL certificate revocation list file # (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. #ssl_passphrase_command='' # Sets an external command to be invoked when a passphrase # for decrypting an SSL file needs to be obtained # (change requires restart) #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - #process_management_mode = static # process management mode for child processes # Valid options: # static: all children are pre-forked at startup # dynamic: child processes are spawned on demand. # number of idle child processes at any time are # configured by min_spare_children and max_spare_children #process_management_strategy = gentle # process management strategy to satisfy spare processes # Valid options: # # lazy: In this mode, the scale-down is performed gradually # and only gets triggered when excessive spare processes count # remains high for more than 5 mins # # gentle: In this mode, the scale-down is performed gradually # and only gets triggered when excessive spare processes count # remains high for more than 2 mins # # aggressive: In this mode, the scale-down is performed aggressively # and gets triggered more frequently in case of higher spare processes. # This mode uses faster and slightly less smart process selection criteria # to identify the child processes that can be serviced to satisfy # max_spare_children # # (Only applicable for dynamic process management mode) #num_init_children = 32 # Maximum Number of concurrent sessions allowed # (change requires restart) #min_spare_children = 5 # Minimum number of spare child processes waiting for connection # (Only applicable for dynamic process management mode) #max_spare_children = 10 # Maximum number of idle child processes waiting for connection # (Only applicable for dynamic process management mode) #max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - #child_life_time = 5min # 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 = '%m: %a pid %p: ' # printf-style string to output at beginning of each log line. #log_connections = off # Log connections #log_disconnections = off # Log disconnections #log_pcp_processes = on # Log PCP Processes #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 information #notice_per_node_statement = off # logs notice message for per node detailed SQL statements #log_client_messages = off # Log any client messages #log_backend_messages = none # Log any backend messages # Valid values are none, terse and verbose #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 # This is used when logging to stderr: #logging_collector = off # Enable capturing of stderr # into log files. # (change requires restart) # -- Only used if logging_collector is on --- #log_directory = '/tmp/pgpool_logs' # directory where log files are written, # can be absolute #log_filename = 'pgpool-%Y-%m-%d_%H%M%S.log' # log file name pattern, # can include strftime() escapes #log_file_mode = 0600 # creation mode for log files, # begin with 0 to use octal notation #log_truncate_on_rotation = off # If on, an existing log file with the # same name as the new log file will be # truncated rather than appended to. # But such truncation only occurs on # time-driven rotation, not on restarts # or size-driven rotation. Default is # off, meaning append to existing files # in all cases. #log_rotation_age = 1d # Automatic rotation of logfiles will # happen after that (minutes)time. # 0 disables time based rotation. #log_rotation_size = 10MB # Automatic rotation of logfiles will # happen after that much (KB) log output. # 0 disables size based rotation. #------------------------------------------------------------------------------ # 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 #------------------------------------------------------------------------------ #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 #read_only_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted #write_function_list = '' # Comma separated list of function names # that write to database # Regexp are accepted # If both read_only_function_list and write_function_list # is empty, function's volatile property is checked. # If it's volatile, the function is regarded as a # writing function. #primary_routing_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replication mode only. #user_redirect_preference_list = '' # comma separated list of pairs of user name and node id. # example: postgres:primary,user[0-4]:1,user[5-9]:2' # valid for streaming replication 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 replication 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 replication 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. # # Valid values: # # 'transaction' (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. # # 'dml_adaptive': # Queries on the tables that have already been # modified within the current explicit transaction will # not be load balanced until the end of the transaction. # # 'always': # if a write query is issued, read queries will # not be load balanced until the session ends. # # Note that any query not in an explicit transaction # is not affected by the parameter except 'always'. #dml_adaptive_object_relationship_list= '' # comma separated list of object pairs # [object]:[dependent-object], to disable load balancing # of dependent objects within the explicit transaction # after WRITE statement is issued on (depending-on) object. # # example: 'tb_t1:tb_t2,insert_tb_f_func():tb_f,tb_v:my_view' # Note: function name in this list must also be present in # the write_function_list # only valid for disable_load_balance_on_write = 'dml_adaptive'. #statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # STREAMING REPLICATION MODE #------------------------------------------------------------------------------ # - Streaming - #sr_check_period = 10 # Streaming replication check period # Default is 10s. #sr_check_user = '' # Streaming replication check user # This is necessary 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 #delay_threshold_by_time = 0 # Threshold before not dispatching query to standby node # The default unit is in millisecond(s) # Disabled (0) by default #prefer_lower_delay_standby = off # If delay_threshold is set larger than 0, Pgpool-II send to # the primary when selected node is delayed over delay_threshold. # If this is set to on, Pgpool-II send query to other standby # delayed lower. # - Special commands - #follow_primary_command = '' # Executes this command after main node 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 main node id # %H = new main node hostname # %M = old main node id # %P = old primary node id # %r = new main port number # %R = new main 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 = '' # 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' first. #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 connection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = '' #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 main node id # %H = new main node hostname # %M = old main node id # %P = old primary node id # %r = new main port number # %R = new main 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 main node id # %H = new main node hostname # %M = old main node id # %P = old primary node id # %r = new main port number # %R = new main 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. #failover_on_backend_shutdown = off # Initiates failover when backend is shutdown, # or backend process is killed. # 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 replication # mode and with PostgreSQL 9.6 or # after. #search_primary_node_timeout = 5min # 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 = '' # 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 # Detached backend node reattach automatically # if replication is 'streaming'. #auto_failback_interval = 1min # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - #use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to upstream servers - #trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) #trusted_server_command = 'ping -q -c3 %h' # Command to execute when communicate trusted server. # Special values: # %h = host name specified by trusted_servers # - Watchdog communication Settings - #hostname0 = '' # Host name or IP address of pgpool node # for watchdog connection # (change requires restart) #wd_port0 = 9000 # Port number for watchdog service # (change requires restart) #pgpool_port0 = 9999 # Port number for pgpool # (change requires restart) #hostname1 = '' #wd_port1 = 9000 #pgpool_port1 = 9999 #hostname2 = '' #wd_port2 = 9000 #pgpool_port2 = 9999 #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) #ping_path = '/bin' # ping command path # (change requires restart) # - Behavior 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 leader pgpool resigns from being leader. # (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 # agrees 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) # - Watchdog cluster membership settings for quorum computation - #wd_remove_shutdown_nodes = off # when enabled cluster membership of properly shutdown # watchdog nodes gets revoked, After that the node does # not count towards the quorum and consensus computations #wd_lost_node_removal_timeout = 0s # Timeout after which the cluster membership of LOST watchdog # nodes gets revoked. After that the node node does not # count towards the quorum and consensus computations # setting timeout to 0 will never revoke the membership # of LOST nodes #wd_no_show_node_removal_timeout = 0s # Time to wait for Watchdog node to connect to the cluster. # After that time the cluster membership of NO-SHOW node gets # revoked and it does not count towards the quorum and # consensus computations # setting timeout to 0 will not revoke the membership # of NO-SHOW nodes # - 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 -- #heartbeat_hostname0 = '' # Host name or IP address used # for sending heartbeat signal. # (change requires restart) #heartbeat_port0 = 9694 # Port number used for receiving/sending heartbeat signal # Usually this is the same as heartbeat_portX. # (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_hostname1 = '' #heartbeat_port1 = 9694 #heartbeat_device1 = '' #heartbeat_hostname2 = '' #heartbeat_port2 = 9694 #heartbeat_device2 = '' #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) # -- 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 = '' # 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) #------------------------------------------------------------------------------ # 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 occurred" # in the pgpool log, you might want to increase 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/main # thus increases load of primary. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/main, 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 = primary # Target node to send relcache queries. Default is 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. Mandatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) #memqcache_total_size = 64MB # 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 = 400kB # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) #memqcache_cache_block_size = 1MB # 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) #cache_safe_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted #cache_unsafe_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.6.0/src/sample/pool_hba.conf.sample0000664000175000017500000000662414760001620016231 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.6.0/src/sample/pcp.conf.sample0000664000175000017500000000153214760001620015221 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.6.0/src/sql/0000775000175000017500000000000014760010071011705 500000000000000pgpool-II-4.6.0/src/sql/pgpool_adm/0000775000175000017500000000000014760010071014026 500000000000000pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm.c0000664000175000017500000005257714760007565016271 00000000000000/*------------------------------------------------------------------------- * * pgpool_adm.c * * * Copyright (c) 2002-2021, 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); static Timestamp str2timestamp(char *str); /** * 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[11]; /* values to build the returned tuple from */ bool nulls[] = {false, false, false, false, false, false, false, false, false, false, false}; TupleDesc tupledesc; HeapTuple tuple; struct tm tm; char datebuf[20]; int i; 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(11); #else tupledesc = CreateTemplateTupleDesc(11, 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, "pg_status", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 5, "weight", FLOAT4OID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 6, "role", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 7, "pg_role", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 8, "replication_delay", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 9, "replication_state", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 10, "replication_sync_state", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 11, "last_status_change", TIMESTAMPOID, -1, 0); tupledesc = BlessTupleDesc(tupledesc); backend_info = (BackendInfo *) pcp_get_binary_data(pcpResInfo, 0); /* set values */ i = 0; values[i] = CStringGetTextDatum(backend_info->backend_hostname); nulls[i] = false; i++; values[i] = Int16GetDatum(backend_info->backend_port); nulls[i] = false; i++; switch (backend_info->backend_status) { case CON_UNUSED: values[i] = CStringGetTextDatum("Connection unused"); break; case CON_CONNECT_WAIT: values[i] = CStringGetTextDatum("Waiting for connection to start"); break; case CON_UP: values[i] = CStringGetTextDatum("Connection in use"); break; case CON_DOWN: values[i] = CStringGetTextDatum("Disconnected"); break; } nulls[i] = false; i++; nulls[i] = false; values[i] = CStringGetTextDatum(backend_info->pg_backend_status); i++; values[i] = Float4GetDatum(backend_info->backend_weight / RAND_MAX); nulls[i] = false; i++; nulls[i] = false; values[i] = backend_info->role == ROLE_PRIMARY ? CStringGetTextDatum("Primary") : CStringGetTextDatum("Standby"); i++; nulls[i] = false; values[i] = CStringGetTextDatum(backend_info->pg_role); i++; nulls[i] = false; values[i] = Int64GetDatum(backend_info->standby_delay); i++; nulls[i] = false; values[i] = CStringGetTextDatum(backend_info->replication_state); i++; nulls[i] = false; values[i] = CStringGetTextDatum(backend_info->replication_sync_state); i++; nulls[i] = false; localtime_r(&backend_info->status_changed_time, &tm); strftime(datebuf, sizeof(datebuf), "%F %T", &tm); values[i] = 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); } /** * 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_health_check_stats(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; POOL_HEALTH_CHECK_STATS *stats; Datum values[20]; /* values to build the returned tuple from */ bool nulls[] = {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}; TupleDesc tupledesc; HeapTuple tuple; AttrNumber an; int i; 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_health_check_stats(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(20); #else tupledesc = CreateTemplateTupleDesc(20, false); #endif an = 1; TupleDescInitEntry(tupledesc, an++, "node_id", INT4OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "hostname", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "port", INT4OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "status", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "role", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "last_status_change", TIMESTAMPOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "total_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "success_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "fail_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "skip_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "retry_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "average_retry_count", FLOAT4OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "max_retry_count", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "max_health_check_duration", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "min_health_check_duration", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "average_health_check_duration", FLOAT4OID, -1, 0); TupleDescInitEntry(tupledesc, an++, "last_health_check", TIMESTAMPOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "last_successful_health_check", TIMESTAMPOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "last_skip_health_check", TIMESTAMPOID, -1, 0); TupleDescInitEntry(tupledesc, an++, "last_failed_health_check", TIMESTAMPOID, -1, 0); tupledesc = BlessTupleDesc(tupledesc); stats = (POOL_HEALTH_CHECK_STATS *) pcp_get_binary_data(pcpResInfo, 0); /* set values */ i = 0; values[i++] = Int32GetDatum(nodeID); values[i++] = CStringGetTextDatum(stats->hostname); values[i++] = Int32GetDatum(atoi(stats->port)); values[i++] = CStringGetTextDatum(stats->status); values[i++] = CStringGetTextDatum(stats->role); if (*stats->last_status_change == '\0') nulls[i++] = true; else values[i++] = str2timestamp(stats->last_status_change); values[i++] = Int64GetDatum(atol(stats->total_count)); values[i++] = Int64GetDatum(atol(stats->success_count)); values[i++] = Int64GetDatum(atol(stats->fail_count)); values[i++] = Int64GetDatum(atol(stats->skip_count)); values[i++] = Int64GetDatum(atol(stats->retry_count)); values[i++] = Float4GetDatum(atof(stats->average_retry_count)); values[i++] = Int64GetDatum(atol(stats->max_retry_count)); values[i++] = Int64GetDatum(atol(stats->max_health_check_duration)); values[i++] = Int64GetDatum(atol(stats->min_health_check_duration)); values[i++] = Float4GetDatum(atof(stats->average_health_check_duration)); if (*stats->last_health_check =='\0' ) nulls[i++] = true; else values[i++] = str2timestamp(stats->last_health_check); if (*stats->last_successful_health_check == '\0') nulls[i++] = true; else values[i++] = str2timestamp(stats->last_successful_health_check); if (*stats->last_skip_health_check == '\0') nulls[i++] = true; else values[i++] = str2timestamp(stats->last_skip_health_check); if (*stats->last_failed_health_check == '\0') nulls[i++] = true; else values[i++] = str2timestamp(stats->last_failed_health_check); 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)); } static Timestamp str2timestamp(char *str) { return (DatumGetTimestamp(DirectFunctionCall3(timestamp_in, CStringGetDatum(str), ObjectIdGetDatum(InvalidOid), Int32GetDatum(-1)))); } pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm.h0000664000175000017500000000166314760001620016246 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_health_check_stats(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_health_check_stats); 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.6.0/src/sql/pgpool_adm/pgpool_adm.control0000664000175000017500000000022214760007565017503 00000000000000# pcp extension comment = 'Administrative functions for pgPool' default_version = '1.5' module_pathname = '$libdir/pgpool_adm' relocatable = true pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.1.sql0000664000175000017500000000513514760001620017166 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.6.0/src/sql/pgpool_adm/pgpool_adm--1.0--1.1.sql0000664000175000017500000000143614760001620017537 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.6.0/src/sql/pgpool_adm/pgpool_adm--1.0.sql0000664000175000017500000000501614760001620017163 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.6.0/src/sql/pgpool_adm/pgpool_adm--1.2.sql0000664000175000017500000000523214760001620017165 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.6.0/src/sql/pgpool_adm/pgpool_adm--1.1--1.2.sql0000664000175000017500000000160314760001620017535 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 CREATE FUNCTION pcp_health_check_stats(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp); RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.3.sql0000664000175000017500000001017614760001620017171 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.3.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password 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, pcp_server */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN pcp_server 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, host, port, username, password */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_id integer, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT success_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN pcp_server text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_pool_status(IN pcp_server 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(IN host text, IN port integer, IN username text, IN password text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_node_count(IN pcp_server 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(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_attach_node(IN node_id integer, IN pcp_server 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(IN node_id integer, IN gracefully boolean, IN host text, IN port integer, IN username text, IN password text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, pcp_server */ CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN pcp_server text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.2--1.3.sql0000664000175000017500000001353714760001620017550 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.2--1.3.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.3'" to load this file. \quit CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_id integer, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT success_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN pcp_server text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; 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, OUT role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp); DROP 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); CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password 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; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); DROP FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); CREATE FUNCTION pcp_node_info(IN node_id integer, IN pcp_server 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; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer); DROP FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer); CREATE FUNCTION pcp_node_count(IN host text, IN port integer, IN username text, IN password text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_count(text, OUT node_count integer); DROP FUNCTION pcp_node_count(text, OUT node_count integer); CREATE FUNCTION pcp_node_count(IN pcp_server text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean); DROP FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean); CREATE FUNCTION pcp_attach_node(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean); DROP FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean); CREATE FUNCTION pcp_attach_node(IN node_id integer, IN pcp_server text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean); DROP FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean); CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN host text, IN port integer, IN username text, IN password text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean); DROP FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean); CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN pcp_server text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.4.sql0000664000175000017500000001024414760007565017204 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.4.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT host text, OUT port integer, OUT status text, OUT pg_status text, OUT weight float4, OUT role text, OUT pg_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, pcp_server */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN pcp_server 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, host, port, username, password */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_id integer, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT success_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN pcp_server text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_pool_status(IN pcp_server 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(IN host text, IN port integer, IN username text, IN password text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_node_count(IN pcp_server 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(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_attach_node(IN node_id integer, IN pcp_server 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(IN node_id integer, IN gracefully boolean, IN host text, IN port integer, IN username text, IN password text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, pcp_server */ CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN pcp_server text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.3--1.4.sql0000664000175000017500000001515514760007565017566 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.3--1.4.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.4'" to load this file. \quit CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_id integer, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT success_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN pcp_server text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT host text, OUT port integer, OUT status text, OUT pg_status text, OUT weight float4, OUT role text, OUT pg_role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp) ALTER EXTENSION pgpool_adm CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT host text, OUT port integer, OUT status text, OUT pg_status text, OUT weight float4, OUT role text, OUT pg_role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp) 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, OUT role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp); DROP 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); CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password 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; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); DROP FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); CREATE FUNCTION pcp_node_info(IN node_id integer, IN pcp_server 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; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer); DROP FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer); CREATE FUNCTION pcp_node_count(IN host text, IN port integer, IN username text, IN password text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_count(text, OUT node_count integer); DROP FUNCTION pcp_node_count(text, OUT node_count integer); CREATE FUNCTION pcp_node_count(IN pcp_server text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean); DROP FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean); CREATE FUNCTION pcp_attach_node(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean); DROP FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean); CREATE FUNCTION pcp_attach_node(IN node_id integer, IN pcp_server text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean); DROP FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean); CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN host text, IN port integer, IN username text, IN password text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean); DROP FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean); CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN pcp_server text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.5.sql0000664000175000017500000001026014760007565017203 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.5.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT host text, OUT port integer, OUT status text, OUT pg_status text, OUT weight float4, OUT role text, OUT pg_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, pcp_server */ CREATE FUNCTION pcp_node_info(IN node_id integer, IN pcp_server 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, host, port, username, password */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_id integer, OUT host text, OUT port integer, OUT status text, OUT role text, OUT last_status_change timestamp, OUT total_count bigint, OUT success_count bigint, OUT fail_count bigint, OUT skip_count bigint, OUT retry_count bigint, OUT average_retry_count float4, OUT max_retry_count bigint, OUT max_health_check_duration bigint, OUT min_health_check_duration bigint, OUT average_health_check_duration float4, OUT last_health_check timestamp, OUT last_successful_health_check timestamp, OUT last_skip_health_check timestamp, OUT last_failed_health_check timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_health_check_stats(IN node_id integer, IN pcp_server text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_health_check_stats' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_node_count(IN host text, IN port integer, IN username text, IN password text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ CREATE FUNCTION pcp_node_count(IN pcp_server 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(IN node_id integer, IN host text, IN port integer, IN username text, IN password text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, pcp_server */ CREATE FUNCTION pcp_attach_node(IN node_id integer, IN pcp_server 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(IN node_id integer, IN gracefully boolean, IN host text, IN port integer, IN username text, IN password text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, pcp_server */ CREATE FUNCTION pcp_detach_node(IN node_id integer, IN gracefully boolean, IN pcp_server text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/pgpool_adm--1.4--1.5.sql0000664000175000017500000000244014760007565017561 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.4--1.5.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.5'" to load this file. \quit /** * input parameters: host, port, username, password */ ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN host text, IN port integer, IN username text, IN password text, OUT item text, OUT value text, OUT description text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: pcp_server */ ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text); DROP FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text); CREATE FUNCTION pcp_pool_status(IN pcp_server text, OUT item text, OUT value text, OUT description text) RETURNS SETOF record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; pgpool-II-4.6.0/src/sql/pgpool_adm/Makefile0000664000175000017500000000202514760007565015423 00000000000000# contrib/pgpool_adm/Makefile MODULE_big = pgpool_adm OBJS = pgpool_adm.o PG_CPPFLAGS = -I$(libpq_srcdir) -I../../include/pcp -DPGPOOL_ADM EXTENSION = pgpool_adm DATA = pgpool_adm--1.0.sql pgpool_adm--1.1.sql pgpool_adm--1.2.sql pgpool_adm--1.3.sql \ pgpool_adm--1.0--1.1.sql pgpool_adm--1.1--1.2.sql pgpool_adm--1.2--1.3.sql \ pgpool_adm--1.4.sql pgpool_adm--1.3--1.4.sql \ pgpool_adm--1.5.sql pgpool_adm--1.4--1.5.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.6.0/src/sql/pgpool-recovery/0000775000175000017500000000000014760010071015041 500000000000000pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool-recovery.c0000664000175000017500000002567114760007565020312 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() >= 7) /* Pgpool-II 4.3 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)))); char *primary_host = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(6)))); snprintf(recovery_script, sizeof(recovery_script), "\"%s/%s\" \"%s\" \"%s\" \"%s\" \"%s\" %d \"%s\" \"%s\"", DataDir, script, DataDir, remote_host, remote_data_directory, primary_port, remote_node, remote_port, primary_host); } else if (PG_NARGS() >= 6) /* Pgpool-II 4.1 or 4.2 */ { 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 * invalid_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.6.0/src/sql/pgpool-recovery/pgpool-recovery.sql.in0000664000175000017500000000302214760007565021256 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, IN primary_host 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, 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.6.0/src/sql/pgpool-recovery/uninstall_pgpool-recovery.sql0000664000175000017500000000021014760001620022720 00000000000000DROP FUNCTION pgpool_switch_xlog(text); DROP FUNCTION pgpool_remote_start(text, text); DROP FUNCTION pgpool_recovery(text, text, text); pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.4.sql0000664000175000017500000000337214760007565021320 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, IN primary_host 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, IN remote_port text) RETURNS bool AS '$libdir/pgpool-recovery', '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 archive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.3--1.4.sql0000664000175000017500000000072214760007565021670 00000000000000/* contrib/pgpool_recovery/pgpool_recovery--1.3--1.4.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_recovery UPDATE TO '1.4'" 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, primary_host text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.3.sql0000664000175000017500000000271714760007565021321 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 archive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.2--1.3.sql0000664000175000017500000000067714760001620021661 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.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.2.sql0000664000175000017500000000230614760007565021312 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 archive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.1--1.2.sql0000664000175000017500000000065514760001620021653 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.6.0/src/sql/pgpool-recovery/pgpool_recovery--1.1.sql0000664000175000017500000000172514760007565021315 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 archive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-recovery/pgpool_recovery.control0000664000175000017500000000025114760007565021615 00000000000000# pgpool-recovery extension comment = 'recovery functions for pgpool-II for V4.3' default_version = '1.4' module_pathname = '$libdir/pgpool-recovery' relocatable = true pgpool-II-4.6.0/src/sql/pgpool-recovery/Makefile0000664000175000017500000000152314760007565016440 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 \ pgpool_recovery--1.4.sql pgpool_recovery--1.3--1.4.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.6.0/src/sql/pgpool-regclass/0000775000175000017500000000000014760010071015006 500000000000000pgpool-II-4.6.0/src/sql/pgpool-regclass/pgpool-regclass.c0000664000175000017500000001206514760007565020215 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * Copyright (c) 2003-2022 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 * regclass but does not throw exceptions. * If something goes wrong, it returns InvalidOid. */ #include #include #include #include #include "postgres.h" #include "catalog/namespace.h" #include "commands/dbcommands.h" #include "fmgr.h" #include "funcapi.h" #include "nodes/makefuncs.h" #include "utils/builtins.h" #include "utils/elog.h" #include "utils/syscache.h" #include "utils/varlena.h" #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 invalid_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.6.0/src/sql/pgpool-regclass/pgpool-regclass.sql.in0000664000175000017500000000017314760001620021156 00000000000000CREATE FUNCTION pg_catalog.pgpool_regclass(cstring) RETURNS oid AS 'MODULE_PATHNAME', 'pgpool_regclass' LANGUAGE C STRICT; pgpool-II-4.6.0/src/sql/pgpool-regclass/uninstall_pgpool-regclass.sql0000664000175000017500000000005014760001620022634 00000000000000DROP FUNCTION pgpool_regclass(cstring); pgpool-II-4.6.0/src/sql/pgpool-regclass/pgpool_regclass--1.0.sql0000664000175000017500000000043314760001620021203 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.6.0/src/sql/pgpool-regclass/pgpool_regclass.control0000664000175000017500000000023014760001620021506 00000000000000# pgpool-regclass extension comment = 'replacement for regclass' default_version = '1.0' module_pathname = '$libdir/pgpool-regclass' relocatable = true pgpool-II-4.6.0/src/sql/pgpool-regclass/Makefile0000664000175000017500000000125014760001620016364 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.6.0/src/sql/Makefile0000664000175000017500000000257714760001620013300 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.6.0/src/sql/insert_lock.sql0000664000175000017500000000115114760001620014660 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.6.0/src/streaming_replication/0000775000175000017500000000000014760010070015467 500000000000000pgpool-II-4.6.0/src/streaming_replication/pool_worker_child.c0000664000175000017500000004654714760007565021317 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "pool_config.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "utils/pool_ip.h" #include "utils/ps_status.h" #include "utils/pool_stream.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "protocol/pool_process_query.h" #include "protocol/pool_pg_utils.h" #include "main/pool_internal_comms.h" #include "auth/md5.h" #include "auth/pool_hba.h" #include "watchdog/wd_internal_commands.h" #include "watchdog/watchdog.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); static void sr_check_will_die(int code, Datum arg); #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 */ static volatile bool follow_primary_lock_acquired; /* * 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); /* * install the call back for preparation of exit */ on_system_exit(sr_check_will_die, (Datum) NULL); /* 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 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); /* * Since WorkerMemoryContext is used for "slots", we need to clear it * so that new slots are allocated later on. */ memset(slots, 0, sizeof(slots)); bool watchdog_leader; /* true if I am the watchdog leader */ CHECK_REQUEST; if (pool_config->sr_check_period <= 0) { sleep(30); } /* * Get watchdog status if watchdog is enabled. */ watchdog_leader = false; if (pool_config->use_watchdog) { WD_STATES wd_status; WDPGBackendStatus *backendStatus; wd_status = wd_internal_get_watchdog_local_node_state(); ereport(DEBUG1, (errmsg("watchdog status: %d", wd_status))); /* * Ask the watchdog to get all the backend states from the * Leader/Coordinator Pgpool-II node. */ watchdog_leader = false; backendStatus = get_pg_backend_status_from_leader_wd_node(); if (!backendStatus) /* * Couldn't get leader status. */ watchdog_leader = false; else { int quorum = wd_internal_get_watchdog_quorum_state(); int node_count = backendStatus->node_count; ereport(DEBUG1, (errmsg("quorum: %d node_count: %d", quorum, node_count))); if (quorum >= 0 && backendStatus->node_count <= 0) { /* * Quorum exists and node_count <= 0. * Definitely I am the leader. */ watchdog_leader = true; } else watchdog_leader = false; pfree(backendStatus); } } /* * If streaming replication mode, do time lag checking * Also skip if failover/failback is ongoing. */ if (pool_config->sr_check_period > 0 && STREAM && Req_info->switching == false) { /* * Acquire follow primary lock. If fail to acquire lock, try again. */ follow_primary_lock_acquired = false; if (pool_acquire_follow_primary_lock(false, false) == true) { follow_primary_lock_acquired = true; 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 detach_false_primary is enabled, send * degenerate request to detach invalid node. */ if (pool_config->detach_false_primary) { /* * However if watchdog is enabled and I am not * the leader, do not detach the invalid node * because the information to determine the * false primary might be outdated or * temporarily inconsistent. See * [pgpool-hackers: 4431] for more details. */ if (!pool_config->use_watchdog || (pool_config->use_watchdog && watchdog_leader)) { n = i; /* * In the case watchdog enabled, we need * to add REQ_DETAIL_CONFIRMED, which * means no quorum consensus is * required. If we do not add this, the * target node will remain quarantine * state since other node does not request * failover. */ degenerate_backend_set(&n, 1, REQ_DETAIL_SWITCHOVER|REQ_DETAIL_CONFIRMED); } else if (pool_config->use_watchdog) ereport(LOG, (errmsg("do not detach invalid node %d because I am not the leader or quorum does not exist", i))); } } } } PG_CATCH(); { discard_persistent_connection(); pool_release_follow_primary_lock(false); follow_primary_lock_acquired = false; sleep(pool_config->sr_check_period); PG_RE_THROW(); } PG_END_TRY(); /* Discard persistent connections */ discard_persistent_connection(); if (follow_primary_lock_acquired) { pool_release_follow_primary_lock(false); follow_primary_lock_acquired = false; } } } 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 : "", false); } } 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 */ uint64 lsn[MAX_NUM_BACKENDS]; char *query; char *stat_rep_query; BackendInfo *bkinfo; uint64 lag; uint64 delay_threshold_by_time; ErrorContextCallback callback; int active_standby_node; bool replication_delay_by_time; /* 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; } if (!VALID_BACKEND(REAL_PRIMARY_NODE_ID)) { /* * No need to check replication delay if primary is down. This could * happen if ALWAYS_PRIMARY flag is on because REAL_PRIMARY_NODE_ID * macro returns the node id which ALWAYS_PRIMARY flag is set to. If * we do not check this, subsequent test (i == PRIMARY_NODE_ID) in the * for loop below will return unexpected result because * PRIMARY_NODE_ID macro returns MAIN_NODE_ID, which could be a * standby server. */ 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; replication_delay_by_time = false; 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 pg_catalog.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_catalog.pg_current_wal_lsn()"; else query = "SELECT pg_catalog.pg_current_xlog_location()"; if (server_version[i] == PG91_SERVER_VERSION) stat_rep_query = "SELECT application_name, state, '' AS sync_state, '' AS replay_lag FROM pg_catalog.pg_stat_replication"; else if (server_version[i] >= PG10_SERVER_VERSION) { stat_rep_query = "SELECT application_name, state, sync_state,(EXTRACT(EPOCH FROM replay_lag)*1000000)::BIGINT FROM pg_catalog.pg_stat_replication"; if (pool_config->delay_threshold_by_time > 0) replication_delay_by_time = true; } else if (server_version[i] > PG91_SERVER_VERSION) stat_rep_query = "SELECT application_name, state, sync_state, '' AS replay_lag FROM pg_catalog.pg_stat_replication"; } else { if (server_version[i] >= PG10_SERVER_VERSION) query = "SELECT pg_catalog.pg_last_wal_replay_lsn()"; else query = "SELECT pg_catalog.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 failed: 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; #define NUM_COLS 4 for (j = 0; j < res_rep->numrows; j++) { if (strcmp(res_rep->data[j*NUM_COLS], 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*NUM_COLS+1]? res_rep->data[j*NUM_COLS+1] : ""; strlcpy(bkinfo->replication_state, s, NAMEDATALEN); s = res_rep->data[j*NUM_COLS+2]? res_rep->data[j*NUM_COLS+2] : ""; strlcpy(bkinfo->replication_sync_state, s, NAMEDATALEN); s = res_rep->data[j*NUM_COLS+3]; if (s) { bkinfo->standby_delay = atol(s); ereport(DEBUG1, (errmsg("standby delay in milli seconds * 1000: " UINT64_FORMAT "", bkinfo->standby_delay))); } else bkinfo->standby_delay = 0; } } } } 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 { if (replication_delay_by_time) { /* * If replication delay is measured by time, indicate it in * shared memory area. */ bkinfo->standby_delay_by_time = true; } else { /* * If replication delay is not measured by time, set the LSN * lag to shared memory area. */ bkinfo->standby_delay = lag; bkinfo->standby_delay_by_time = false; } /* Log delay if necessary */ if (replication_delay_by_time) { lag = bkinfo->standby_delay; delay_threshold_by_time = pool_config->delay_threshold_by_time; delay_threshold_by_time *= 1000; /* convert from milli seconds to micro seconds */ /* Log delay if necessary */ if ((pool_config->log_standby_delay == LSD_ALWAYS && lag > 0) || (pool_config->log_standby_delay == LSD_OVER_THRESHOLD && lag > delay_threshold_by_time)) { ereport(LOG, (errmsg("Replication of node: %d is behind %.6f second(s) from the primary server (node: %d)", i, ((float)lag)/1000000, PRIMARY_NODE_ID))); } } else { 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 " UINT64_FORMAT " bytes from the primary server (node: %d)", i, (uint64)(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; } static void sr_check_will_die(int code, Datum arg) { if (follow_primary_lock_acquired) pool_release_follow_primary_lock(false); } pgpool-II-4.6.0/src/test/0000775000175000017500000000000014760010071012065 500000000000000pgpool-II-4.6.0/src/test/C/0000775000175000017500000000000014760010071012247 500000000000000pgpool-II-4.6.0/src/test/C/Makefile0000664000175000017500000000054314760001620013631 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.6.0/src/test/C/test_extended.c0000664000175000017500000000474114760007565015216 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 before 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.6.0/src/test/parser/0000775000175000017500000000000014760010071013361 500000000000000pgpool-II-4.6.0/src/test/parser/expected/0000775000175000017500000000000014760010071015162 500000000000000pgpool-II-4.6.0/src/test/parser/expected/copy.out0000664000175000017500000000106614760001620016610 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.6.0/src/test/parser/expected/create.out0000664000175000017500000000637514760001620017111 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.6.0/src/test/parser/expected/cursor.out0000664000175000017500000000200014760001620017140 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.6.0/src/test/parser/expected/delete.out0000664000175000017500000000104214760001620017072 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.6.0/src/test/parser/expected/drop.out0000664000175000017500000000061714760001620016603 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.6.0/src/test/parser/expected/insert.out0000664000175000017500000000111414760001620017134 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.6.0/src/test/parser/expected/misc.out0000664000175000017500000000055714760001620016575 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.6.0/src/test/parser/expected/prepare.out0000664000175000017500000000016614760001620017274 00000000000000PREPARE "xx" (int4,"text") AS INSERT INTO "foo" VALUES ($1,$2) EXECUTE "xx" (1,'xxx') DEALLOCATE "xx" DEALLOCATE "xx" pgpool-II-4.6.0/src/test/parser/expected/privileges.out0000664000175000017500000000337414760001620020013 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.6.0/src/test/parser/expected/scanner.out0000664000175000017500000000105514760001620017265 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.6.0/src/test/parser/expected/select.out0000664000175000017500000000765214760001620017124 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.6.0/src/test/parser/expected/transaction.out0000664000175000017500000000201414760001620020155 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.6.0/src/test/parser/expected/update.out0000664000175000017500000000072414760001620017120 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.6.0/src/test/parser/expected/v84.out0000664000175000017500000000332314760001620016255 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.6.0/src/test/parser/expected/v90.out0000664000175000017500000000224014760001620016247 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.6.0/src/test/parser/expected/var.out0000664000175000017500000000063114760007565016441 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 OPTION DOCUMENT SET XML OPTION 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.6.0/src/test/parser/input/0000775000175000017500000000000014760010071014520 500000000000000pgpool-II-4.6.0/src/test/parser/input/alter.sql0000664000175000017500000000006214760001620016266 00000000000000ALTER TABLE foo ; ALTER TEXT SEARCH CONFIGURATION pgpool-II-4.6.0/src/test/parser/input/copy.sql0000664000175000017500000000101314760001620016126 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.6.0/src/test/parser/input/create.sql0000664000175000017500000000553314760001620016432 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.6.0/src/test/parser/input/cursor.sql0000664000175000017500000000162014760001620016475 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.6.0/src/test/parser/input/delete.sql0000664000175000017500000000074714760001620016433 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.6.0/src/test/parser/input/drop.sql0000664000175000017500000000054614760001620016132 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.6.0/src/test/parser/input/insert.sql0000664000175000017500000000100314760001620016457 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.6.0/src/test/parser/input/misc.sql0000664000175000017500000000102614760001620016113 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.6.0/src/test/parser/input/prepare.sql0000664000175000017500000000017214760001620016617 00000000000000PREPARE xx(integer, text) AS INSERT INTO foo VALUES ($1, $2); EXECUTE xx(1, 'xxx'); DEALLOCATE xx; DEALLOCATE PREPARE xx; pgpool-II-4.6.0/src/test/parser/input/privileges.sql0000664000175000017500000000311014760001620017325 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.6.0/src/test/parser/input/scanner.sql0000664000175000017500000000155314760001620016616 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.6.0/src/test/parser/input/select.sql0000664000175000017500000000675014760001620016450 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.6.0/src/test/parser/input/transaction.sql0000664000175000017500000000201314760001620017502 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.6.0/src/test/parser/input/update.sql0000664000175000017500000000061314760001620016443 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.6.0/src/test/parser/input/v84.sql0000664000175000017500000000304314760001620015602 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.6.0/src/test/parser/input/v90.sql0000664000175000017500000000250014760001620015574 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.6.0/src/test/parser/input/var.sql0000664000175000017500000000063514760001620015755 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.6.0/src/test/parser/.cvsignore0000664000175000017500000000006314760001620015300 00000000000000gram.c parse.h parser-test scan.c test.diff result pgpool-II-4.6.0/src/test/parser/Makefile0000664000175000017500000000402014760007565014753 00000000000000# $Header$ PROGRAM=parser-test PGPOOL_SRC=../../../src/parser PARSER_INCLUDES=../../../src/include/parser PARSER_OBJS=gram.o parser.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 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.6.0/src/test/parser/README0000664000175000017500000000113114760001620014155 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.6.0/src/test/parser/main.c0000664000175000017500000000322014760001620014366 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.6.0/src/test/parser/pool.h0000664000175000017500000000020114760001620014414 00000000000000#ifndef POOL_H #define POOL_H #include #include #define pool_error printf #define child_exit exit #endif pgpool-II-4.6.0/src/test/parser/run-test0000664000175000017500000000224214760001620015005 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.6.0/src/test/parser/parse_schedule0000664000175000017500000000015414760001620016212 00000000000000select insert update delete misc var copy privileges transaction cursor prepare create drop scanner v84 v90 pgpool-II-4.6.0/src/test/pdo-test/0000775000175000017500000000000014760010071013624 500000000000000pgpool-II-4.6.0/src/test/pdo-test/mod/0000775000175000017500000000000014760010071014403 500000000000000pgpool-II-4.6.0/src/test/pdo-test/mod/database.inc0000664000175000017500000000144314760001620016564 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.6.0/src/test/pdo-test/mod/errorhandler.inc0000664000175000017500000000147014760001620017507 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.6.0/src/test/pdo-test/SQLlist/0000775000175000017500000000000014760010071015157 500000000000000pgpool-II-4.6.0/src/test/pdo-test/SQLlist/test1.sql0000664000175000017500000000002614760001620016656 00000000000000BEGIN; SELECT 1; END; pgpool-II-4.6.0/src/test/pdo-test/SQLlist/test2.sql0000664000175000017500000000002614760001620016657 00000000000000BEGIN; select 2; END; pgpool-II-4.6.0/src/test/pdo-test/README.euc_jp0000664000175000017500000000314014760001620015666 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.6.0/src/test/pdo-test/collections.inc0000664000175000017500000000040114760001620016550 00000000000000"; } return $result; } ?> pgpool-II-4.6.0/src/test/pdo-test/def.inc0000664000175000017500000000022214760001620014771 00000000000000 pgpool-II-4.6.0/src/test/pdo-test/pdotest.php0000664000175000017500000000033114760001620015734 00000000000000 pgpool-II-4.6.0/src/test/pdo-test/regsql.inc0000664000175000017500000000171614760001620015541 00000000000000"; trans_end($con,$sql); } } ?> pgpool-II-4.6.0/src/test/pgpool_setup.in0000664000175000017500000013245314760007565015103 00000000000000#!/usr/bin/env bash # # Copyright (c) 2013-2022 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][-e][-t][-c] # -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. # -m i: create an installation as snapshot isolation 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. # -e: do not create PostgreSQL clusters # -t: enable testing facility # # The user run this script will become the PostgreSQL super user as # well. Current directory must be empty. Assume that appropriate # pgpool and PostgreSQL binaries are in the command search path. # The user must have passwordless access to localhost over SSH. # # Layout 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=${BASEPORT:-"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"} # Test RPMs using sample scripts and config files TEST_SAMPLES=${TEST_SAMPLES:-"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}'` if [ $major1 -ge 10 ];then major2=0 else major2=`echo $vstr|awk '{print $2}'` fi 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 location. CONF=$BASEDIR/etc/pgpool.conf # failover script FAILOVER_SCRIPT=$BASEDIR/etc/failover.sh # follow primary script FOLLOW_PRIMARY_SCRIPT=$BASEDIR/etc/follow_primary.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=localhost #------------------------------------------- # create failover script #------------------------------------------- function create_failover_script() { # If $TEST_SAMPLES = "true", use sample scripts and config files if [ $TEST_SAMPLES = "true" ]; then cp -p $PGPOOLDIR/sample_scripts/failover.sh.sample $FAILOVER_SCRIPT # Rewrite script PGHOMEVER=`expr $PGVERSION / 10` /bin/sed -i \ -e "s/^REPLUSER=.*/REPLUSER=$WHOAMI/" \ -e "s/^PCP_USER=.*/PCP_USER=$WHOAMI/" \ -e "s/^PGHOME=.*/PGHOME=\/usr\/pgsql-$PGHOMEVER/" \ -e "s/^PCP_PORT=.*/PCP_PORT=$PCP_PORT/" \ -e "s/^POSTGRESQL_STARTUP_USER=.*/POSTGRESQL_STARTUP_USER=$WHOAMI/" \ -e "s/^SSH_KEY_FILE=.*/SSH_KEY_FILE=id_rsa/" \ -e "s/^REPL_SLOT_NAME=.*/REPL_SLOT_NAME=pgpool_setup_slot\${FAILED_NODE_ID}/" \ -e "/^SSH_KEY_FILE=/a source $BASEDIR/bashrc.ports" \ $FAILOVER_SCRIPT chmod 755 $FAILOVER_SCRIPT return; fi 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 main node id # %M = old main node id # %H = new main node host name # %P = old primary node id # %R = new main database cluster path # %r = new main port number # %% = '%' character failed_node_id=$1 failed_host_name=$2 failed_port=$3 failed_db_cluster=$4 new_main_id=$5 new_main_host_name=$6 old_main_id=$7 old_primary_node_id=$8 new_main_port_number=$9 new_main_db_cluster=${10} mydir=__MYDIR__ log=$mydir/log/failover.log pg_ctl=__PGBIN__/pg_ctl PCP_PORT=__PCPPORT__ pgversion=__PGVERSION__ export PCPPASSFILE=__PCPPASSFILE__ PGPOOL_BIN=__PGPOOL_INSTALL_DIR__/bin date >> $log echo "failover script started for node: $failed_node_id" >> $log echo "failed_node_id: $failed_node_id failed_host_name: $failed_host_name failed_port: $failed_port" >> $log echo "failed_db_cluster: $failed_db_cluster new_main_id: $new_main_id old_main_id: $old_main_id" >> $log echo "new_main_host_name: $new_main_host_name old_primary_node_id: $old_primary_node_id" >> $log echo "new_main_port_number: $new_main_port_number new_main_db_cluster: $new_main_db_cluster" >> $log # check if all node is down if [ $new_main_id = "-1" ];then echo "no new main node is available" >>$log exit 0 fi if [ a"$failed_node_id" = a"$old_primary_node_id" -o a"$old_primary_node_id" = a"-1" ];then # main node failed new_primary_db_cluster=${mydir}/data"$new_main_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 date >> $log echo "failover script ended" >> $log 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/" \ -e "/__PGVERSION__/s/__PGVERSION__/$PGVERSION/" \ -e "/__PGPOOL_INSTALL_DIR__/s@__PGPOOL_INSTALL_DIR__@$PGPOOL_INSTALL_DIR@" \ $FAILOVER_SCRIPT chmod 755 $FAILOVER_SCRIPT } #------------------------------------------- # create follow primary script #------------------------------------------- function create_follow_primary_script() { # If $TEST_SAMPLES = "true", use sample scripts and config files if [ $TEST_SAMPLES = "true" ]; then cp -p $PGPOOLDIR/sample_scripts/follow_primary.sh.sample $FOLLOW_PRIMARY_SCRIPT # Rewrite script PGHOMEVER=`expr $PGVERSION / 10` /bin/sed -i \ -e "s/^REPLUSER=.*/REPLUSER=$WHOAMI/" \ -e "s/^PCP_USER=.*/PCP_USER=$WHOAMI/" \ -e "s/^PGHOME=.*/PGHOME=\/usr\/pgsql-$PGHOMEVER/" \ -e "s/^PCP_PORT=.*/PCP_PORT=$PCP_PORT/" \ -e "s/^POSTGRESQL_STARTUP_USER=.*/POSTGRESQL_STARTUP_USER=$WHOAMI/" \ -e "s/^SSH_KEY_FILE=.*/SSH_KEY_FILE=id_rsa/" \ -e "s/^REPL_SLOT_NAME=.*/REPL_SLOT_NAME=pgpool_setup_slot\${NODE_ID}/" \ -e "/^SSH_KEY_FILE=/a source $BASEDIR/bashrc.ports" \ -e "s@^ARCHIVEDIR=.*@ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$NODE_PGDATA\`@" \ -e "/^ARCHIVEDIR=.*/a NEW_PRIMARY_ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$NEW_PRIMARY_NODE_PGDATA\`" \ -e "/restore_command =.*/s/\${ARCHIVEDIR}/\${NEW_PRIMARY_ARCHIVEDIR}/g" \ $FOLLOW_PRIMARY_SCRIPT chmod 755 $FOLLOW_PRIMARY_SCRIPT return; fi cat >> $FOLLOW_PRIMARY_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 primary node id # %M = old main node id # %H = new primary node host name # %P = old primary node id # %R = new primary database cluster path # %r = new primary port number # %N = old primary node host name # %S = old primary node port number # %% = '%' character node_id=$1 host_name=$2 port=$3 db_cluster=$4 new_primary_id=$5 new_primary_host_name=$6 old_main_id=$7 old_primary_node_id=$8 new_primary_port_number=$9 new_primary_db_cluster=${10} mydir=__MYDIR__ log=$mydir/log/failover.log pg_ctl=__PGBIN__/pg_ctl PCP_PORT=__PCPPORT__ pgversion=__PGVERSION__ export PCPPASSFILE=__PCPPASSFILE__ PGPOOL_BIN=__PGPOOL_INSTALL_DIR__/bin echo "follow primary script started for node: $node_id" >> $log date >> $log echo "node_id: $node_id host_name: $host_name port: $port db_cluster: $db_cluster" >> $log echo "new_primary_id: $new_primary_id old_main_id: $old_main_id new_main_host_name: $new_main_host_name" >> $log echo "old_primary_node_id: $old_primary_node_id: new_primary_port_number: $new_primary_port_number new_primary_db_cluster: $new_primary_db_cluster" >> $log # Skip the target standby node if it's not running $pg_ctl -D $db_cluster status >/dev/null 2>&1 if [ $? = 0 ] then # change primary node connection info so that it points to the new primary if [ $pgversion -ge 120 ];then sed -i "s/port=[0-9]*/port=$new_primary_port_number/" $db_cluster/myrecovery.conf sed -i "/restore_command/s/data[0-9]/`basename $new_primary_db_cluster`/" $db_cluster/myrecovery.conf else # if recovery.conf is not found, rename recovery.done. if [ ! -f $db_cluster/recovery.conf ];then mv $db_cluster/recovery.done $db_cluster/recovery.conf fi sed -i "s/port=[0-9]*/port=$new_primary_port_number/" $db_cluster/recovery.conf sed -i "/restore_command/s/data[0-9]/`basename $new_primary_db_cluster`/" $db_cluster/recovery.conf fi touch $db_cluster/standby.signal echo "restart the target server" >> $log $pg_ctl -w -m f -D $db_cluster restart >> $log 2>&1 $pg_ctl -D $db_cluster status >>$log 2>&1 if [ $? != 0 ] then echo "restarting $db_cluster failed" >>$log echo "fallback to pcp_recovery_node" >>$log $PGPOOL_BIN/pcp_recovery_node -w -h localhost -p $PCP_PORT -n $node_id >> $log 2>&1 else # attach the node $PGPOOL_BIN/pcp_attach_node -w -h localhost -p $PCP_PORT -n $node_id >> $log 2>&1 fi else echo "$db_cluster is not running. skipping follow primary command." >> $log fi echo "follow primary script ended." >> $log date >> $log 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/" \ -e "/__PGVERSION__/s/__PGVERSION__/$PGVERSION/" \ -e "/__PGPOOL_INSTALL_DIR__/s@__PGPOOL_INSTALL_DIR__@$PGPOOL_INSTALL_DIR@" \ $FOLLOW_PRIMARY_SCRIPT chmod 755 $FOLLOW_PRIMARY_SCRIPT } #------------------------------------------- # create pgpool_remote_start script # argument: PostgreSQL database cluster directory #------------------------------------------- function create_pgpool_remote_start_script() { # If $TEST_SAMPLES = "true", use sample scripts and config files if [ $TEST_SAMPLES = "true" ]; then cp -p $PGPOOLDIR/sample_scripts/pgpool_remote_start.sample $1/$PGPOOL_REMOTE_START_SCRIPT # Rewrite script PGHOMEVER=`expr $PGVERSION / 10` /bin/sed -i \ -e "s/^REPLUSER=.*/REPLUSER=$WHOAMI/" \ -e "s/^PCP_USER=.*/PCP_USER=$WHOAMI/" \ -e "s/^PGHOME=.*/PGHOME=\/usr\/pgsql-$PGHOMEVER/" \ -e "s/^PCP_PORT=.*/PCP_PORT=$PCP_PORT/" \ -e "s/^POSTGRESQL_STARTUP_USER=.*/POSTGRESQL_STARTUP_USER=$WHOAMI/" \ -e "s/^SSH_KEY_FILE=.*/SSH_KEY_FILE=id_rsa/" \ -e "/^SSH_KEY_FILE=/a source $BASEDIR/bashrc.ports" \ $1/$PGPOOL_REMOTE_START_SCRIPT chmod 755 $1/$PGPOOL_REMOTE_START_SCRIPT return; fi cat >> $1/$PGPOOL_REMOTE_START_SCRIPT <<'EOF' #! /bin/sh # # start postmaster on the recovered 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 %m '" >> $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 echo "max_wal_senders = `expr $NUMCLUSTERS + 10`" >> $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 if [ $USE_REPLICATION_SLOT = "false" ];then echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/`basename $1`/%f > $PGCONF # If $TEST_SAMPLES = "true", always enable replication slot if [ $TEST_SAMPLES = "true" ];then num_slots=`expr $NUMCLUSTERS + 10` echo "max_replication_slots = $num_slots" >> $PGCONF fi else num_slots=`expr $NUMCLUSTERS + 10` echo "max_replication_slots = $num_slots" >> $PGCONF fi elif [ $MODE = 'r' -o $MODE = 'n' -o $MODE = 'l' -o $MODE = 'y' -o $MODE = 'i' ];then echo "wal_level = 'archive'" >> $PGCONF echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/`basename $1`/%f > $PGCONF if [ $MODE = 'l' ];then echo "wal_level = 'logical'" >> $PGCONF fi fi # Snapshot isolation mode requires REPEATABLE READ transaction isolation mode. if [ $MODE = 'i' ];then echo "default_transaction_isolation = 'repeatable read'" >> $PGCONF 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 all scram-sha-256" >> $PGHBACONF echo "host all md5_user all md5" >> $PGHBACONF fi echo "host all all all 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 pg_basebackup=__PGBIN__/pg_basebackup PG_CTL=__PGBIN__/pg_ctl DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ MAX_DURATION=60 pgversion=__PGVERSION__ main_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 # Make backup copy of postgresql.conf since pg_rewind/pg_basebackup blindly copies # $main_db_cluster/postgresql.conf. cp $DEST_CLUSTER/postgresql.conf /tmp/ pg_rewind_failed="true" EOF echo "export PGHOST=localhost" >> $1/$SCRIPT if [ $USE_PG_REWIND = "true" ];then cat >> $1/$SCRIPT <<'EOF' # First try pg_rewind 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 pg_basebackup. 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 echo "source: $main_db_cluster dest: $DEST_CLUSTER" >> $log rm -fr $DEST_CLUSTER/* test -d $DEST_CLUSTER || mkdir $DEST_CLUSTER $pg_basebackup -w -U $PGSUPERUSER -p $PORT -D $DEST_CLUSTER -c fast 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/`basename $1`/%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' cp /tmp/postgresql.conf $DEST_CLUSTER/ 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/" \ -e "/__PGVERSION__/s/__PGVERSION__/$PGVERSION/" \ $1/$SCRIPT chmod 755 $1/$SCRIPT } #------------------------------------------- # create basebackup.sh for native replication mode and snapshot isolation mode. # argument1: full path to database cluster directory of main node # argument2: node number of target node #------------------------------------------- function create_basebackup_replication { CLUSTERDIR=$1 n=$2 SCRIPT=basebackup.sh # If $TEST_SAMPLES = "true", use sample scripts and config files if [ $TEST_SAMPLES = "true" ]; then cp -p $PGPOOLDIR/sample_scripts/replication_mode_recovery_1st_stage.sample $1/$SCRIPT # Rewrite script PGHOMEVER=`expr $PGVERSION / 10` /bin/sed -i \ -e "s/^REPLUSER=.*/REPLUSER=$WHOAMI/" \ -e "s/^PCP_USER=.*/PCP_USER=$WHOAMI/" \ -e "s/^PGHOME=.*/PGHOME=\/usr\/pgsql-$PGHOMEVER/" \ -e "s/^PCP_PORT=.*/PCP_PORT=$PCP_PORT/" \ -e "s/^POSTGRESQL_STARTUP_USER=.*/POSTGRESQL_STARTUP_USER=$WHOAMI/" \ -e "s/^SSH_KEY_FILE=.*/SSH_KEY_FILE=id_rsa/" \ -e "s/^REPL_SLOT_NAME=.*/REPL_SLOT_NAME=pgpool_setup_slot\${DEST_NODE_ID}/" \ -e "/^SSH_KEY_FILE=/a source $BASEDIR/bashrc.ports" \ -e "s@^ARCHIVEDIR=.*@ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$DEST_NODE_PGDATA\`@" \ -e "/^ARCHIVEDIR=.*/a NEW_PRIMARY_ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$MAIN_NODE_PGDATA\`" \ -e "/restore_command =.*/s/\${ARCHIVEDIR}/\${NEW_PRIMARY_ARCHIVEDIR}/g" \ $1/$SCRIPT chmod 755 $1/$SCRIPT return; fi create_basebackup_stream $CLUSTERDIR $n cat >> $1/$SCRIPT <<'EOF' # start target server as a streaming replication standby server $PG_CTL -w -D $DEST_CLUSTER start # wait till the standby catches up primary server or # $MAX_DURATION seconds passes sec=0 while [ $sec -lt $MAX_DURATION ] do sec=`expr $sec + 1` if [ $pgversion -ge 100 ];then result=`psql -p $4 -c "SELECT sent_lsn = replay_lsn FROM pg_stat_replication where application_name = 'server$recovery_node'" postgres|sed -n 3p|sed 's/ //'` else result=`psql -p $4 -c "SELECT sent_location = replay_location FROM pg_stat_replication where application_name = 'server$recovery_node'" postgres|sed -n 3p|sed 's/ //'` fi # echo "result: $result" if [ "$result" = "t" ];then sec=$MAX_DURATION fi sleep 1 done 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/" \ -e "/__ARCHDIR__/s@__ARCHDIR__@$BASEDIR/archivedir/\`basename \$1\`@" \ -e "/__PGVERSION__/s/__PGVERSION__/$PGVERSION/" \ $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 # If $TEST_SAMPLES = "true", use sample scripts and config files if [ $TEST_SAMPLES = "true" ]; then cp -p $PGPOOLDIR/sample_scripts/replication_mode_recovery_2nd_stage.sample $1/$SCRIPT # Rewrite script PGHOMEVER=`expr $PGVERSION / 10` /bin/sed -i \ -e "s/^REPLUSER=.*/REPLUSER=$WHOAMI/" \ -e "s/^PCP_USER=.*/PCP_USER=$WHOAMI/" \ -e "s/^PGHOME=.*/PGHOME=\/usr\/pgsql-$PGHOMEVER/" \ -e "s/^PCP_PORT=.*/PCP_PORT=$PCP_PORT/" \ -e "s/^POSTGRESQL_STARTUP_USER=.*/POSTGRESQL_STARTUP_USER=$WHOAMI/" \ -e "s/^SSH_KEY_FILE=.*/SSH_KEY_FILE=id_rsa/" \ -e "s/^REPL_SLOT_NAME=.*/REPL_SLOT_NAME=pgpool_setup_slot\${DEST_NODE_ID}/" \ -e "/^SSH_KEY_FILE=/a source $BASEDIR/bashrc.ports" \ -e "s@^ARCHIVEDIR=.*@ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$DEST_NODE_PGDATA\`@" \ -e "/^ARCHIVEDIR=.*/a NEW_PRIMARY_ARCHIVEDIR=${BASEDIR}/archivedir/\`basename \$MAIN_NODE_PGDATA\`" \ -e "/restore_command =.*/s/\${ARCHIVEDIR}/\${NEW_PRIMARY_ARCHIVEDIR}/g" \ $1/$SCRIPT chmod 755 $1/$SCRIPT return; fi cat >> $1/$SCRIPT <<'EOF' #! /bin/sh psql=__PGBIN__/psql DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ PGCTL=__PGBIN__/pg_ctl main_db_cluster=$1 recovery_node_host_name=$2 DEST_CLUSTER=$3 PORT=$4 log=$DATADIR_BASE/log/recovery.log EOF echo "export PGHOST=localhost" >> $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 $PGCTL -D $DEST_CLUSTER promote 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/" \ -e "/__ARCHDIR__/s@__ARCHDIR__@$BASEDIR/archivedir/\`basename \$1\`@" \ $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 "listen_addresses = '*'" >> $CONF echo "sr_check_user = '$WHOAMI'" >> $CONF echo "sr_check_password = ''" >> $CONF echo "recovery_user = '$WHOAMI'" >> $CONF echo "recovery_password = ''" >> $CONF echo "recovery_1st_stage_command = 'basebackup.sh'" >> $CONF if [ $MODE = "r" -o $MODE = "i" ];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 %H %M %P %r %R %N %S'" >> $CONF fi echo "unix_socket_directories = '$PGSOCKET_DIR'" >> $CONF echo "pcp_socket_dir = '$PGSOCKET_DIR'" >> $CONF echo "logging_collector = off" >> $CONF echo "log_line_prefix = '%m: %a pid %p: '" >> $CONF if [ $ENABLE_TEST = "true" ];then echo "health_check_test = on" >> $CONF fi } #------------------------------------------- # 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 } #------------------------------------------- # create each PostgreSQL cluster #------------------------------------------- function create_postgresql_clusters { n=0 while [ $n -lt $NUMCLUSTERS ] do CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER PORT=`expr $BASEPORT + $n` if [ $NO_CREATE_PGCLUSTER = "false" ];then 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' -o $MODE = 'i' ];then create_basebackup_replication $CLUSTERDIR $n >&5 2>&1 create_pgpool_recovery_pitr $CLUSTERDIR $n >&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 fi n=`expr $n + 1` echo "#$n port is $PORT" >> README.port # create archive directory test ! -d archivedir/$CLUSTER && mkdir -p archivedir/$CLUSTER done } #------------------------------------------- # if streaming replication mode, we need to create data1 and so on, by # using online recovery. #------------------------------------------- function create_followers { BACKEND_HOSTNAME=localhost if [ $MODE = 's' ];then if [ $NO_CREATE_PGCLUSTER = "false" ];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 fi n=0 PORT=$BASEPORT CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER echo "backend_hostname$n = '$BACKEND_HOSTNAME'" >> $CONF echo "backend_port$n = $PORT" >> $CONF echo "backend_weight$n = 1" >> $CONF echo "backend_data_directory$n = '$CLUSTERDIR'" >> $CONF echo "backend_flag$n = 'ALLOW_TO_FAILOVER'" >> $CONF echo "backend_application_name$n = 'server$n'" >> $CONF if [ $NO_CREATE_PGCLUSTER = "false" ];then # 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 fi if [ $NUMCLUSTERS -gt 1 ];then n=1 while [ $n -lt $NUMCLUSTERS ] do # create archive directory test ! -d $BASEDIR/archivedir/`basename $CLUSTER` && mkdir -p $BASEDIR/archivedir/`basename $CLUSTER` # set up pgpool.conf PORT=`expr $PORT + 1` echo "backend_hostname$n = '$BACKEND_HOSTNAME'" >> $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_flag$n = 'ALLOW_TO_FAILOVER'" >> $CONF echo "backend_application_name$n = 'server$n'" >> $CONF n=`expr $n + 1` done if [ $NO_CREATE_PGCLUSTER = "false" ];then $PGPOOL_INSTALL_DIR/bin/pgpool -f $BASEDIR/etc/pgpool.conf reload fi fi if [ $NO_CREATE_PGCLUSTER = "false" ];then 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` wait_for_pgpool_startup done fi # # replication mode # else n=0 PORT=$BASEPORT CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER while [ $n -lt $NUMCLUSTERS ] do if [ $NO_CREATE_PGCLUSTER = "false" ];then 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 fi # set up pgpool.conf echo "backend_hostname$n = '$BACKEND_HOSTNAME'" >> $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_PRIMARY" >> $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 if [ $NO_CREATE_PGCLUSTER = "false" ];then echo "start all" $STARTALL >&5 2>&1 echo -n "waiting for pgpool-II coming up..." wait_for_pgpool_startup # sleep 20 echo "done." fi fi if [ $NO_CREATE_PGCLUSTER = "false" ];then if [ $MODE = "r" -o $MODE = "n" -o $MODE = "i" ];then echo "create extensions" $PSQL -p $PGPOOL_PORT template1 >&5 2>&1 < /dev/null 2>&1 if [ $? != 0 ]; then echo "Pgpool-II packages must be installed if \"-c\" option or TEST_SAMPLES is specified." exit 1 fi if [ ! -r $PGPOOLDIR/pgpool.conf.sample ]; then echo "\"$WHOAMI\" user could not read sample config files unter $PGPOOLDIR" exit 1 fi fi exec 5> $BASEDIR/pgpool_setup.log #------------------------------------------- # everything looks good. starting setup... #------------------------------------------- echo "Starting set up in $MODENAME" if [ $TEST_SAMPLES = "true" ]; then echo "Test Pgpool-II RPMs using sample scripts and config files" fi #------------------------------------------- # assign base port for PostgreSQL #------------------------------------------- ORIG_BASEPORT=$BASEPORT BASEPORT=$PGBASEPORT #------------------------------------------- # install pgpool.conf #------------------------------------------- test ! -d etc && mkdir etc cp $PGPOOLDIR/pgpool.conf.sample $CONF echo "backend_clustering_mode = $CLUSTERING_MODE_STR" >> $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 && while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL if [ $CHECK_TIME_WAIT != "false" ];then echo "while netstat -tulpn 2>/dev/null|grep pgpool|grep -w $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 #------------------------------------------- # setup ports #------------------------------------------- PGPOOL_PORT=$ORIG_BASEPORT PCP_PORT=`expr $PGPOOL_PORT + 1` #------------------------------------------- # create failover script #------------------------------------------- echo "creating failover script" create_failover_script >&5 2>&1 #------------------------------------------- # create each PostgreSQL cluster #------------------------------------------- create_postgresql_clusters #------------------------------------------- # create pgpool.conf #------------------------------------------- set_pgpool_conf $CONF set_pool_hba_conf $BASEDIR/etc/pool_hba.conf echo "port = $PGPOOL_PORT" >> $CONF 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 streaming replication mode, we need to create data1 and so on, by # using online recovery. #------------------------------------------- create_followers #------------------------------------------- # create follow_primary failover script #------------------------------------------- if [ $MODE = "s" ];then echo "creating follow primary script" create_follow_primary_script >&5 2>&1 echo "follow_primary_command = '$FOLLOW_PRIMARY_SCRIPT %d %h %p %D %m %H %M %P %r %R'" >> $CONF fi if [ $NO_CREATE_PGCLUSTER = "false" ];then $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.6.0/src/test/watchdog_setup.in0000664000175000017500000002262114760007565015376 00000000000000#!/usr/bin/env bash # # Copyright (c) 2013-2021 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|i][-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"} # Number of default PostgreSQL clusters NUMCLUSTERS=2 # 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 else 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" || $MODE = "i" ];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 "unix_socket_directories = '$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 node_id_file=etc/pgpool_node_id cat >> $conf <> $conf echo "pgpool_port$n = $pgpool_port" >> $conf echo "wd_port$n = $wd_port" >> $conf echo "heartbeat_hostname$n = 'localhost'" >> $conf echo "heartbeat_port$n = $wd_heartbeat_port" >> $conf n=`expr $n + 1` done echo "$id" >> $node_id_file } ################################################################################# # # main script # ################################################################################ function usage() { echo "usage: $0 [-wn num_pgpool][-wp watchdog_base_port][-m r|s|n|i] [-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";; i ) MODE="i";; * ) 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 \)` if [ $cnt -gt 0 ];then $PGPOOL_SETUP -m $MODE -p $port -pg $PGBASEPORT -e else $PGPOOL_SETUP -m $MODE -p $port -pg $PGBASEPORT fi set_watchdog_params $cnt $W_NUM_PGPOOL $W_BASE_PORT if [ $cnt != 0 ] then # remove "pg_ctl start" line from startall/shutdownall script in other than pgpool0 sed -i '/.*data.*/d' startall sed -i '/.*data.*/d' shutdownall # change database cluster directory symlink to pgpool0. # The database cluster entity only resides in pgpool0. n=0 while [ $n -lt $NUMCLUSTERS ] do rm -fr data$n ln -s ../pgpool0/data$n . n=`expr $n + 1` done fi echo "cd pgpool$cnt" >> $STARTALL echo "./startall" >> $STARTALL echo "cd .." >> $STARTALL cd .. cnt=`expr $cnt + 1` done # shutdown needs to be performed in reverse order because shutdown of # PostgreSQL servers must be executed in pgpoo0. cnt=$W_NUM_PGPOOL while [ $cnt -gt 0 ] do cnt=`expr $cnt - 1` echo "cd pgpool$cnt" >> $SHUTDOWNALL echo "./shutdownall" >> $SHUTDOWNALL echo "cd .." >> $SHUTDOWNALL done chmod 755 $STARTALL chmod 755 $SHUTDOWNALL pgpool-II-4.6.0/src/test/regression/0000775000175000017500000000000014760007565014263 500000000000000pgpool-II-4.6.0/src/test/regression/clean.sh0000664000175000017500000000242214760001620015603 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/leader 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/leader/ 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/leader/ 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/leader/ 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/leader/ rm -fr $dir/tests/015.watchdoc_test_master_and_backend_fail/leader/ 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.6.0/src/test/regression/tests/0000775000175000017500000000000014760007565015425 500000000000000pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/0000775000175000017500000000000014760007565020310 500000000000000pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/.gitignore0000664000175000017500000000001114760001620022172 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/0000775000175000017500000000000014760007565022111 500000000000000pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected1-r0000664000175000017500000000364214760007565024102 00000000000000CREATE TABLE t1(i INTEGER); NOTICE: DB node id: 0 statement: CREATE TABLE t1(i INTEGER); NOTICE: DB node id: 1 statement: CREATE TABLE t1(i INTEGER); CREATE TABLE t2(i INTEGER); NOTICE: DB node id: 0 statement: CREATE TABLE t2(i INTEGER); NOTICE: DB node id: 1 statement: CREATE TABLE t2(i INTEGER); CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 0 statement: CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 1 statement: CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; CREATE FUNCTION f2(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 0 statement: CREATE FUNCTION f2(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 1 statement: CREATE FUNCTION f2(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; CREATE FUNCTION f3(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 0 statement: CREATE FUNCTION f3(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 1 statement: CREATE FUNCTION f3(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; CREATE FUNCTION f4(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 0 statement: CREATE FUNCTION f4(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 1 statement: CREATE FUNCTION f4(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; SELECT * FROM t1; -- this load balances NOTICE: DB node id: 1 statement: SELECT * FROM t1; i --- (0 rows) SELECT f1(1); -- this does not load balance NOTICE: DB node id: 0 statement: SELECT f1(1); NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- this does not load balance NOTICE: DB node id: 0 statement: SELECT public.f2(1); NOTICE: DB node id: 1 statement: SELECT public.f2(1); f2 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected1-s0000664000175000017500000000240514760007565024077 00000000000000CREATE TABLE t1(i INTEGER); NOTICE: DB node id: 0 statement: CREATE TABLE t1(i INTEGER); CREATE TABLE t2(i INTEGER); NOTICE: DB node id: 0 statement: CREATE TABLE t2(i INTEGER); CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 0 statement: CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; CREATE FUNCTION f2(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; NOTICE: DB node id: 0 statement: CREATE FUNCTION f2(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL; CREATE FUNCTION f3(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 0 statement: CREATE FUNCTION f3(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; CREATE FUNCTION f4(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; NOTICE: DB node id: 0 statement: CREATE FUNCTION f4(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL STABLE; SELECT * FROM t1; -- this load balances NOTICE: DB node id: 1 statement: SELECT * FROM t1; i --- (0 rows) SELECT f1(1); -- this does not load balance NOTICE: DB node id: 0 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- this does not load balance NOTICE: DB node id: 0 statement: SELECT public.f2(1); f2 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected2-r0000664000175000017500000000035614760007565024102 00000000000000SELECT f1(1); -- this does load balance NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- this does load balance NOTICE: DB node id: 1 statement: SELECT public.f2(1); f2 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected2-s0000664000175000017500000000035614760007565024103 00000000000000SELECT f1(1); -- this does load balance NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- this does load balance NOTICE: DB node id: 1 statement: SELECT public.f2(1); f2 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected3-r0000664000175000017500000000103414760007565024075 00000000000000SELECT * FROM t1; NOTICE: DB node id: 1 statement: SELECT * FROM t1; i --- (0 rows) SELECT 'a'; NOTICE: DB node id: 1 statement: SELECT 'a'; ?column? ---------- a (1 row) SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) SELECT ';'; NOTICE: DB node id: 1 statement: SELECT ';'; ?column? ---------- ; (1 row) SELECT * FROM t2; NOTICE: DB node id: 1 statement: SELECT * FROM t2; i --- (0 rows) SELECT f1(1); NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected3-s0000664000175000017500000000103414760007565024076 00000000000000SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- (0 rows) SELECT 'a'; NOTICE: DB node id: 0 statement: SELECT 'a'; ?column? ---------- a (1 row) SELECT 1; NOTICE: DB node id: 0 statement: SELECT 1; ?column? ---------- 1 (1 row) SELECT ';'; NOTICE: DB node id: 0 statement: SELECT ';'; ?column? ---------- ; (1 row) SELECT * FROM t2; NOTICE: DB node id: 0 statement: SELECT * FROM t2; i --- (0 rows) SELECT f1(1); NOTICE: DB node id: 0 statement: SELECT f1(1); f1 ---- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected4-r0000664000175000017500000000041314760007565024076 00000000000000BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; SELECT 1; NOTICE: DB node id: 0 statement: SELECT 1; ?column? ---------- 1 (1 row) END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected5-r0000664000175000017500000000025614760007565024104 00000000000000SELECT f1(2); -- this should be sent to all the nodes NOTICE: DB node id: 0 statement: SELECT f1(2); NOTICE: DB node id: 1 statement: SELECT f1(2); f1 ---- 2 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected6-r0000664000175000017500000000542014760007565024103 00000000000000SELECT f1(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: SELECT f1(1); NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: SELECT public.f2(1); NOTICE: DB node id: 1 statement: SELECT public.f2(1); f2 ---- 1 (1 row) SELECT f3(1); -- load balance because statble function NOTICE: DB node id: 1 statement: SELECT f3(1); f3 ---- 1 (1 row) SELECT public.f4(1); -- load balance because stable function NOTICE: DB node id: 1 statement: SELECT public.f4(1); f4 ---- 1 (1 row) PREPARE p1 AS SELECT f1(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: PREPARE p1 AS SELECT f1(1); NOTICE: DB node id: 1 statement: PREPARE p1 AS SELECT f1(1); EXECUTE p1; -- no load balance because volatile function NOTICE: DB node id: 0 statement: EXECUTE p1; NOTICE: DB node id: 1 statement: EXECUTE p1; f1 ---- 1 (1 row) DEALLOCATE p1; -- no load balance because volatile function NOTICE: DB node id: 0 statement: DEALLOCATE p1; NOTICE: DB node id: 1 statement: DEALLOCATE p1; PREPARE p2 AS SELECT f3(1); -- load balance because stable function NOTICE: DB node id: 1 statement: PREPARE p2 AS SELECT f3(1); EXECUTE p2; -- load balance because stable function NOTICE: DB node id: 1 statement: EXECUTE p2; f3 ---- 1 (1 row) DEALLOCATE p2; -- load balance because stable function NOTICE: DB node id: 1 statement: DEALLOCATE p2; -- PREPARE in transaction test BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; PREPARE p3 AS SELECT 1; -- load balance NOTICE: DB node id: 1 statement: PREPARE p3 AS SELECT 1; EXECUTE p3; -- load balance NOTICE: DB node id: 1 statement: EXECUTE p3; ?column? ---------- 1 (1 row) DEALLOCATE p3; -- load balance NOTICE: DB node id: 1 statement: DEALLOCATE p3; END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; -- PREPARE in writing transaction test BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; PREPARE p3 AS SELECT 1; -- load balance NOTICE: DB node id: 1 statement: PREPARE p3 AS SELECT 1; SELECT f1(1); -- no load balance. writing transaction is set NOTICE: DB node id: 0 statement: SELECT f1(1); NOTICE: DB node id: 1 statement: SELECT f1(1); f1 ---- 1 (1 row) -- PREPARE is re-execute and EXECUTE no load balance in SL_MODE. -- in other mode, load balance EXECUTE p3; NOTICE: DB node id: 1 statement: EXECUTE p3; ?column? ---------- 1 (1 row) -- no load balance in SL_MODE. -- in other mode, load balance DEALLOCATE p3; NOTICE: DB node id: 1 statement: DEALLOCATE p3; END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected6-s0000664000175000017500000000473414760007565024113 00000000000000SELECT f1(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: SELECT f1(1); f1 ---- 1 (1 row) SELECT public.f2(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: SELECT public.f2(1); f2 ---- 1 (1 row) SELECT f3(1); -- load balance because statble function NOTICE: DB node id: 1 statement: SELECT f3(1); f3 ---- 1 (1 row) SELECT public.f4(1); -- load balance because stable function NOTICE: DB node id: 1 statement: SELECT public.f4(1); f4 ---- 1 (1 row) PREPARE p1 AS SELECT f1(1); -- no load balance because volatile function NOTICE: DB node id: 0 statement: PREPARE p1 AS SELECT f1(1); EXECUTE p1; -- no load balance because volatile function NOTICE: DB node id: 0 statement: EXECUTE p1; f1 ---- 1 (1 row) DEALLOCATE p1; -- no load balance because volatile function NOTICE: DB node id: 0 statement: DEALLOCATE p1; PREPARE p2 AS SELECT f3(1); -- load balance because stable function NOTICE: DB node id: 1 statement: PREPARE p2 AS SELECT f3(1); EXECUTE p2; -- load balance because stable function NOTICE: DB node id: 1 statement: EXECUTE p2; f3 ---- 1 (1 row) DEALLOCATE p2; -- load balance because stable function NOTICE: DB node id: 1 statement: DEALLOCATE p2; -- PREPARE in transaction test BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; PREPARE p3 AS SELECT 1; -- load balance NOTICE: DB node id: 1 statement: PREPARE p3 AS SELECT 1; EXECUTE p3; -- load balance NOTICE: DB node id: 1 statement: EXECUTE p3; ?column? ---------- 1 (1 row) DEALLOCATE p3; -- load balance NOTICE: DB node id: 1 statement: DEALLOCATE p3; END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; -- PREPARE in writing transaction test BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; PREPARE p3 AS SELECT 1; -- load balance NOTICE: DB node id: 1 statement: PREPARE p3 AS SELECT 1; SELECT f1(1); -- no load balance. writing transaction is set NOTICE: DB node id: 0 statement: SELECT f1(1); f1 ---- 1 (1 row) -- PREPARE is re-execute and EXECUTE no load balance in SL_MODE. -- in other mode, load balance EXECUTE p3; NOTICE: DB node id: 0 statement: EXECUTE p3; ?column? ---------- 1 (1 row) -- no load balance in SL_MODE. -- in other mode, load balance DEALLOCATE p3; NOTICE: DB node id: 0 statement: DEALLOCATE p3; END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected7-r0000664000175000017500000000652414760007565024112 00000000000000\set SHOW_ALL_RESULTS off -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- ordinary read only SELECT: load balance expected SELECT 2; NOTICE: DB node id: 1 statement: SELECT 2; ?column? ---------- 2 (1 row) -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 0 statement: SAVEPOINT a; NOTICE: DB node id: 1 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 0 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 0 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 0 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 1 statement: ROLLBACK TO a; NOTICE: DB node id: 0 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN and INSERT DROP TABLE t1; NOTICE: DB node id: 0 statement: DROP TABLE t1; NOTICE: DB node id: 1 statement: DROP TABLE t1; CREATE TABLE t1(i INT); NOTICE: DB node id: 0 statement: CREATE TABLE t1(i INT); NOTICE: DB node id: 1 statement: CREATE TABLE t1(i INT); BEGIN\;INSERT INTO t1 VALUES(1); NOTICE: DB node id: 0 statement: BEGIN;INSERT INTO t1 VALUES(1); NOTICE: DB node id: 1 statement: BEGIN;INSERT INTO t1 VALUES(1); -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 0 statement: SAVEPOINT a; NOTICE: DB node id: 1 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 0 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 0 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 0 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 1 statement: ROLLBACK TO a; NOTICE: DB node id: 0 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN and ROLLBACK BEGIN\;SELECT 1\;ROLLBACK; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1;ROLLBACK; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1;ROLLBACK; -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN and invalid query BEGIN\;SELECT 1\;FOO; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1;FOO; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1;FOO; ERROR: syntax error at or near "FOO" LINE 1: BEGIN;SELECT 1;FOO; ^ -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected7-s0000664000175000017500000000523514760007565024111 00000000000000\set SHOW_ALL_RESULTS off -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- ordinary read only SELECT: load balance expected SELECT 2; NOTICE: DB node id: 1 statement: SELECT 2; ?column? ---------- 2 (1 row) -- tx started by multi-statement query ends END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 0 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 0 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 0 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 0 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 0 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN and INSERT DROP TABLE t1; NOTICE: DB node id: 0 statement: DROP TABLE t1; CREATE TABLE t1(i INT); NOTICE: DB node id: 0 statement: CREATE TABLE t1(i INT); BEGIN\;INSERT INTO t1 VALUES(1); NOTICE: DB node id: 0 statement: BEGIN;INSERT INTO t1 VALUES(1); -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 0 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 0 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 0 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 0 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 0 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 0 statement: END; -- multi-statement query including BEGIN and ROLLBACK BEGIN\;SELECT 1\;ROLLBACK; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1;ROLLBACK; -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN and invalid query BEGIN\;SELECT 1\;FOO; NOTICE: DB node id: 0 statement: BEGIN;SELECT 1;FOO; ERROR: syntax error at or near "FOO" LINE 1: BEGIN;SELECT 1;FOO; ^ -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 1 statement: SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/expected/expected8-s0000664000175000017500000000523514760007565024112 00000000000000\set SHOW_ALL_RESULTS off -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 0 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- ordinary read only SELECT: load balance expected SELECT 2; NOTICE: DB node id: 0 statement: SELECT 2; ?column? ---------- 2 (1 row) -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; -- multi-statement query including BEGIN BEGIN\;SELECT 1; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1; ?column? ---------- 1 (1 row) -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 1 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 1 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 1 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 1 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 1 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; -- multi-statement query including BEGIN and INSERT DROP TABLE t1; NOTICE: DB node id: 1 statement: DROP TABLE t1; CREATE TABLE t1(i INT); NOTICE: DB node id: 1 statement: CREATE TABLE t1(i INT); BEGIN\;INSERT INTO t1 VALUES(1); NOTICE: DB node id: 1 statement: BEGIN;INSERT INTO t1 VALUES(1); -- SAVEPOINT SAVEPOINT a; NOTICE: DB node id: 1 statement: SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; NOTICE: DB node id: 1 statement: PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; NOTICE: DB node id: 1 statement: EXECUTE foo; ?column? ---------- 2 (1 row) -- DEALLOCATE DEALLOCATE foo; NOTICE: DB node id: 1 statement: DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; NOTICE: DB node id: 1 statement: ROLLBACK TO a; -- tx started by multi-statement query ends END; NOTICE: DB node id: 1 statement: END; -- multi-statement query including BEGIN and ROLLBACK BEGIN\;SELECT 1\;ROLLBACK; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1;ROLLBACK; -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 0 statement: SELECT 1; ?column? ---------- 1 (1 row) -- multi-statement query including BEGIN and invalid query BEGIN\;SELECT 1\;FOO; NOTICE: DB node id: 1 statement: BEGIN;SELECT 1;FOO; ERROR: syntax error at or near "FOO" LINE 1: BEGIN;SELECT 1;FOO; ^ -- ordinary read only SELECT: load balance expected SELECT 1; NOTICE: DB node id: 0 statement: SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/sql/0000775000175000017500000000000014760007565021107 500000000000000pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/sql/6.sql0000664000175000017500000000207714760007565021723 00000000000000SELECT f1(1); -- no load balance because volatile function SELECT public.f2(1); -- no load balance because volatile function SELECT f3(1); -- load balance because statble function SELECT public.f4(1); -- load balance because stable function PREPARE p1 AS SELECT f1(1); -- no load balance because volatile function EXECUTE p1; -- no load balance because volatile function DEALLOCATE p1; -- no load balance because volatile function PREPARE p2 AS SELECT f3(1); -- load balance because stable function EXECUTE p2; -- load balance because stable function DEALLOCATE p2; -- load balance because stable function -- PREPARE in transaction test BEGIN; PREPARE p3 AS SELECT 1; -- load balance EXECUTE p3; -- load balance DEALLOCATE p3; -- load balance END; -- PREPARE in writing transaction test BEGIN; PREPARE p3 AS SELECT 1; -- load balance SELECT f1(1); -- no load balance. writing transaction is set -- PREPARE is re-execute and EXECUTE no load balance in SL_MODE. -- in other mode, load balance EXECUTE p3; -- no load balance in SL_MODE. -- in other mode, load balance DEALLOCATE p3; END; pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/sql/7.sql0000664000175000017500000000213314760007565021715 00000000000000\set SHOW_ALL_RESULTS off -- ordinary read only SELECT: load balance expected SELECT 1; -- multi-statement query including BEGIN BEGIN\;SELECT 1; -- ordinary read only SELECT: load balance expected SELECT 2; -- tx started by multi-statement query ends END; -- multi-statement query including BEGIN BEGIN\;SELECT 1; -- SAVEPOINT SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; -- DEALLOCATE DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; -- tx started by multi-statement query ends END; -- multi-statement query including BEGIN and INSERT DROP TABLE t1; CREATE TABLE t1(i INT); BEGIN\;INSERT INTO t1 VALUES(1); -- SAVEPOINT SAVEPOINT a; -- PREPARE PREPARE foo AS SELECT 2; -- EXECUTE EXECUTE foo; -- DEALLOCATE DEALLOCATE foo; -- ROLLBACK TO ROLLBACK TO a; -- tx started by multi-statement query ends END; -- multi-statement query including BEGIN and ROLLBACK BEGIN\;SELECT 1\;ROLLBACK; -- ordinary read only SELECT: load balance expected SELECT 1; -- multi-statement query including BEGIN and invalid query BEGIN\;SELECT 1\;FOO; -- ordinary read only SELECT: load balance expected SELECT 1; pgpool-II-4.6.0/src/test/regression/tests/001.load_balance/test.sh0000775000175000017500000001522714760007565021555 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for load balancing. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PSQLOPTS="-a -q -X" PGPOOLBIN=$PGPOOL_INSTALL_DIR/bin export PGDATABASE=test export CHECK_TIME_WAIT=true # sleep time after reload in seconds st=10 # function to check the result # argument is test case number. function check_result { diff -c ../expected/expected$1$suffix result$1 if [ $? = 0 ];then echo "test$1 succeeded." else echo "test$1 failed." ./shutdownall exit 1 fi } # main test script for mode in s r i 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 # set expected file suffix if [ $mode = 's' ];then suffix='-s' else suffix='-r' fi echo "=== test1 started ===" echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf echo "write_function_list = 'f1,public.f2'" >> etc/pgpool.conf echo "notice_per_node_statement = on" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL $PSQLOPTS > result1 2>&1 <> etc/pgpool.conf echo "write_function_list = ''" >> etc/pgpool.conf ./pgpool_reload sleep $st $PSQL $PSQLOPTS > result2 2>&1 <> etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL $PSQLOPTS > result3 2>&1 <> etc/pgpool.conf echo "write_function_list = ''" >> etc/pgpool.conf echo "statement_level_load_balance = on" >> etc/pgpool.conf echo "log_min_messages = debug5" >> etc/pgpool.conf ./startall sleep $st $PSQL test <> etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL $PSQLOPTS > result4 2>&1 <> etc/pgpool.conf echo "read_only_function_list = ''" >> etc/pgpool.conf ./pgpool_reload sleep $st $PSQL $PSQLOPTS > result5 2>&1 <> etc/pgpool.conf echo "write_function_list = ''" >> etc/pgpool.conf echo "read_only_function_list = ''" >> etc/pgpool.conf ./shutdownall ./startall wait_for_pgpool_startup $PSQL $PSQLOPTS < ../sql/6.sql > result6 2>&1 check_result 6 echo "=== test7 started ===" # ------------------------------------------------------------------------------- # multi statement queries # ------------------------------------------------------------------------------- echo "statement_level_load_balance = off" >> etc/pgpool.conf # XXX primary_routing_query_pattern_list does not allow to overwritten. # So following does not work. #echo "primary_routing_query_pattern_list = ''" >> etc/pgpool.conf sed -i '/^primary_routing_query_pattern_list/d' etc/pgpool.conf ./shutdownall ./startall wait_for_pgpool_startup $PSQL -c "SHOW POOL_NODES;" test $PSQL $PSQLOPTS < ../sql/7.sql > result7 2>&1 check_result 7 echo "=== test8 started ===" # ------------------------------------------------------------------------------- # multi statement queries (swapping primary and standby) # ------------------------------------------------------------------------------- if [ $mode = 's' ];then echo $PGPOOLBIN/pcp_promote_node -w -p $PCP_PORT --switchover 1 $PGPOOLBIN/pcp_promote_node -w -p $PCP_PORT --switchover 1 while : do wait_for_pgpool_startup $PSQL -c "SHOW POOL_NODES;" test | grep down if [ $? != 0 ];then break fi sleep 1 done # Swap the weights. Now backend 0 is the load balance node echo "backend_weight0 = 1" >> etc/pgpool.conf echo "backend_weight1 = 0" >> etc/pgpool.conf ./shutdownall ./startall wait_for_pgpool_startup $PSQL $PSQLOPTS < ../sql/7.sql > result8 2>&1 check_result 8 fi ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/002.native_replication/0000775000175000017500000000000014760007565021604 500000000000000pgpool-II-4.6.0/src/test/regression/tests/002.native_replication/.gitignore0000664000175000017500000000001114760001620023466 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/002.native_replication/create.sql0000664000175000017500000000015714760001620023475 00000000000000CREATE TABLE sequencetester ( id serial NOT NULL, recordno integer, CONSTRAINT sq_pk PRIMARY KEY (id ) ) pgpool-II-4.6.0/src/test/regression/tests/002.native_replication/test.sh0000775000175000017500000000505314760001620023027 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.6.0/src/test/regression/tests/002.native_replication/PgTester.java0000664000175000017500000000240714760007565024127 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("inserted "+cv); } query.close(); //conn.commit(); conn.close(); System.out.println("Done"); } catch (SQLException e) { e.printStackTrace(); } } } pgpool-II-4.6.0/src/test/regression/tests/003.failover/0000775000175000017500000000000014760007565017535 500000000000000pgpool-II-4.6.0/src/test/regression/tests/003.failover/.gitignore0000664000175000017500000000001114760001620021417 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/003.failover/create_expected.sql0000664000175000017500000000177014760007565023327 00000000000000CREATE TEMP TABLE tmp ( node_id text, hostname text, port text, status text, pg_status text, lb_weight text, role text, pg_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','localhost','11002','up','up','0.500000','primary','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('1','localhost','11003','down','down','0.500000','standby','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('0','localhost','11002','up','up','0.500000','main','main','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'), ('1','localhost','11003','down','down','0.500000','replica','replica','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'); SELECT node_id,hostname,port,status,pg_status,lb_weight,role,pg_role,select_cnt,load_balance_node,replication_delay,replication_state, replication_sync_state, last_status_change FROM tmp WHERE mode = :mode pgpool-II-4.6.0/src/test/regression/tests/003.failover/create_expected_node0.sql0000664000175000017500000000177014760007565024414 00000000000000CREATE TEMP TABLE tmp ( node_id text, hostname text, port text, status text, pg_status text, lb_weight text, role text, pg_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','localhost','11002','down','down','0.500000','standby','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('1','localhost','11003','up','up','0.500000','primary','unknown','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('0','localhost','11002','down','down','0.500000','replica','replica','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'), ('1','localhost','11003','up','up','0.500000','main','main','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'); SELECT node_id,hostname,port,status,pg_status,lb_weight,role,pg_role,select_cnt,load_balance_node,replication_delay,replication_state, replication_sync_state, last_status_change FROM tmp WHERE mode = :mode pgpool-II-4.6.0/src/test/regression/tests/003.failover/test.sh0000775000175000017500000000331314760007565020773 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|| 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 ./startall wait_for_pgpool_startup 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'" 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'" 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.6.0/src/test/regression/tests/004.watchdog/0000775000175000017500000000000014760007565017527 500000000000000pgpool-II-4.6.0/src/test/regression/tests/004.watchdog/.gitignore0000664000175000017500000000002114760001620021412 00000000000000leader/ standby/ pgpool-II-4.6.0/src/test/regression/tests/004.watchdog/leader.conf0000664000175000017500000000053614760001620021540 00000000000000# leader watchdog use_watchdog = on wd_interval = 1 wd_priority = 2 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port0 = 11100 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port01 = 21105 enable_consensus_with_half_votes = on pgpool-II-4.6.0/src/test/regression/tests/004.watchdog/standby.conf0000664000175000017500000000057514760001620021753 00000000000000# standby watchdog port = 11100 pcp_port = 11105 use_watchdog = on wd_interval = 1 wd_priority = 1 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port0 = 11100 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port01 = 21105 enable_consensus_with_half_votes = on pgpool-II-4.6.0/src/test/regression/tests/004.watchdog/test.sh0000775000175000017500000000700714760007565020771 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog source $TESTLIBS LEADER_DIR=leader STANDBY_DIR=standby PSQL=$PGBIN/psql success_count=0 rm -fr $LEADER_DIR rm -fr $STANDBY_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool..." $PGPOOL_SETUP -m n -n 1 -p 11000|| exit 1 echo "leader setup done." # copy the configurations from to standby cp -r etc ../$STANDBY_DIR/ source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./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 leader. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf echo 1 > $STANDBY_DIR/etc/pgpool_node_id # start the standby 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 leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node. Starting escalation process" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby has successfully joined connected to the leader. 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 # at this point the watchdog leader and stabdby are working. # check to see if "pgpool reset" command works. echo "Check pgpool reset command..." for i in 11000 11100 do echo "Check pgpool reset command on port $i..." $PSQL -p $i -c "pgpool reset client_idle_limit" test if [ $? = 0 ];then success_count=$(( success_count + 1 )) fi done # step 2 stop leader pgpool and see if standby take over $PGPOOL_INSTALL_DIR/bin/pgpool -f $LEADER_DIR/etc/pgpool.conf -m f stop echo "Checking if the Standby pgpool-II detected the leader 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 "Leader 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 leader 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 leader." 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 leader ./shutdownall echo "$success_count out of 6 successful"; if test $success_count -eq 6 then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/005.jdbc/0000775000175000017500000000000014760007565016632 500000000000000pgpool-II-4.6.0/src/test/regression/tests/005.jdbc/.gitignore0000664000175000017500000000001114760001620020514 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/005.jdbc/AutoCommitTest.java0000664000175000017500000000226614760001620022326 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.6.0/src/test/regression/tests/005.jdbc/BatchTest.java0000664000175000017500000000270314760001620021262 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.6.0/src/test/regression/tests/006.memqcache/0000775000175000017500000000000014760007565017654 500000000000000pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/.gitignore0000664000175000017500000000001114760001620021536 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_database1.data0000664000175000017500000000131614760001620023426 00000000000000# Testing ALTER DATABASE # create cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # execute ALTER DATABASE 'P' "" "ALTER DATABASE test2 RESET ALL" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is not used 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # explicit transaction case 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER DATABASE test2 RESET ALL" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is not used 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "END" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is used 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_database2.data0000664000175000017500000000044214760001620023426 00000000000000# ALTER DATABASE is executed on another session case # Make sure to create cache (sync needed) 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER DATABASE test2 RESET ALL" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_database3.data0000664000175000017500000000023314760001620023425 00000000000000# ALTER DATABASE is executed on another session case # Make sure this does not access cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_role.data0000664000175000017500000000132214760001620022537 00000000000000# ALTER ROLE BYPASSRLS case # Make sure to create cache (sync needed) 'P' "" "SELECT * FROM users" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM users" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER ROLE foo BYPASSRLS" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # expect to ignore cache and result is all rows 'P' "" "SELECT * FROM users" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "RESET ROLE" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER ROLE foo NOBYPASSRLS" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # expect to ignore cache and result is one row 'P' "" "SELECT * FROM users" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_table1.data0000664000175000017500000000165614760001620022760 00000000000000# ALTER ROLE BYPASSRLS case # Make sure to create cache (sync needed) 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'P' "" "ALTER TABLE t1 ADD COLUMN j INT" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is not used 'P' "" "SELECT j FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # explicit transaction case 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER TABLE t1 DROP COLUMN j" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is not used (an error expected) 'P' "" "SELECT i,j FROM t1" #'B' "" "" 0 0 0 #'E' "" 0 'S' 'Y' 'P' "" "END" 'B' "" "" 0 0 0 'E' "" 0 # Sync is needed to reset query_cache_disabled_tx flag 'S' 'Y' # create cache 'P' "" "SELECT j FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache is used 'P' "" "SELECT j FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # drop column j for subsequent test 'Q' "ALTER TABLE t1 DROP COLUMN j" 'S' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_table2.data0000664000175000017500000000044014760001620022747 00000000000000# ALTER TABLE is executed on another session case # Make sure to create cache (sync needed) 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ALTER TABLE t1 ADD COLUMN j INT" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/alter_table3.data0000664000175000017500000000023014760001620022745 00000000000000# ALTER TABLE is executed on another session case # Make sure this does not access cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.10000664000175000017500000000132014760001620021435 00000000000000FE=> Parse(stmt="S0", query="SELECT 1") FE=> Bind(stmt="S0", portal="P0") FE=> Describe(portal="P0") FE=> Execute(portal="P0") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="SELECT 2") FE=> Bind(stmt="S1", portal="P1") FE=> Describe(portal="P1") FE=> Execute(portal="P1") FE=> Bind(stmt="S0", portal="P2") FE=> Describe(portal="P2") FE=> Execute(portal="P2") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.20000664000175000017500000000127014760001620021442 00000000000000FE=> Parse(stmt="S0", query="SELECT 1") FE=> Bind(stmt="S0", portal="P0") FE=> Describe(portal="P0") FE=> Execute(portal="P0") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="SELECT setseed(10)") FE=> Bind(stmt="S1", portal="P1") FE=> Describe(portal="P1") FE=> Execute(portal="P1") FE=> Bind(stmt="S0", portal="P2") FE=> Describe(portal="P2") FE=> Execute(portal="P2") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE ErrorResponse(S ERROR V ERROR C 22023 M setseed parameter 10 is out of allowed range [-1,1] <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.30000664000175000017500000000143014760001620021441 00000000000000FE=> Parse(stmt="S0", query="SELECT * FROM (VALUES(1),(2)) foo") FE=> Bind(stmt="S0", portal="P0") FE=> Describe(portal="P0") FE=> Execute(portal="P0") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="SELECT * FROM (VALUES(1),(2),(3)) foo") FE=> Bind(stmt="S1", portal="P1") FE=> Describe(portal="P1") FE=> Execute(portal="P1") FE=> Bind(stmt="S0", portal="P2") FE=> Describe(portal="P2") FE=> Execute(portal="P2") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE PortalSuspended <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.40000664000175000017500000000231414760001620021444 00000000000000FE=> Parse(stmt="", query="SELECT * FROM (VALUES(1),(2)) v") FE=> Bind(stmt="", portal="") FE=> Describe(portal="") FE=> Execute(portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE PortalSuspended <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Parse(stmt="", query="SELECT * FROM (VALUES(1),(2)) v") FE=> Bind(stmt="", portal="") FE=> Describe(portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="SELECT * FROM (VALUES(1),(2)) v") FE=> Bind(stmt="S1", portal="P1") FE=> Describe(portal="P1") FE=> Execute(portal="P1") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE ReadyForQuery(I) FE=> Bind(stmt="S1", portal="P1") FE=> Describe(portal="P1") FE=> Execute(portal="P1") FE=> Execute(portal="P1") FE=> Sync <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 2) <= BE CommandComplete(SELECT 0) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.txt0000664000175000017500000000000214760001620022110 000000000000002 pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/jdbctest.java0000664000175000017500000000257514760001620022234 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.6.0/src/test/regression/tests/006.memqcache/query_cache_bug1.data0000664000175000017500000000046714760001620023626 00000000000000# "packet kind of backend 0 ['T'] does not match with main/majority nodes packet kind ['Z']" 'P' "S0" "SELECT 1" 0 'B' "P0" "S0" 0 0 0 'D' 'P' "P0" 'E' "P0" 0 'S' 'Y' 'P' "S1" "SELECT 2" 0 'B' "P1" "S1" 0 0 0 'D' 'P' "P1" 'E' "P1" 0 'B' "P2" "S0" 0 0 0 'D' 'P' "P2" 'E' "P2" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/query_cache_bug2.data0000664000175000017500000000046114760001620023621 00000000000000# test case including error response 'P' "S0" "SELECT 1" 0 'B' "P0" "S0" 0 0 0 'D' 'P' "P0" 'E' "P0" 0 'S' 'Y' # setseed parameter out of range error 'P' "S1" "SELECT setseed(10)" 0 'B' "P1" "S1" 0 0 0 'D' 'P' "P1" 'E' "P1" 0 'B' "P2" "S0" 0 0 0 'D' 'P' "P2" 'E' "P2" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/query_cache_bug3.data0000664000175000017500000000044214760001620023621 00000000000000# Portal suspended test 'P' "S0" "SELECT * FROM (VALUES(1),(2)) foo" 0 'B' "P0" "S0" 0 0 0 'D' 'P' "P0" 'E' "P0" 0 'S' 'Y' 'P' "S1" "SELECT * FROM (VALUES(1),(2),(3)) foo" 0 'B' "P1" "S1" 0 0 0 'D' 'P' "P1" 'E' "P1" 1 'B' "P2" "S0" 0 0 0 'D' 'P' "P2" 'E' "P2" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/query_cache_bug4.data0000664000175000017500000000121114760001620023615 00000000000000# Since the first Eexecute returns portal suspended, the second # E does not create cache. 'P' "" "SELECT * FROM (VALUES(1),(2)) v" 0 'B' "" "" 0 0 0 'D' 'P' "" 'E' "" 1 'E' "" 0 'S' 'Y' # Since no cache was created, two rows are returned, # and cache created. 'P' "" "SELECT * FROM (VALUES(1),(2)) v" 0 'B' "" "" 0 0 0 'D' 'P' "" 'E' "" 0 'S' 'Y' # This time cache is used. 2 rows are returned. 'P' "S1" "SELECT * FROM (VALUES(1),(2)) v" 0 'B' "P1" "S1" 0 0 0 'D' 'P' "P1" 'E' "P1" 0 'S' 'Y' # cache is used, 2 rows are returned. # but the second E returns 0 rows. 'B' "P1" "S1" 0 0 0 'D' 'P' "P1" 'E' "P1" 0 'E' "P1" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/revoke1.data0000664000175000017500000000176114760001620021772 00000000000000# Testing REVOKE # create cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # revoke 'P' "" "REVOKE SELECT ON t1 FROM foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # change role 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure foo cannot SELECT t1 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "RESET ROLE" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # GRANT again 'P' "" "GRANT SELECT ON t1 TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # explicit transaction case 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # execute REVOKE 'P' "" "REVOKE SELECT ON t1 FROM foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # change role 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure foo cannot SELECT t1 # (thus REVOKE will be rollbacked ) 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "END" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # because REVOKE was rolled back, foo should be able to access t1 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/revoke2.data0000664000175000017500000000046114760001620021767 00000000000000# Testing REVOKE is executed on another session case # Make sure to create cache (sync needed) 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # execute REVOKE 'P' "" "REVOKE SELECT ON t1 FROM foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/revoke3.data0000664000175000017500000000023314760001620021765 00000000000000# Testing REVOKE is executed on another session case # Make sure this does not access cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/row_security.data0000664000175000017500000000120514760001620023145 00000000000000# run SELECT as foo. It is expected 0 row returned. 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM users WHERE user_name = 'bar'" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "RESET ROLE" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as bar. It is expected 0 row returned. 'P' "" "SET ROLE TO bar" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM users WHERE user_name = 'foo'" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # # testing row security with row_security = off # Error expected # 'P' "" "SET row_security TO off" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM users" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/session_authorization.data0000664000175000017500000000046314760001620025057 00000000000000# create query cache 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # SET SESSION_AUTHORIZATION 'P' "" "SET SESSION AUTHORIZATION bar" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as bar. Permission denied is expected. 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/set_role1.data0000664000175000017500000000042414760001620022306 00000000000000# create query cache 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # SET ROLE 'P' "" "SET ROLE TO bar" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as bar. Permission denied is expected. 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/set_role2.data0000664000175000017500000000127714760001620022316 00000000000000# create query cache 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # SET ROLE 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as foo to make sure that cache is not used. # If query cache was created we will NOT see # "NOTICE: DB node id: 1 statement: SELECT ..." 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Modify footable to see cache invalidation works even after SET ROLE. 'P' "" "UPDATE footable SET t = 'foo1' WHERE t = 'foo1'" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # restore ROLE 'P' "" "RESET ROLE" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure cache was invalidated. 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/set_role3.data0000664000175000017500000000144414760001620022313 00000000000000# explicit transaction case # create query cache 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # change role 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as foo to make sure that cache is not used. # If query cache was created we will NOT see # "NOTICE: DB node id: 1 statement: SELECT ..." 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Modify footable to see cache invalidation works even after SET ROLE. 'P' "" "INSERT INTO footable VALUES ('foo3')" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "END" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # undo the INSERT to not disturb subsequent tests 'Q' "DELETE FROM footable WHERE t = 'foo3'" 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/set_role4.data0000664000175000017500000000250014760001620022306 00000000000000# explicit transaction case # create cache 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # change role 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as foo to make sure that cache is not used. # If query cache was created we will NOT see # "NOTICE: DB node id: 0 statement: SELECT ..." 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Modify footable to see cache invalidation works even after SET ROLE. 'P' "" "INSERT INTO footable VALUES ('foo3')" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ABORT" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Make sure we don't see 'foo3' row. 'P' "" "SELECT * FROM t1" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # change role 'P' "" "SET ROLE TO foo" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "BEGIN" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # run SELECT as foo to make sure that cache is not used. # If query cache was created we will NOT see # "NOTICE: DB node id: 0 statement: SELECT ..." 'P' "" "SELECT * FROM footable" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Modify footable to see cache invalidation works even after SET ROLE. 'P' "" "INSERT INTO footable VALUES ('foo3')" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "ABORT" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.n0000664000175000017500000003212014760007565021552 00000000000000-- -- testing an effect on a row level security enabled table and SET ROLE -- CREATE TABLE users (user_name TEXT, data TEXT); NOTICE: DB node id: 0 statement: CREATE TABLE users (user_name TEXT, data TEXT); CREATE TABLE INSERT INTO users VALUES('foo', 'foodata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('foo', 'foodata'); INSERT 0 1 INSERT INTO users VALUES('bar', 'bardata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('bar', 'bardata'); INSERT 0 1 ALTER TABLE users ENABLE ROW LEVEL SECURITY; NOTICE: DB node id: 0 statement: ALTER TABLE users ENABLE ROW LEVEL SECURITY; ALTER TABLE CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); NOTICE: DB node id: 0 statement: CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); CREATE POLICY GRANT SELECT ON users TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO foo; GRANT GRANT SELECT ON users TO bar; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO bar; GRANT SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- run SELECT as foo. Only user_name = 'foo' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; SET -- run SELECT as bar. Only user_name = 'bar' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- bar | bardata (1 row) -- -- testing row security with row_security = off -- SET ROW_SECURITY TO off; NOTICE: DB node id: 0 statement: SET ROW_SECURITY TO off; SET -- Error expected SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; ERROR: query would be affected by row-level security policy for table "users" -- -- testing SET ROLE -- CREATE TABLE footable(t text); NOTICE: DB node id: 0 statement: CREATE TABLE footable(t text); CREATE TABLE INSERT INTO footable VALUES('foo'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES('foo'); INSERT 0 1 GRANT SELECT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON footable TO foo; GRANT GRANT INSERT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT INSERT ON footable TO foo; GRANT GRANT UPDATE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT UPDATE ON footable TO foo; GRANT GRANT DELETE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT DELETE ON footable TO foo; GRANT SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SESSION AUTHORIZATION -- SET SESSION AUTHORIZATION bar; NOTICE: DB node id: 0 statement: SET SESSION AUTHORIZATION bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SET ROLE. Make sure that query cache is not -- created. -- -- create cache SELECT * FROM footable; t ----- foo (1 row) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo1'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo1'); INSERT 0 1 -- restore ROLE RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- -- explicit transaction case -- -- create cache SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) SELECT * FROM footable; t ------ foo foo1 (2 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo2'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo2'); INSERT 0 1 END; NOTICE: DB node id: 0 statement: END; COMMIT -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- explicit transaction abort case -- -- create cache SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 0 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo3'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo3'); INSERT 0 1 SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 foo3 (4 rows) ABORT; NOTICE: DB node id: 0 statement: ABORT; ROLLBACK -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- Testing REVOKE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET -- GRANT again GRANT SELECT ON t1 TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON t1 TO foo; GRANT -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 -- (thus REVOKE will be rollbacked ) SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 END; NOTICE: DB node id: 0 statement: END; ROLLBACK SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- because REVOKE is rolled back, foo should be able to access t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- REVOKE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) -- execute REVOKE REVOKE SELECT ON t1 FROM foo NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo REVOKE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER ROLE BYPASSRLS case -- ALTER ROLE foo BYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo BYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is all rows SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata bar | bardata (2 rows) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET ALTER ROLE foo NOBYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo NOBYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is one row SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) -- -- Testing ALTER TABLE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- Make sure cache is used SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER TABLE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- -- Testing ALTER DATABASE -- ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- create taget database create database test2; NOTICE: DB node id: 0 statement: create database test2; CREATE DATABASE -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- Make sure cache is used SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER DATABASE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i | j ---+--- 2 | (1 row) SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER ROLE WITH ENCRYPTED PASSWORD and -- ALTER ROLE WITH CONNECTION LIMIT 10 -- do not invalidate query cache SELECT 10; NOTICE: DB node id: 0 statement: SELECT 10; ?column? ---------- 10 (1 row) SELECT 10; ?column? ---------- 10 (1 row) ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; ALTER ROLE ALTER ROLE foo WITH CONNECTION LIMIT 10; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH CONNECTION LIMIT 10; ALTER ROLE SELECT 10; ?column? ---------- 10 (1 row) -- -- PGPOOL SET CACHE DELETE test cases. -- -- force to create cache /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- make sure the cache was created /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- delete the cache PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;'; NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;" SET -- make sure the cache was deleted /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.r0000664000175000017500000004126114760007565021564 00000000000000-- -- testing an effect on a row level security enabled table and SET ROLE -- CREATE TABLE users (user_name TEXT, data TEXT); NOTICE: DB node id: 0 statement: CREATE TABLE users (user_name TEXT, data TEXT); NOTICE: DB node id: 1 statement: CREATE TABLE users (user_name TEXT, data TEXT); CREATE TABLE INSERT INTO users VALUES('foo', 'foodata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('foo', 'foodata'); NOTICE: DB node id: 1 statement: INSERT INTO users VALUES('foo', 'foodata'); INSERT 0 1 INSERT INTO users VALUES('bar', 'bardata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('bar', 'bardata'); NOTICE: DB node id: 1 statement: INSERT INTO users VALUES('bar', 'bardata'); INSERT 0 1 ALTER TABLE users ENABLE ROW LEVEL SECURITY; NOTICE: DB node id: 0 statement: ALTER TABLE users ENABLE ROW LEVEL SECURITY; NOTICE: DB node id: 1 statement: ALTER TABLE users ENABLE ROW LEVEL SECURITY; ALTER TABLE CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); NOTICE: DB node id: 0 statement: CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); NOTICE: DB node id: 1 statement: CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); CREATE POLICY GRANT SELECT ON users TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO foo; NOTICE: DB node id: 1 statement: GRANT SELECT ON users TO foo; GRANT GRANT SELECT ON users TO bar; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO bar; NOTICE: DB node id: 1 statement: GRANT SELECT ON users TO bar; GRANT SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- run SELECT as foo. Only user_name = 'foo' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; NOTICE: DB node id: 1 statement: RESET ROLE; RESET SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; NOTICE: DB node id: 1 statement: SET ROLE TO bar; SET -- run SELECT as bar. Only user_name = 'bar' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- bar | bardata (1 row) -- -- testing row security with row_security = off -- SET ROW_SECURITY TO off; NOTICE: DB node id: 0 statement: SET ROW_SECURITY TO off; NOTICE: DB node id: 1 statement: SET ROW_SECURITY TO off; SET -- Error expected SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; ERROR: query would be affected by row-level security policy for table "users" -- -- testing SET ROLE -- CREATE TABLE footable(t text); NOTICE: DB node id: 0 statement: CREATE TABLE footable(t text); NOTICE: DB node id: 1 statement: CREATE TABLE footable(t text); CREATE TABLE INSERT INTO footable VALUES('foo'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES('foo'); NOTICE: DB node id: 1 statement: INSERT INTO footable VALUES('foo'); INSERT 0 1 GRANT SELECT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON footable TO foo; NOTICE: DB node id: 1 statement: GRANT SELECT ON footable TO foo; GRANT GRANT INSERT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT INSERT ON footable TO foo; NOTICE: DB node id: 1 statement: GRANT INSERT ON footable TO foo; GRANT GRANT UPDATE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT UPDATE ON footable TO foo; NOTICE: DB node id: 1 statement: GRANT UPDATE ON footable TO foo; GRANT GRANT DELETE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT DELETE ON footable TO foo; NOTICE: DB node id: 1 statement: GRANT DELETE ON footable TO foo; GRANT SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; NOTICE: DB node id: 1 statement: SET ROLE TO bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SESSION AUTHORIZATION -- SET SESSION AUTHORIZATION bar; NOTICE: DB node id: 0 statement: SET SESSION AUTHORIZATION bar; NOTICE: DB node id: 1 statement: SET SESSION AUTHORIZATION bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SET ROLE. Make sure that query cache is not -- created. -- -- create cache SELECT * FROM footable; t ----- foo (1 row) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo1'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo1'); NOTICE: DB node id: 1 statement: INSERT INTO footable VALUES ('foo1'); INSERT 0 1 -- restore ROLE RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; NOTICE: DB node id: 1 statement: RESET ROLE; RESET -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- -- explicit transaction case -- -- create cache SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) SELECT * FROM footable; t ------ foo foo1 (2 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo2'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo2'); NOTICE: DB node id: 1 statement: INSERT INTO footable VALUES ('foo2'); INSERT 0 1 END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; COMMIT -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- explicit transaction abort case -- -- create cache SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 0 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo3'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo3'); NOTICE: DB node id: 1 statement: INSERT INTO footable VALUES ('foo3'); INSERT 0 1 SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 foo3 (4 rows) ABORT; NOTICE: DB node id: 1 statement: ABORT; NOTICE: DB node id: 0 statement: ABORT; ROLLBACK -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- Testing REVOKE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 1 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; NOTICE: DB node id: 1 statement: RESET ROLE; RESET -- GRANT again GRANT SELECT ON t1 TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON t1 TO foo; NOTICE: DB node id: 1 statement: GRANT SELECT ON t1 TO foo; GRANT -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; BEGIN -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 1 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 -- (thus REVOKE will be rollbacked ) SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; ROLLBACK SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- because REVOKE is rolled back, foo should be able to access t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- REVOKE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) -- execute REVOKE REVOKE SELECT ON t1 FROM foo NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo NOTICE: DB node id: 1 statement: REVOKE SELECT ON t1 FROM foo REVOKE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER ROLE BYPASSRLS case -- ALTER ROLE foo BYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo BYPASSRLS; NOTICE: DB node id: 1 statement: ALTER ROLE foo BYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is all rows SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata bar | bardata (2 rows) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; NOTICE: DB node id: 1 statement: RESET ROLE; RESET ALTER ROLE foo NOBYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo NOBYPASSRLS; NOTICE: DB node id: 1 statement: ALTER ROLE foo NOBYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; NOTICE: DB node id: 1 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is one row SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) -- -- Testing ALTER TABLE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 1 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; BEGIN ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 1 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- Make sure cache is used SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER TABLE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 1 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 1 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- -- Testing ALTER DATABASE -- ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 1 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- create taget database create database test2; NOTICE: DB node id: 0 statement: create database test2; NOTICE: DB node id: 1 statement: create database test2; CREATE DATABASE -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 1 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; NOTICE: DB node id: 1 statement: BEGIN; BEGIN ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 1 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) END; NOTICE: DB node id: 1 statement: END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- Make sure cache is used SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER DATABASE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i | j ---+--- 2 | (1 row) SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 1 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER ROLE WITH ENCRYPTED PASSWORD and -- ALTER ROLE WITH CONNECTION LIMIT 10 -- do not invalidate query cache SELECT 10; NOTICE: DB node id: 0 statement: SELECT 10; ?column? ---------- 10 (1 row) SELECT 10; ?column? ---------- 10 (1 row) ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; NOTICE: DB node id: 1 statement: ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; ALTER ROLE ALTER ROLE foo WITH CONNECTION LIMIT 10; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH CONNECTION LIMIT 10; NOTICE: DB node id: 1 statement: ALTER ROLE foo WITH CONNECTION LIMIT 10; ALTER ROLE SELECT 10; ?column? ---------- 10 (1 row) -- -- PGPOOL SET CACHE DELETE test cases. -- -- force to create cache /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- make sure the cache was created /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- delete the cache PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;'; NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;" SET -- make sure the cache was deleted /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/expected.s0000664000175000017500000003212014760007565021557 00000000000000-- -- testing an effect on a row level security enabled table and SET ROLE -- CREATE TABLE users (user_name TEXT, data TEXT); NOTICE: DB node id: 0 statement: CREATE TABLE users (user_name TEXT, data TEXT); CREATE TABLE INSERT INTO users VALUES('foo', 'foodata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('foo', 'foodata'); INSERT 0 1 INSERT INTO users VALUES('bar', 'bardata'); NOTICE: DB node id: 0 statement: INSERT INTO users VALUES('bar', 'bardata'); INSERT 0 1 ALTER TABLE users ENABLE ROW LEVEL SECURITY; NOTICE: DB node id: 0 statement: ALTER TABLE users ENABLE ROW LEVEL SECURITY; ALTER TABLE CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); NOTICE: DB node id: 0 statement: CREATE POLICY user_policy ON users USING (user_name = CURRENT_USER); CREATE POLICY GRANT SELECT ON users TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO foo; GRANT GRANT SELECT ON users TO bar; NOTICE: DB node id: 0 statement: GRANT SELECT ON users TO bar; GRANT SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- run SELECT as foo. Only user_name = 'foo' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; SET -- run SELECT as bar. Only user_name = 'bar' data expected. SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- bar | bardata (1 row) -- -- testing row security with row_security = off -- SET ROW_SECURITY TO off; NOTICE: DB node id: 0 statement: SET ROW_SECURITY TO off; SET -- Error expected SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; ERROR: query would be affected by row-level security policy for table "users" -- -- testing SET ROLE -- CREATE TABLE footable(t text); NOTICE: DB node id: 0 statement: CREATE TABLE footable(t text); CREATE TABLE INSERT INTO footable VALUES('foo'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES('foo'); INSERT 0 1 GRANT SELECT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON footable TO foo; GRANT GRANT INSERT ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT INSERT ON footable TO foo; GRANT GRANT UPDATE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT UPDATE ON footable TO foo; GRANT GRANT DELETE ON footable TO foo; NOTICE: DB node id: 0 statement: GRANT DELETE ON footable TO foo; GRANT SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) SET ROLE TO bar; NOTICE: DB node id: 0 statement: SET ROLE TO bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SESSION AUTHORIZATION -- SET SESSION AUTHORIZATION bar; NOTICE: DB node id: 0 statement: SET SESSION AUTHORIZATION bar; SET -- run SELECT as bar. Permission denied is expected. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; ERROR: permission denied for table footable -- -- testing SET ROLE. Make sure that query cache is not -- created. -- -- create cache SELECT * FROM footable; t ----- foo (1 row) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ----- foo (1 row) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo1'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo1'); INSERT 0 1 -- restore ROLE RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- -- explicit transaction case -- -- create cache SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) SELECT * FROM footable; t ------ foo foo1 (2 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 1 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 (2 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo2'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo2'); INSERT 0 1 END; NOTICE: DB node id: 0 statement: END; COMMIT -- Make sure cache was invalidated. SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- explicit transaction abort case -- -- create cache SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- change role SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- run SELECT as foo to make sure that cache is not used. -- If query cache was created we will NOT see -- "NOTICE: DB node id: 0 statement: SELECT ..." SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Modify footable to see cache invalidation works even after SET ROLE. INSERT INTO footable VALUES ('foo3'); NOTICE: DB node id: 0 statement: INSERT INTO footable VALUES ('foo3'); INSERT 0 1 SELECT * FROM footable; NOTICE: DB node id: 0 statement: SELECT * FROM footable; t ------ foo foo1 foo2 foo3 (4 rows) ABORT; NOTICE: DB node id: 0 statement: ABORT; ROLLBACK -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- Make sure we don't see 'foo3' row. SELECT * FROM footable; t ------ foo foo1 foo2 (3 rows) -- -- Testing REVOKE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET -- GRANT again GRANT SELECT ON t1 TO foo; NOTICE: DB node id: 0 statement: GRANT SELECT ON t1 TO foo; GRANT -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN -- REVOKE REVOKE SELECT ON t1 FROM foo; NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo; REVOKE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- Make sure foo cannot SELECT t1 -- (thus REVOKE will be rollbacked ) SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; ERROR: permission denied for table t1 END; NOTICE: DB node id: 0 statement: END; ROLLBACK SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- because REVOKE is rolled back, foo should be able to access t1 SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- REVOKE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) -- execute REVOKE REVOKE SELECT ON t1 FROM foo NOTICE: DB node id: 0 statement: REVOKE SELECT ON t1 FROM foo REVOKE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER ROLE BYPASSRLS case -- ALTER ROLE foo BYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo BYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is all rows SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata bar | bardata (2 rows) RESET ROLE; NOTICE: DB node id: 0 statement: RESET ROLE; RESET ALTER ROLE foo NOBYPASSRLS; NOTICE: DB node id: 0 statement: ALTER ROLE foo NOBYPASSRLS; ALTER ROLE SET ROLE TO foo; NOTICE: DB node id: 0 statement: SET ROLE TO foo; SET -- expect to ignore cache and result is one row SELECT * FROM users; NOTICE: DB node id: 0 statement: SELECT * FROM users; user_name | data -----------+--------- foo | foodata (1 row) -- -- Testing ALTER TABLE -- -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i --- 2 (1 row) -- Make sure cache is used SELECT * FROM t1; i --- 2 (1 row) -- -- ALTER TABLE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i --- 2 (1 row) SELECT * FROM t1; i --- 2 (1 row) ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER TABLE t1 DROP COLUMN j; NOTICE: DB node id: 0 statement: ALTER TABLE t1 DROP COLUMN j; ALTER TABLE -- -- Testing ALTER DATABASE -- ALTER TABLE t1 ADD COLUMN j INT; NOTICE: DB node id: 0 statement: ALTER TABLE t1 ADD COLUMN j INT; ALTER TABLE -- create taget database create database test2; NOTICE: DB node id: 0 statement: create database test2; CREATE DATABASE -- create cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- explicit transaction case BEGIN; NOTICE: DB node id: 0 statement: BEGIN; BEGIN ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure cache is not used SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) END; NOTICE: DB node id: 0 statement: END; COMMIT SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- Make sure cache is used SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER DATABASE is executed on another session case -- -- Make sure to create cache SELECT * FROM t1; i | j ---+--- 2 | (1 row) SELECT * FROM t1; i | j ---+--- 2 | (1 row) ALTER DATABASE test2 RESET ALL; NOTICE: DB node id: 0 statement: ALTER DATABASE test2 RESET ALL; ALTER DATABASE -- Make sure this does not access cache SELECT * FROM t1; NOTICE: DB node id: 0 statement: SELECT * FROM t1; i | j ---+--- 2 | (1 row) -- -- ALTER ROLE WITH ENCRYPTED PASSWORD and -- ALTER ROLE WITH CONNECTION LIMIT 10 -- do not invalidate query cache SELECT 10; NOTICE: DB node id: 0 statement: SELECT 10; ?column? ---------- 10 (1 row) SELECT 10; ?column? ---------- 10 (1 row) ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH ENCRYPTED PASSWORD 'foo'; ALTER ROLE ALTER ROLE foo WITH CONNECTION LIMIT 10; NOTICE: DB node id: 0 statement: ALTER ROLE foo WITH CONNECTION LIMIT 10; ALTER ROLE SELECT 10; ?column? ---------- 10 (1 row) -- -- PGPOOL SET CACHE DELETE test cases. -- -- force to create cache /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- make sure the cache was created /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) -- delete the cache PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;'; NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;" SET -- make sure the cache was deleted /*FORCE QUERY CACHE*/SELECT 1; NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1; ?column? ---------- 1 (1 row) pgpool-II-4.6.0/src/test/regression/tests/006.memqcache/test.sh0000775000175000017500000004112514760007565021115 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 PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto PCP_INVALIDATE_QUERY_CACHE=$PGPOOL_INSTALL_DIR/bin/pcp_invalidate_query_cache # remove error/notice details (message and so on) from # ErrorResponse or NoticeResponse messages. # used for pgproto. function del_details_from_error { cat|sed -e '/ErrorResponse/s/ F .*//' -e '/NoticeResponse/s/ F .*$//' } 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 "cache_safe_memqcache_table_list = 'cache_safe_v'" >> etc/pgpool.conf echo "cache_unsafe_memqcache_table_list = 'cache_unsafe_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 cache_unsafe_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 cache_safe_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 immutable_func > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep volatile_func > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep explain_analyze > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep CURRENT_TIMESTAMP > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep CURRENT_USER > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep 'TIMESTAMP;' > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep 'TIME;' > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep 'DATE;' > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep 'TIMESTAMPTZ;' > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep 'TIMETZ;' > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep 'to_timestamp' > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep 'FORCE QUERY CACHE' > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep 'NO QUERY CACHE' > /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 echo "backend_weight1 = 0" >> etc/pgpool.conf echo "notice_per_node_statement = on" >> etc/pgpool.conf ./startall wait_for_pgpool_startup createuser foo createuser bar $PSQL -a test >> result 2>&1 <> result # $PGPROTO -d test -f ../row_security.data |& del_details_from_error >> result $PSQL -a -U foo test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../set_role1.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result # $PGPROTO -d test -f ../session_authorization.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result # $PGPROTO -d test -f ../set_role2.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../set_role3.data |& del_details_from_error >> result # $PSQL -a test >> result 2>&1 <> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../set_role4.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../revoke1.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../revoke2.data |& del_details_from_error >> result # $PGPROTO -d test -f ../revoke3.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result # $PGPROTO -d test -f ../alter_role.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../alter_table1.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../alter_table2.data |& del_details_from_error >> result # $PGPROTO -d test -f ../alter_table3.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../alter_database1.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 <> result # $PGPROTO -d test -f ../alter_database2.data |& del_details_from_error >> result # $PGPROTO -d test -f ../alter_database3.data |& del_details_from_error >> result $PSQL -a test >> result 2>&1 <> result 2>&1 < $log if [ $? != 0 ];then echo "test failed in mode: $mode" cat $log rm $log exit 1 fi rm $log cd $TESTDIR ./startall wait_for_pgpool_startup # test for pcp_invalidate_query_cache res1=`$PSQL -t -c "/*FORCE QUERY CACHE*/SELECT current_timestamp" test` res2=`$PSQL -t -c "/*FORCE QUERY CACHE*/SELECT current_timestamp" test` # make sure query cache created if [ "$res1" != "$res2" ];then echo "query cache was not created in pcp_invalidate_query_cache test" ./shutdownall exit 1 fi # remove query cache $PCP_INVALIDATE_QUERY_CACHE -p $PCP_PORT if [ $? != 0 ];then echo "pcp_invalidate_query_cache failed" ./shutdownall exit 1 fi # make sure query cache has gone $PSQL -t -c "SELECT 1" test # this query processes query cache invalidation request res1=`$PSQL -t -c "/*FORCE QUERY CACHE*/SELECT current_timestamp" test` if [ "$res1" = "$res2" ];then echo "query cache was not invalidated" ./shutdownall exit 1 fi ./shutdownall cd .. done # # Test for extended query protocol coner cases in streaming replication mode. # These tests are basically for a sequence of extended queries: # 1. execute a SELECT and create query cache entry. # 2. sync. # 3. execute another a SELECT. # 4. execute bind and execute to use the query cache created at #1. # 5. sync. 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 "memory_cache_enabled = on" >> etc/pgpool.conf cd .. for i in 1 2 3 4 4 do # # case 1: failed with kind mismatch error at #5. # "packet kind of backend 0 ['T'] does not match with main/majority nodes packet kind ['Z']" # # case 2: step #4 includes error (hung). # # case 3: step #4 includes PortalSuspended (hung). # # case 4: various cases including portal suspended # Note that case4 is executed twice to make sure that # the test works for either query cache exists or does not exist cd $TESTDIR ./startall wait_for_pgpool_startup timeout 1 $PGPROTO -d test -f ../query_cache_bug$i.data |& del_details_from_error > result if [ $? != 0 ];then # timeout happened or pgproto returned non 0 status echo "test failed in test case #2 (timeout)" err=true ./shutdownall exit 1 fi ./shutdownall cd .. diff -c expected.$i $TESTDIR/result > $log if [ $? != 0 ];then echo "test failed in test case $i" cat $log rm $log exit 1 fi done exit 0 pgpool-II-4.6.0/src/test/regression/tests/007.memqcache-memcached/0000775000175000017500000000000014760001620021543 500000000000000pgpool-II-4.6.0/src/test/regression/tests/007.memqcache-memcached/.gitignore0000664000175000017500000000001114760001620023443 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/007.memqcache-memcached/expected.txt0000664000175000017500000000000214760001620024015 000000000000002 pgpool-II-4.6.0/src/test/regression/tests/007.memqcache-memcached/jdbctest.java0000664000175000017500000000257414760001620024140 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.6.0/src/test/regression/tests/007.memqcache-memcached/test.sh0000775000175000017500000000216014760001620023000 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.6.0/src/test/regression/tests/008.dbredirect/0000775000175000017500000000000014760007565020042 500000000000000pgpool-II-4.6.0/src/test/regression/tests/008.dbredirect/.gitignore0000664000175000017500000000001114760001620021724 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/008.dbredirect/select.pgbench0000664000175000017500000000002014760007565022561 00000000000000SELECT 'test16' pgpool-II-4.6.0/src/test/regression/tests/008.dbredirect/select1.pgbench0000664000175000017500000000002014760007565022642 00000000000000SELECT 'test18' pgpool-II-4.6.0/src/test/regression/tests/008.dbredirect/test.sh0000775000175000017500000001374614760007565021313 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for user_redirect_preference_list, database_redirect_preference_list and app_name_redirect_preference_list. # requires pgbench. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql CREATEDB=$PGBIN/createdb CREATEUSER=$PGBIN/createuser PGBENCH=$PGBENCH_PATH function getnode() { grep $1 log/pgpool.log | grep SELECT | grep LOG | awk '{print $10}' } 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 # disable delay_threshold so that replication delay does not affect the tests. echo "delay_threshold = 0" >> etc/pgpool.conf ok=yes #------------------------------------------------------------------- # Test user_redirect_preference_list #------------------------------------------------------------------- echo "user_redirect_preference_list = 'user1:primary,user2:1,user3:standby,user4:primary(1.0),user5:standby(0.0),user[6-9]:2'" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres $CREATEUSER user1 $CREATEUSER user2 $CREATEUSER user3 $CREATEUSER user4 $CREATEUSER user5 $CREATEUSER user6 # 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 is_replicated=true for i in user1 user2 user3 user4 user5 user6 do echo "try to connect to PostgreSQL using user $i:$myport" $PSQL -p $myport -U $i -c "select 1" test if [ $? != 0 ];then is_replicated=false break fi done if [ $is_replicated = "false" ];then sleep 1 else break fi done done # Test1: should be redirect to primary (node 0) $PSQL -U user1 -c "SELECT 'test1'" test test `getnode "'test1'"` -eq 0 || ok=ng echo $ok # Test2: should be redirect to node 1 $PSQL -U user2 -c "SELECT 'test2'" test test `getnode "'test2'"` -eq 1 || ok=ng echo $ok # Test3: should be redirect to either node 1 or 2 (standby) $PSQL -U user3 -c "SELECT 'test3'" test test `getnode "'test3'"` -eq 1 -o `getnode "test3"` -eq 2 || ok=ng echo $ok # Test4: should be redirect to primary (node 0) $PSQL -U user4 -c "SELECT 'test4'" test test `getnode "'test4'"` -eq 0 || ok=ng echo $ok # Test5: should be redirect to primary (node 0) $PSQL -U user5 -c "SELECT 'test5'" test test `getnode "'test5'"` -eq 0 || ok=ng echo $ok # Test6: should be redirect to node 2 $PSQL -U user6 -c "SELECT 'test6'" test test `getnode "'test6'"` -eq 2 || ok=ng echo $ok #------------------------------------------------------------------- # Test database_redirect_preference_list #------------------------------------------------------------------- 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 ./pgpool_reload sleep 10 wait_for_pgpool_startup $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 is_replicated=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 is_replicated=false break fi done if [ $is_replicated = "false" ];then sleep 1 else break fi done done # Test7: should be redirect to primary (node 0) $PSQL -c "SELECT 'test7'" postgres test `getnode "'test7'"` -eq 0 || ok=ng echo $ok # Test8: should be redirect to node 1 $PSQL -c "SELECT 'test8'" test test `getnode "'test8'"` -eq 1 || ok=ng echo $ok # Test9: should be redirect to node 2 $PSQL -c "SELECT 'test9'" mydb6 test `getnode "'test9'"` -eq 2 || ok=ng echo $ok # Test10: should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test10'" test2 test `getnode "'test10'"` -eq 1 -o `getnode "test10"` -eq 2 || ok=ng echo $ok # Test11: should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test11'" test3 test `getnode "'test11'"` -eq 1 -o `getnode "test11"` -eq 2 || ok=ng echo $ok # Test12: should be redirect to primary (node 0) $PSQL -c "SELECT 'test12'" test4 test `getnode "'test12'"` -eq 0 || ok=ng echo $ok # Test13: should be redirect to primary (node 0) $PSQL -c "SELECT 'test13'" test5 test `getnode "'test13'"` -eq 0 || ok=ng echo $ok # Test14: For example: # if it matches both of user_redirect_preference_list and database_redirect_preference_list, # should be redirect to node 1 because database name is test # user_redirect_preference_list = 'user4:primary(1.0)' # database_redirect_preference_list = 'test:1' $PSQL -U user4 -c "SELECT 'test14'" test test `getnode "'test14'"` -eq 1 || ok=ng #------------------------------------------------------------------- # Test app_name_redirect_preference_list #------------------------------------------------------------------- $PGBENCH -i postgres echo "app_name_redirect_preference_list = 'psql:primary,pgbench:standby'" >> etc/pgpool.conf ./pgpool_reload sleep 10 wait_for_pgpool_startup # Test15: should be redirect to node 0 because application name is psql $PSQL -c "SELECT 'test15'" mydb6 test `getnode "'test15'"` -eq 0 || ok=ng echo $ok # Test16: should be redirect to either node 1 or 2 $PGBENCH -t 1 -f ../select.pgbench postgres test `getnode "'test16'"` -eq 1 -o `getnode "test16"` -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 # Test17: should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test17'" mydb6 test `getnode "'test17'"` -eq 1 -o `getnode "test17"` -eq 2 || ok=ng echo $ok # Test18: should be redirect to either node 1 or 2 $PGBENCH -t 1 -f ../select1.pgbench postgres test `getnode "'test18'"` -eq 1 -o `getnode "test18"` -eq 2 || ok=ng echo $ok ./shutdownall if [ $ok = "yes" ];then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/009.sql_comments/0000775000175000017500000000000014760007565020440 500000000000000pgpool-II-4.6.0/src/test/regression/tests/009.sql_comments/.gitignore0000664000175000017500000000001114760001620022322 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/009.sql_comments/test.sh0000775000175000017500000000277514760007565021711 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 $10}' } 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 1. this comment is old feature. $PSQL -c "/*No LOAD BALANCE*/SELECT 'case6'" test test `getnode "case6"` -eq 1 || ok=ng ./shutdownall if [ $ok = "yes" ];then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/0000775000175000017500000000000014760007565021470 500000000000000pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/expected.txt0000664000175000017500000000012414760001620023731 00000000000000./run-test parse_schedule testcase insert: OK testcase update: OK testcase misc: OK pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/0000775000175000017500000000000014760007565023473 500000000000000pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/.gitignore0000664000175000017500000000001314760001620025357 00000000000000result.txt pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/0000775000175000017500000000000014760007565025274 500000000000000pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/insert.out0000664000175000017500000000331414760001620027234 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/update.out0000664000175000017500000000113214760001620027206 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/misc.out0000664000175000017500000000041414760007565026677 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/0000775000175000017500000000000014760001620024614 500000000000000pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/insert.sql0000664000175000017500000000142714760001620026565 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/misc.sql0000664000175000017500000000020214760001620026202 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/update.sql0000664000175000017500000000046214760001620026541 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/parse_schedule0000664000175000017500000000002314760001620026301 00000000000000insert update misc pgpool-II-4.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/run-test0000775000175000017500000000251214760001620025104 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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/Makefile0000664000175000017500000000164014760007565025054 00000000000000PROGRAM=timestamp-test topsrc_dir=../../../../.. CPPFLAGS=-I$(topsrc_dir)/include -I$(shell $(PGBIN)/pg_config --includedir) CFLAGS=-Wall -O0 -g -std=gnu99 CC=gcc OBJS=main.o \ $(topsrc_dir)/utils/strlcpy.o \ $(topsrc_dir)/utils/pgstrcasecmp.o \ $(topsrc_dir)/utils/psprintf.o \ $(topsrc_dir)/main/pool_globals.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 pgstrcasecmp.o $(MAKE) -C $(topsrc_dir)/utils psprintf.o $(MAKE) -C $(topsrc_dir)/main pool_globals.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.6.0/src/test/regression/tests/010.rewrite_timestamp/timestamp/main.c0000664000175000017500000000724714760007565024515 00000000000000#include #include #include #include "pool.h" #include "pool_config.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "protocol/pool_pg_utils.h" #include "utils/pool_relcache.h" #include "rewrite/pool_timestamp.h" #include "parser/parser.h" /* for get_current_timestamp() (MAIN() macro) */ POOL_REQUEST_INFO _req_info; POOL_REQUEST_INFO *Req_info = &_req_info; POOL_CONFIG _pool_config; POOL_CONFIG *pool_config = &_pool_config; bool redirection_done = false; 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_main_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->backend_clustering_mode = CM_NATIVE_REPLICATION; if (argc != 2) { fprintf(stderr, "./timestamp-test query\n"); exit(1); } tree = raw_parser(argv[1], RAW_PARSE_DEFAULT, 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.6.0/src/test/regression/tests/010.rewrite_timestamp/test.sh0000775000175000017500000000051114760007565022723 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for unit test of rewriting timestamp queries. # 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.6.0/src/test/regression/tests/011.watchdog_quorum_failover/0000775000175000017500000000000014760007565023024 500000000000000pgpool-II-4.6.0/src/test/regression/tests/011.watchdog_quorum_failover/.gitignore0000664000175000017500000000003314760001620024712 00000000000000leader/ standby/ standby2/ pgpool-II-4.6.0/src/test/regression/tests/011.watchdog_quorum_failover/leader.conf0000664000175000017500000000065614760001620025040 00000000000000# leader watchdog use_watchdog = on wd_interval = 1 wd_priority = 5 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/011.watchdog_quorum_failover/standby.conf0000664000175000017500000000071514760001620025244 00000000000000# standby watchdog port = 11100 pcp_port = 11105 use_watchdog = on wd_interval = 1 wd_priority = 3 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/011.watchdog_quorum_failover/standby2.conf0000664000175000017500000000071614760001620025327 00000000000000# standby2 watchdog port = 11200 pcp_port = 11205 use_watchdog = on wd_interval = 1 wd_priority = 1 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/011.watchdog_quorum_failover/test.sh0000775000175000017500000001457314760007565024274 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 LEADER_DIR=leader STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=9 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $LEADER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "leader setup done." # copy the configurations from leader to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from leader to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./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 leader. 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 echo 1 > $STANDBY_DIR/etc/pgpool_node_id # start the standby 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 leader. 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 echo 2 > $STANDBY2_DIR/etc/pgpool_node_id # start the standby 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 leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby has successfully joined connected to the leader. 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 leader. 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 leader/data1 -m f stop echo "Checking if leader detects the shutdown error" for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "failover" $LEADER_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 leader pgpool and see if standby takes over the roll $PGPOOL_INSTALL_DIR/bin/pgpool -f $LEADER_DIR/etc/pgpool.conf -m f stop echo "Checking if the Standby pgpool-II detected the leader 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 "Leader 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 leader 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 leader." 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 leader ./shutdownall echo "$success_count out of $num_tests successful"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/0000775000175000017500000000000014760007565025445 500000000000000pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/.gitignore0000664000175000017500000000003314760001620027333 00000000000000leader/ standby/ standby2/ pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/leader.conf0000664000175000017500000000107514760001620027455 00000000000000# leader 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby.conf0000664000175000017500000000113414760001620027661 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby2.conf0000664000175000017500000000113514760001620027744 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/test.sh0000775000175000017500000001313114760007565026702 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 LEADER_DIR=leader STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=5 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $LEADER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "leader setup done." # copy the configurations from leader to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from leader to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./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 leader. 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 echo 1 > $STANDBY_DIR/etc/pgpool_node_id # start the standby 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 leader. 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 echo 2 > $STANDBY2_DIR/etc/pgpool_node_id # start the standby 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 leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader brought up successfully." break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication error on leader for DB node 1 echo "1 down" > $LEADER_DIR/log/backend_down_request echo "Checking if the Leader 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" $LEADER_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 standby 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 standby 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 leader. 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 leader. 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" > $LEADER_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 leader ./shutdownall echo "$success_count out of $num_tests successful"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/0000775000175000017500000000000014760007565025252 500000000000000pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/.gitignore0000664000175000017500000000003314760001620027140 00000000000000leader/ standby/ standby2/ pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/leader.conf0000664000175000017500000000107414760001620027261 00000000000000# leader 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/standby.conf0000664000175000017500000000113314760001620027465 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/standby2.conf0000664000175000017500000000113414760001620027550 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/013.watchdog_failover_require_consensus/test.sh0000775000175000017500000001374514760007565026522 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 LEADER_DIR=leader STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=7 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $LEADER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "leader setup done." # copy the configurations from leader to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from leader to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./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 leader. 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 echo 1 > $STANDBY_DIR/etc/pgpool_node_id # start the standby 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 leader. 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 echo 2 > $STANDBY2_DIR/etc/pgpool_node_id # start the standby 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 leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby1 has successfully joined connected to the leader. 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 leader. 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 successfully 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 leader is waiting for consensus" break; fi echo "[check] $i times" sleep 2 done echo "Checking if the Leader 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" $LEADER_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Fake DB error delivered to leader. and leader 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 leader ./shutdownall echo "$success_count out of $num_tests successful"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/0000775000175000017500000000000014760007565023560 500000000000000pgpool-II-4.6.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/.gitignore0000664000175000017500000000001014760001620025441 00000000000000leader/ pgpool-II-4.6.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/leader.conf0000664000175000017500000000107414760001620025567 00000000000000# leader 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/014.watchdog_test_quorum_bypass/test.sh0000775000175000017500000000342314760007565025020 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 LEADER_DIR=leader num_tests=2 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $LEADER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "leader setup done." source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./startall wait_for_pgpool_startup # back to test root dir cd .. # First test check if pgpool-II became a leader. echo "Waiting for the pgpool leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader 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 successfully executed" success_count=$(( success_count + 1 )) fi cd leader ./shutdownall echo "$success_count out of $num_tests successful"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/0000775000175000017500000000000014760007565024370 500000000000000pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/.gitignore0000664000175000017500000000003314760001620026256 00000000000000leader/ standby/ standby2/ pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/leader.conf0000664000175000017500000000107414760001620026377 00000000000000# leader 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby.conf0000664000175000017500000000113314760001620026603 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby2.conf0000664000175000017500000000113414760001620026666 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 hostname0 = 'localhost' wd_port0 = 21004 pgpool_port0 = 11000 hostname1 = 'localhost' wd_port1 = 21104 pgpool_port1 = 11100 hostname2 = 'localhost' wd_port2 = 21204 pgpool_port2 = 11200 heartbeat_hostname0 = 'localhost' heartbeat_port0 = 21005 heartbeat_hostname1 = 'localhost' heartbeat_port1 = 21105 heartbeat_hostname2 = 'localhost' heartbeat_port2 = 21205 pgpool-II-4.6.0/src/test/regression/tests/015.watchdog_master_and_backend_fail/test.sh0000775000175000017500000001274314760007565025635 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 leader and backend goes down at same time Pgpool-II behaves as expected # source $TESTLIBS LEADER_DIR=leader STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=6 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $LEADER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $LEADER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in leader directory cd $LEADER_DIR # create leader environment echo -n "creating leader pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "leader setup done." # copy the configurations from leader to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from leader to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../leader.conf >> etc/pgpool.conf echo 0 > etc/pgpool_node_id ./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 leader. 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 echo 1 > $STANDBY_DIR/etc/pgpool_node_id # start the standby 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 leader. 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 echo 2 > $STANDBY2_DIR/etc/pgpool_node_id # start the standby 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 leader..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $LEADER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Leader brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby1 has successfully joined connected to the leader. 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 leader. 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 leader and one PG server by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $LEADER_DIR/etc/pgpool.conf -m f stop $PG_CTL -D $LEADER_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 leader..." 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 leader 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 leader 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 leader ./shutdownall echo "$success_count out of $num_tests successful"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.6.0/src/test/regression/tests/016.node_0_is_not_primary/0000775000175000017500000000000014760001620022176 500000000000000pgpool-II-4.6.0/src/test/regression/tests/016.node_0_is_not_primary/.gitignore0000664000175000017500000000001114760001620024076 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/016.node_0_is_not_primary/test.sh0000775000175000017500000000247214760001620023441 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 main/primary test `$PSQL -c "show pool_nodes"|egrep "primary|main"|awk '{print $1}'` = 1 && test `$PSQL -c "show pool_nodes"|egrep "primary|main"|awk '{print $7}'` = "up" if [ $? != 0 ] then echo "node 1 is not primary or main" ./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.6.0/src/test/regression/tests/017.node_0_is_down/0000775000175000017500000000000014760007565020621 500000000000000pgpool-II-4.6.0/src/test/regression/tests/017.node_0_is_down/.gitignore0000664000175000017500000000001114760001620022503 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/017.node_0_is_down/test.sh0000775000175000017500000000670514760007565022067 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 access." ./shutdownall exit 1 fi $PSQL -c "drop table t1" postgres ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/018.detach_primary/0000775000175000017500000000000014760007565020727 500000000000000pgpool-II-4.6.0/src/test/regression/tests/018.detach_primary/.gitignore0000664000175000017500000000001114760001620022611 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/018.detach_primary/test.sh0000775000175000017500000000542514760007565022173 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 cat show_pool_nodes primary_node=`grep primary show_pool_nodes|grep -v standby|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 # # test with watchdog enabled # # wipe out everything cd .. rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create 3 node pgpool with 3 backends. $WATCHDOG_SETUP -wn 3 -n 3 # enable detach_false_primary for i in 0 1 2 do echo "detach_false_primary = on" >> pgpool$i/etc/pgpool.conf done # start only pgpool0 and backend so that the quorum is absent. cd pgpool0 source ./bashrc.ports ./startall cd .. export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # promote #3 node to create false primary $PG_CTL -D pgpool0/data2 promote wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres|grep down if [ $? = 0 ];then echo "node is down despite that the quorum is absent" ./shutdownall exit 1 fi # start pgpool1 and pgpool2 so that the quorum exists. echo "testing the case when the quorum exists" cd pgpool1 ./startall cd .. cd pgpool2 ./startall cd .. wait_for_pgpool_startup $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT date for i in {1..30} do cnt=`$PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT|egrep "MASTER|LEADER|STANDBY"|wc -l` if [ $cnt = 3 ];then echo "watchdog is ready" break fi sleep 1 done date ok=n for i in {1..10} do $PSQL -c "show pool_nodes" postgres $PSQL -c "show pool_nodes" postgres|grep down if [ $? = 0 ];then ok=y break fi sleep 1 done if [ $ok != 'y' ];then echo "node is not down despite that the quorum exists" ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/019.log_client_messages/0000775000175000017500000000000014760007565021743 500000000000000pgpool-II-4.6.0/src/test/regression/tests/019.log_client_messages/.gitignore0000664000175000017500000000001114760001620023625 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/019.log_client_messages/tests/0000775000175000017500000000000014760001620023067 500000000000000pgpool-II-4.6.0/src/test/regression/tests/019.log_client_messages/tests/copy.data0000664000175000017500000000047214760001620024617 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.6.0/src/test/regression/tests/019.log_client_messages/tests/describe.data0000664000175000017500000000026514760001620025425 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.6.0/src/test/regression/tests/019.log_client_messages/tests/extended_query.data0000664000175000017500000000047014760001620026670 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.6.0/src/test/regression/tests/019.log_client_messages/tests/function.data0000664000175000017500000000055014760001620025467 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.6.0/src/test/regression/tests/019.log_client_messages/tests/simple.data0000664000175000017500000000013214760001620025127 00000000000000# Test for simple-query protocol 'Q' 'Q' "SELECT * FROM pgbench_accounts LIMIT 1" 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/019.log_client_messages/test.sh0000775000175000017500000001001114760007565023172 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 parameter 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 running 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 successful"; if test $success_count -eq $num_tests then exit 0; fi exit 1; pgpool-II-4.6.0/src/test/regression/tests/020.allow_clear_text_frontend_auth/0000775000175000017500000000000014760007565024175 500000000000000pgpool-II-4.6.0/src/test/regression/tests/020.allow_clear_text_frontend_auth/test.sh0000775000175000017500000000644414760007565025443 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 successfully" 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 successfully" 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 successfully" 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 successfully" 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.6.0/src/test/regression/tests/021.pool_passwd_auth/0000775000175000017500000000000014760007565021301 500000000000000pgpool-II-4.6.0/src/test/regression/tests/021.pool_passwd_auth/pool_hba.conf0000664000175000017500000000654614760001620023650 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.6.0/src/test/regression/tests/021.pool_passwd_auth/test.sh0000775000175000017500000000750614760007565022547 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 successfully" 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 successfully" 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 successfully" 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 successfully" 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.6.0/src/test/regression/tests/022.pool_passwd_alternative_auth/0000775000175000017500000000000014760007565023700 500000000000000pgpool-II-4.6.0/src/test/regression/tests/022.pool_passwd_alternative_auth/pool_hba.conf0000664000175000017500000000654614760001620026247 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.6.0/src/test/regression/tests/022.pool_passwd_alternative_auth/test.sh0000775000175000017500000000706714760007565025150 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 successfully" 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 successfully" 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 successfully" 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 successfully" 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.6.0/src/test/regression/tests/023.ssl_connection/0000775000175000017500000000000014760007565020750 500000000000000pgpool-II-4.6.0/src/test/regression/tests/023.ssl_connection/README0000664000175000017500000000040314760001620021527 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.6.0/src/test/regression/tests/023.ssl_connection/server.crt0000664000175000017500000001030514760001620022671 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.6.0/src/test/regression/tests/023.ssl_connection/server.key0000664000175000017500000000321714760001620022675 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.6.0/src/test/regression/tests/023.ssl_connection/server.req0000664000175000017500000000653614760001620022703 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.6.0/src/test/regression/tests/023.ssl_connection/test.sh0000775000175000017500000000504414760007565022211 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 = '$SSL_KEY'" >> etc/pgpool.conf echo "ssl_cert = '$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 # connections 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.6.0/src/test/regression/tests/024.cert_auth/0000775000175000017500000000000014760007565017707 500000000000000pgpool-II-4.6.0/src/test/regression/tests/024.cert_auth/cert.sh0000775000175000017500000000505014760001620021105 00000000000000#!/usr/bin/env bash [ -e "index.txt" ] && rm "index.txt" touch index.txt echo '1000' > serial echo 'unique_subject = yes/no' > index.txt.attr echo '1000' > crlnumber if [ -d "certrecord" ]; then rm -Rf certrecord; fi mkdir certrecord if [ -d "newcerts" ]; then rm -Rf newcerts; fi mkdir newcerts cat > crl_openssl.conf < Pgpool-II. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test SSL_KEY=server.key SSL_CRT=server.crt SSL_CRL=server.crl SSL_CRL2=server_revoked.crl ROOT_CRT=root.crt # Generate certifications ./cert.sh chmod 600 *.key dir=`pwd` FRONTEND_KEY=$dir/frontend.key FRONTEND_CRT=$dir/frontend.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_CRL etc/ cp -p ../$SSL_CRL2 etc/ cp -p ../$ROOT_CRT etc/ 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 export PGSSLROOTCERT=$dir/$ROOT_CRT $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 # Starting CRL verification # Adding valid CRL file in pgpool.conf file. echo "ssl_crl_file = '$SSL_CRL'" >> etc/pgpool.conf # Check pgpool configuration is updated successfully grep "server.crl" etc/pgpool.conf if [ $? != 0 ];then echo "pgpool.conf is not updated with CRL file." ./shutdownall exit 1 fi # Start Server and PgPool ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup export PGSSLCERT=$FRONTEND_CRT export PGSSLKEY=$FRONTEND_KEY export PGSSLROOTCERT=$dir/$ROOT_CRT $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 with clean CRL failed." ./shutdownall exit 1 fi echo "Checking cert auth between Pgpool-II and frontend with clean CRL was ok." ./shutdownall # Adding CRL file with revoked certification entry in pgpool.conf file. echo "Updating pgpool.conf with revoked CRL file" sed -i 's/server.crl/server_revoked.crl/' etc/pgpool.conf # Check pgpool configuration is updated successfully grep "server_revoked.crl" etc/pgpool.conf if [ $? != 0 ];then echo "pgpool.conf is not updated with revoked CRL file." ./shutdownall exit 1 fi # Start Server and PgPool ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup export PGSSLCERT=$FRONTEND_CRT export PGSSLKEY=$FRONTEND_KEY export PGSSLROOTCERT=$dir/$ROOT_CRT $PSQL -h localhost -c "select 1" test > $dir/crl_session.log 2>&1 grep "alert certificate revoked" $dir/crl_session.log if [ $? != 0 ];then echo "Checking cert auth between Pgpool-II and frontend with revoked entry in CRL failed." ./shutdownall exit 1 fi echo "Checking cert auth between Pgpool-II and frontend with revoked entry in CRL was ok." ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/025.enable_shared_relcache/0000775000175000017500000000000014760007565022334 500000000000000pgpool-II-4.6.0/src/test/regression/tests/025.enable_shared_relcache/test.sh0000775000175000017500000000272114760007565023574 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 "committing 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 "committing 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.6.0/src/test/regression/tests/026.temp_table/0000775000175000017500000000000014760007565020047 500000000000000pgpool-II-4.6.0/src/test/regression/tests/026.temp_table/expected.txt0000664000175000017500000000240214760001620022311 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.6.0/src/test/regression/tests/026.temp_table/temp_table.sql0000664000175000017500000000153514760001620022612 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.6.0/src/test/regression/tests/026.temp_table/test.sh0000775000175000017500000000141114760007565021302 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/pgpool.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.6.0/src/test/regression/tests/027.auto_failback/0000775000175000017500000000000014760007565020520 500000000000000pgpool-II-4.6.0/src/test/regression/tests/027.auto_failback/.gitignore0000664000175000017500000000001114760001620022402 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/027.auto_failback/test.sh0000775000175000017500000000370714760007565021765 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 success $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 status 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.6.0/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/0000775000175000017500000000000014760007565026410 500000000000000pgpool-II-4.6.0/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh0000775000175000017500000000646014760007565027654 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 } # return 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 if 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 sleep 5 if quorum_exists then echo "Quorum exists. Test failed" failed=true else echo "Quorum does not exist. Test succeeded" fi ./shutdownall sleep 5 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 sleep 5 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 echo "Check if whole pgpool process went down" ps aux|grep pgpool done if [ $failed = "true" ];then exit 1 fi exit 0 pgpool-II-4.6.0/src/test/regression/tests/029.cert_passphrase/0000775000175000017500000000000014760001620021106 500000000000000pgpool-II-4.6.0/src/test/regression/tests/029.cert_passphrase/cert.sh0000775000175000017500000000121314760001620022317 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 with password openssl genrsa -aes256 -out server.key -passout pass:pgpoolsecret 2048 openssl req -new -out server.req -key server.key -subj "/CN=postgresql" -passin pass:pgpoolsecret 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.6.0/src/test/regression/tests/029.cert_passphrase/test.sh0000775000175000017500000000506114760001620022346 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 CERTPW=pgpoolsecret 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 # # Without Pass Phrase entry # ./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 "cannot be reloaded because it requires a passphrase" log/pgpool.log if [ $? != 0 ];then echo "Checking cert without password failed." ./shutdownall exit 1 fi echo "Checking cert without password was ok." ./shutdownall # # Valid Pass Phrase # echo "ssl_passphrase_command = 'echo \"$CERTPW\"'" >> etc/pgpool.conf grep "ssl_passphrase_command" etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL -h localhost -c "select 1" test grep "SSL certificate authentication for user" log/pgpool.log if [ $? != 0 ];then echo "Checking cert with valid password failed." ./shutdownall exit 1 fi echo "Checking cert with valid password was ok." ./shutdownall # # Invalid Pass Phrase # sed -i 's/ssl_passphrase_command/#ssl_passphrase_command/' etc/pgpool.conf echo "ssl_passphrase_command = 'echo \"incorrectpw\"'" >> etc/pgpool.conf grep "ssl_passphrase_command" etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL -h localhost -c "select 1" test grep "could not load private key file" log/pgpool.log|grep "bad decrypt" if [ $? != 0 ];then echo "Checking cert with invalid password failed." ./shutdownall exit 1 fi echo "Checking cert with invalid password was ok." ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/030.snapshot_isolation/0000775000175000017500000000000014760001620021630 500000000000000pgpool-II-4.6.0/src/test/regression/tests/030.snapshot_isolation/expected.txt0000664000175000017500000000004714760001620024113 00000000000000 count ------- 1 (1 row) VACUUM pgpool-II-4.6.0/src/test/regression/tests/030.snapshot_isolation/inconsistency1.sql0000664000175000017500000000004514760001620025241 00000000000000BEGIN; UPDATE t1 SET i = i + 1; END; pgpool-II-4.6.0/src/test/regression/tests/030.snapshot_isolation/inconsistency2.sql0000664000175000017500000000005614760001620025244 00000000000000BEGIN; INSERT INTO log SELECT * FROM t1; END; pgpool-II-4.6.0/src/test/regression/tests/030.snapshot_isolation/test.sh0000775000175000017500000000451414760001620023072 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for snapshot isolation mode. # 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 -m i|| exit 1 echo "done." dir=`pwd` source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL </dev/null if [ $? != 0 ];then echo "Transaction results are inconsistent (simple query)." ./shutdownall exit 1 fi echo "Transaction results are consistent (simple query)." $PSQL </dev/null if [ $? != 0 ];then echo "Transaction results inconsistent (extended query)." ./shutdownall exit 1 fi echo "Transaction results are consistent (extended query)." # Test #2. VACUUM after SELECT. psql test > results.txt 2>&1 </dev/null if [ $? != 0 ];then echo "test #2 failed." ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/031.connection_life_time/0000775000175000017500000000000014760001620022065 500000000000000pgpool-II-4.6.0/src/test/regression/tests/031.connection_life_time/test.sh0000775000175000017500000000235114760001620023324 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 -h localhost -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.6.0/src/test/regression/tests/032.dml_adaptive_load_balance/0000775000175000017500000000000014760001620023007 500000000000000pgpool-II-4.6.0/src/test/regression/tests/032.dml_adaptive_load_balance/test.sh0000775000175000017500000001046314760001620024251 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 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 "disable_load_balance_on_write = 'dml_adaptive'" >> etc/pgpool.conf echo "write_function_list = 'currval,lastval,nextval,setval,f1'" >> etc/pgpool.conf echo "dml_adaptive_object_relationship_list= 't1:t2,f1():tF'" >> 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 i, QUERY ID T1-1 FROM t2" was not load balanced. ./shutdownall exit 1 fi echo ok: first read was load balanced. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T1-2' FROM t1;" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, QUERY ID T1-2 FROM t1;" was wrongly load balanced. ./shutdownall exit 1 fi echo ok: adaptive load balance test 1 works. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T1-3' FROM t3;" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T1-3' FROM t3" was not load balanced. ./shutdownall exit 1 fi echo ok: unrelated read was load balanced. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T1-4' FROM t2;" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T1-4' FROM t2;" was wrongly load balanced. ./shutdownall exit 1 fi echo ok: adaptive load balance test 2 works. $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T2-5' FROM tF;" was not load balanced. ./shutdownall exit 1 fi echo ok: T2 first read was load balanced. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T2-7' FROM tF;" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T2-7' FROM tF;" was wrongly load balanced. ./shutdownall exit 1 fi echo ok: adaptive load balance test 3 works. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T2-8' FROM t1;" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T2-8' FROM t1;" was not load balanced. ./shutdownall exit 1 fi echo ok: T2 third read was load balanced. # check if simple load balance worked fgrep "SELECT i, 'QUERY ID T2-9' FROM t3;" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: "SELECT i, 'QUERY ID T2-9' FROM t3;" was not load balanced. ./shutdownall exit 1 fi echo ok: T2 final read was load balanced. ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/050.bug58/0000775000175000017500000000000014760001620016644 500000000000000pgpool-II-4.6.0/src/test/regression/tests/050.bug58/.gitignore0000664000175000017500000000001114760001620020544 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/050.bug58/test.sh0000775000175000017500000000226214760001620020104 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.6.0/src/test/regression/tests/051.bug60/0000775000175000017500000000000014760001620016636 500000000000000pgpool-II-4.6.0/src/test/regression/tests/051.bug60/.gitignore0000664000175000017500000000001114760001620020536 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/051.bug60/bug.sql0000664000175000017500000000073414760001620020060 00000000000000-- This script shows the problem. When run in a psql connected to -- pgpool with one primary and one read-only replica, this will cause -- the pgpool process to exit because the exception found in the -- commit (in the primary 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.6.0/src/test/regression/tests/051.bug60/database-clean.sql0000664000175000017500000000027714760001620022131 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.6.0/src/test/regression/tests/051.bug60/database-setup.sql0000664000175000017500000000156514760001620022210 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.6.0/src/test/regression/tests/051.bug60/test.sh0000775000175000017500000000343414760001620020100 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.6.0/src/test/regression/tests/052.do_query/0000775000175000017500000000000014760001620017543 500000000000000pgpool-II-4.6.0/src/test/regression/tests/052.do_query/.gitignore0000664000175000017500000000001114760001620021443 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/052.do_query/test.sh0000775000175000017500000000152514760001620021004 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.6.0/src/test/regression/tests/053.insert_lock_hangs/0000775000175000017500000000000014760001620021411 500000000000000pgpool-II-4.6.0/src/test/regression/tests/053.insert_lock_hangs/.gitignore0000664000175000017500000000001114760001620023311 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/053.insert_lock_hangs/test.sh0000775000175000017500000000372014760001620022651 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.6.0/src/test/regression/tests/054.postgres_fdw/0000775000175000017500000000000014760007565020442 500000000000000pgpool-II-4.6.0/src/test/regression/tests/054.postgres_fdw/.gitignore0000664000175000017500000000001114760001620022324 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/054.postgres_fdw/test.sh0000775000175000017500000000344714760007565021710 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Check to see if postgres_fdw works with pgpool-II. Since # postgres_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.6.0/src/test/regression/tests/055.backend_all_down/0000775000175000017500000000000014760007565021203 500000000000000pgpool-II-4.6.0/src/test/regression/tests/055.backend_all_down/.gitignore0000664000175000017500000000001114760001620023065 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/055.backend_all_down/test.sh0000775000175000017500000000234714760007565022447 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 localhost(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.6.0/src/test/regression/tests/056.bug63/0000775000175000017500000000000014760001620016646 500000000000000pgpool-II-4.6.0/src/test/regression/tests/056.bug63/.gitignore0000664000175000017500000000001114760001620020546 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/056.bug63/jdbctest2.java0000664000175000017500000000271714760001620021324 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.6.0/src/test/regression/tests/056.bug63/test.sh0000775000175000017500000000177614760001620020117 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.6.0/src/test/regression/tests/057.bug61/0000775000175000017500000000000014760001620016645 500000000000000pgpool-II-4.6.0/src/test/regression/tests/057.bug61/.gitignore0000664000175000017500000000001114760001620020545 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/057.bug61/test.sh0000775000175000017500000000216614760001620020110 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.6.0/src/test/regression/tests/058.bug68/0000775000175000017500000000000014760001620016655 500000000000000pgpool-II-4.6.0/src/test/regression/tests/058.bug68/.gitignore0000664000175000017500000000001114760001620020555 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/058.bug68/jdbctest3.java0000664000175000017500000000275014760001620021331 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.6.0/src/test/regression/tests/058.bug68/test.sh0000775000175000017500000000177614760001620020126 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.6.0/src/test/regression/tests/059.bug92/0000775000175000017500000000000014760001620016653 500000000000000pgpool-II-4.6.0/src/test/regression/tests/059.bug92/.gitignore0000664000175000017500000000001114760001620020553 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/059.bug92/jdbctest.java0000664000175000017500000000134114760001620021237 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.6.0/src/test/regression/tests/059.bug92/test.sh0000775000175000017500000000226014760001620020111 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.6.0/src/test/regression/tests/061.cancel_query/0000775000175000017500000000000014760007565020404 500000000000000pgpool-II-4.6.0/src/test/regression/tests/061.cancel_query/.gitignore0000664000175000017500000000001114760001620022266 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/061.cancel_query/test.sh0000775000175000017500000000151514760007565021644 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 running 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.6.0/src/test/regression/tests/062.select_error_hangs/0000775000175000017500000000000014760001620021565 500000000000000pgpool-II-4.6.0/src/test/regression/tests/062.select_error_hangs/.gitignore0000664000175000017500000000001114760001620023465 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/062.select_error_hangs/test.sh0000775000175000017500000000221114760001620023017 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.6.0/src/test/regression/tests/063.tables_with_space/0000775000175000017500000000000014760001620021376 500000000000000pgpool-II-4.6.0/src/test/regression/tests/063.tables_with_space/.gitignore0000664000175000017500000000001114760001620023276 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/063.tables_with_space/test.sh0000775000175000017500000000210614760001620022633 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.6.0/src/test/regression/tests/065.bug152/0000775000175000017500000000000014760001620016725 500000000000000pgpool-II-4.6.0/src/test/regression/tests/065.bug152/.gitignore0000664000175000017500000000001114760001620020625 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/065.bug152/Main.java0000664000175000017500000000255414760001620020402 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.6.0/src/test/regression/tests/065.bug152/run.sh0000664000175000017500000000007214760001620020004 00000000000000export CLASSPATH=.:$JDBC_DRIVER javac Main.java java Main pgpool-II-4.6.0/src/test/regression/tests/065.bug152/test.sh0000775000175000017500000000143514760001620020166 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.6.0/src/test/regression/tests/066.bug230/0000775000175000017500000000000014760007565016741 500000000000000pgpool-II-4.6.0/src/test/regression/tests/066.bug230/.gitignore0000664000175000017500000000001114760001620020623 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/066.bug230/Sample.java0000664000175000017500000000175414760001620020736 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.6.0/src/test/regression/tests/066.bug230/test.sh0000775000175000017500000000170114760007565020176 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 replication 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.6.0/src/test/regression/tests/067.bug231/0000775000175000017500000000000014760001620016725 500000000000000pgpool-II-4.6.0/src/test/regression/tests/067.bug231/.gitignore0000664000175000017500000000001114760001620020625 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/067.bug231/TestReplGap.java0000664000175000017500000000133414760001620021703 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.6.0/src/test/regression/tests/067.bug231/test.sh0000775000175000017500000000166614760001620020174 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for for bug 231 (packet kind of backend 1 ['3'] does not # match with main/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.6.0/src/test/regression/tests/068.memqcache_bug/0000775000175000017500000000000014760001620020503 500000000000000pgpool-II-4.6.0/src/test/regression/tests/068.memqcache_bug/.gitignore0000664000175000017500000000001114760001620022403 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/068.memqcache_bug/Sample.java0000664000175000017500000000262514760001620022514 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.6.0/src/test/regression/tests/068.memqcache_bug/test.sh0000775000175000017500000000172214760001620021743 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 wait_for_pgpool_startup # 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 in background. echo "Starting pgbench in background" date $PGBENCH -M extended -S -T 30 test & # sleep 29 seconds so that we can get the process size before # pgpool process $pid accidentaly exits. sleep 29 date 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" wait echo "pgbench done." date 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.6.0/src/test/regression/tests/070.memory_leak_extended_memqcache/0000775000175000017500000000000014760001620024103 500000000000000pgpool-II-4.6.0/src/test/regression/tests/070.memory_leak_extended_memqcache/.gitignore0000664000175000017500000000001114760001620026003 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/070.memory_leak_extended_memqcache/test.sh0000775000175000017500000000303214760001620025337 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 wait_for_pgpool_startup # 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.6.0/src/test/regression/tests/071.execute_and_deallocate/0000775000175000017500000000000014760001620022356 500000000000000pgpool-II-4.6.0/src/test/regression/tests/071.execute_and_deallocate/.gitignore0000664000175000017500000000001114760001620024256 00000000000000testdir/ pgpool-II-4.6.0/src/test/regression/tests/071.execute_and_deallocate/test.sh0000775000175000017500000000754614760001620023630 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing loadbalance failure using DEALLOCATE and EXECUTE command # case with streaming replication mode. source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r i n do echo "=== starting test in \"$mode\" mode ===" if [ $mode = "n" ];then num_tests=6 else num_tests=7 fi success_count=0 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 standby 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 </dev/null if [ $? -eq 0 ]; then success_count=$(( success_count + 1 )) echo "ok." else echo "failed." fi if [ $mode = "n" ];then echo "this test is not applied to mode \"$mode\" and skipped." else grep -E "DB node id: 1 .*DEALLOCATE all" log/pgpool.log >/dev/null if [ $? -eq 0 ]; then success_count=$(( success_count + 1 )) echo "ok." else echo "failed." fi fi # DEALLOCATE in multi-statement echo -n "case 6: DEALLOCATE in multi-statement..." result=`fgrep "DEALLOCATE test3" log/pgpool.log | awk '{print substr($0, index($0, "DB node id:"),13)}'` if [ "$expect3" = "$result" ]; then success_count=$(( success_count + 1 )) echo "ok." else echo "failed." fi ./shutdownall if [ $success_count -ne $num_tests ]; then echo "Some tests failed. Exiting..." exit 1 fi cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/072.meqcache_bug2/0000775000175000017500000000000014760001620020403 500000000000000pgpool-II-4.6.0/src/test/regression/tests/072.meqcache_bug2/extended_query_test.data0000664000175000017500000000035214760001620025242 00000000000000'P' "" "SELECT 1" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'P' "" "BEGIN" 0 'B' "" "" 0 0 0 'E' "" 0 'P' "" "SELECT 1" 0 'B' "" "" 0 0 0 'S' 'Y' # Hang here if the bug bites! 'E' "" 0 'P' "" "END" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/072.meqcache_bug2/test.sh0000775000175000017500000000132014760001620021635 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for a memqcache bug. # # If an execute message is issued right after Sync message and query # cache hits, Pgpool-II hangs. source $TESTLIBS WHOAMI=`whoami` TESTDIR=testdir PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto 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 "memory_cache_enabled = on" >> 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.6.0/src/test/regression/tests/073.pg_terminate_backend/0000775000175000017500000000000014760001620022044 500000000000000pgpool-II-4.6.0/src/test/regression/tests/073.pg_terminate_backend/test.sh0000775000175000017500000000275314760001620023311 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 wait_for_pgpool_startup $PSQL test -p $PGPORT -c "SELECT pg_sleep(10);" & sleep 2 # get process id which query is executed PID=`ps -efw |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.6.0/src/test/regression/tests/074.bug700_memqcache_segfault/0000775000175000017500000000000014760007565022637 500000000000000pgpool-II-4.6.0/src/test/regression/tests/074.bug700_memqcache_segfault/expected.txt0000664000175000017500000000104314760001620025101 00000000000000FE=> Query (query="SET statement_timeout TO 1000") <= BE CommandComplete(SET) <= BE ReadyForQuery(I) FE=> Parse(stmt="S1", query="SELECT 1") FE=> Bind(stmt="S1", portal="P1") FE=> Execute(portal="P1") FE=> Close(portal="P1") FE=> Bind(stmt="S1", portal="P2") FE=> Execute(portal="P2") FE=> Close(portal="P2") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE CloseComplete <= BE BindComplete <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE CloseComplete <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/074.bug700_memqcache_segfault/pgproto.data0000664000175000017500000000024214760001620025064 00000000000000'Q' "SET statement_timeout TO 1000" 'Y' 'P' "S1" "SELECT 1" 0 'B' "P1" "S1" 0 0 0 'E' "P1" 0 'C' 'P' "P1" 'B' "P2" "S1" 0 0 0 'E' "P2" 0 'C' 'P' "P2" 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/074.bug700_memqcache_segfault/test.sh0000775000175000017500000000172014760007565024075 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for a memqcache bug 700. # # Pgpool-II crashes upon receiving CloseComplete. # This only happens in other than streaming and logical replication mode. source $TESTLIBS WHOAMI=`whoami` TESTDIR=testdir PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto for mode in s i r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment in mode = $mode..." $PGPOOL_SETUP -m $mode -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "log_min_messages = debug1" >> etc/pgpool.conf ./startall wait_for_pgpool_startup $PGPROTO -d test -f ../pgproto.data > result.txt 2>&1 cmp ../expected.txt result.txt if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/075.detach_primary_left_down_node/0000775000175000017500000000000014760001620023762 500000000000000pgpool-II-4.6.0/src/test/regression/tests/075.detach_primary_left_down_node/test.sh0000775000175000017500000000176214760001620025226 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for a case: detach primary node left down node. # # reported: https://www.pgpool.net/pipermail/pgpool-hackers/2021-June/003916.html source $TESTLIBS WHOAMI=`whoami` TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 4 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup # detach node 0 $PGPOOL_INSTALL_DIR/bin/pcp_detach_node -w -h localhost -p $PCP_PORT 0 wait_for_pgpool_startup # check to see if alll nodes are up echo -n "starting to check follow primary results: " date cnt=60 while [ $cnt -gt 0 ] do $PGBIN/psql -c "show pool_nodes" test 2>&1|grep -E 'down|error' if [ $? != 0 ];then echo "test succeeded" ./shutdownall exit 0 fi cnt=`expr $cnt - 1` echo "cnt: $cnt" sleep 1 done echo "test failed". ./shutdownall exit 1 pgpool-II-4.6.0/src/test/regression/tests/076.copy_hang/0000775000175000017500000000000014760001620017671 500000000000000pgpool-II-4.6.0/src/test/regression/tests/076.copy_hang/pgproto.data0000664000175000017500000000013514760001620022135 00000000000000'Q' "CREATE TEMP TABLE t1(i INT)" 'Y' 'Q' "COPY t1 FROM STDIN" 0 'd' "1" 'H' 'c' 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/076.copy_hang/test.sh0000775000175000017500000000277414760001620021141 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for copy plus error case. # It was reported that following sequece of copy command cause psql hang. # # CREATE TEMP TABLE vistest (a text); # COPY vistest FROM stdin CSV FREEZE; # Enter data to be copied followed by a newline. # End with a backslash and a period on a line by itself, or an EOF signal. # >> p # >> g # >> \. # # In the normal case an error should be returned to psql. #ERROR: cannot perform COPY FREEZE because the table was not created or truncated in the current subtransaction source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 3 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup # execute COPY timeout 10 $PSQL test < Query (query="PREPARE mark_rels_by_node(int8) AS SELECT $1;PREPARE mark_rels_by_way(int8) AS SELECT $1") <= BE CommandComplete(PREPARE) <= BE CommandComplete(PREPARE) <= BE ReadyForQuery(I) FE=> Bind(stmt="mark_rels_by_node", portal="") FE=> Describe(portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Bind(stmt="mark_rels_by_way", portal="") FE=> Describe(portal="") FE=> Execute(portal="") FE=> Sync <= BE BindComplete <= BE RowDescription <= BE DataRow <= BE CommandComplete(SELECT 1) <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/079.multi_prepare/pgproto.data0000664000175000017500000000070614760001620023045 00000000000000'Q' "PREPARE mark_rels_by_node(int8) AS SELECT $1;PREPARE mark_rels_by_way(int8) AS SELECT $1" 'Y' # portal statement_name num_format_code (0 is text) num_params param_length "param" # num_return_value_format_code return_value_format_code 'B' "" "mark_rels_by_node" 0 1 1 "2" 1 0 'D' 'P' "" 'E' "" 0 'S' 'Y' # error was: unable to bind D cannot get parse message "mark_rels_by_way" 'B' "" "mark_rels_by_way" 0 1 1 "1" 1 0 'D' 'P' "" 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/079.multi_prepare/test.sh0000775000175000017500000000157714760001620022045 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for multi statement query including PREPARE *and* bind is used later on. # Discussion: [pgpool-general: 8870] Prepared statements over pgpool ? # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto export PGDATABASE=test #for mode in s for mode in s i r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo -n "creating test environment..." $PGPOOL_SETUP -m $mode || exit 1 echo "done." source ./bashrc.ports ./startall wait_for_pgpool_startup $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto.data > results.txt 2>&1 cmp ../expected.txt results.txt if [ $? != 0 ];then echo "test failed in mode: $mode". ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/080.declare/0000775000175000017500000000000014760001620017314 500000000000000pgpool-II-4.6.0/src/test/regression/tests/080.declare/expected.txt0000664000175000017500000000167114760001620021603 00000000000000FE=> Query (query="BEGIN") <= BE CommandComplete(BEGIN) <= BE ReadyForQuery(T) FE=> Query (query="DECLARE "serverside-cursor-broken" CURSOR FOR SELECT 3") <= BE CommandComplete(DECLARE CURSOR) <= BE ReadyForQuery(T) FE=> Describe(portal="serverside-cursor-broken") FE=> Sync <= BE RowDescription <= BE ReadyForQuery(T) FE=> Query (query="END") <= BE CommandComplete(COMMIT) <= BE ReadyForQuery(I) FE=> Sync <= BE ReadyForQuery(I) FE=> Query (query="BEGIN") <= BE CommandComplete(BEGIN) <= BE ReadyForQuery(T) FE=> Parse(stmt="", query="DECLARE "serverside-cursor-broken" CURSOR FOR SELECT 3") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Describe(portal="serverside-cursor-broken") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE CommandComplete(DECLARE CURSOR) <= BE RowDescription <= BE ReadyForQuery(T) FE=> Query (query="END") <= BE CommandComplete(COMMIT) <= BE ReadyForQuery(I) FE=> Sync <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/080.declare/pgproto.data0000664000175000017500000000100014760001620021550 00000000000000# test for simple query DECLARE 'Q' "BEGIN" 'Y' 'Q' "DECLARE "serverside-cursor-broken" CURSOR FOR SELECT 3" 'Y' # Describe message should return RowDescription without error 'D' 'P' "serverside-cursor-broken" 'S' 'Y' 'Q' "END" 'Y' 'S' 'Y' # test for extended query DECLARE 'Q' "BEGIN" 'Y' 'P' "" "DECLARE "serverside-cursor-broken" CURSOR FOR SELECT 3" 0 'B' "" "" 0 0 0 'E' "" 0 # Describe message should return RowDescription without error 'D' 'P' "serverside-cursor-broken" 'S' 'Y' 'Q' "END" 'Y' 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/080.declare/test.sh0000775000175000017500000000162514760001620020556 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for the case that Describe portal created by DECLARE # CUSOR causes FATAL error. # Discussion: [pgpool-general: 8934] DECLARE "serverside-cursor-broken" NO SCROLL CURSOR FOR SELECT # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto export PGDATABASE=test for mode in s i r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo -n "creating test environment..." $PGPOOL_SETUP -m $mode || exit 1 echo "done." source ./bashrc.ports ./startall wait_for_pgpool_startup $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto.data > results.txt 2>&1 cmp ../expected.txt results.txt if [ $? != 0 ];then echo "test failed in mode: $mode". ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/082.guard_against_bad_protocol/0000775000175000017500000000000014760001620023256 500000000000000pgpool-II-4.6.0/src/test/regression/tests/082.guard_against_bad_protocol/pgproto.data0000664000175000017500000000014614760001620025524 00000000000000'P' "" "BEGIN" 0 'B' "" "" 0 0 0 'E' "" 0 'Q' "SAVEPOINT PGJDBC_AUTOSAVE" 'Y' 'P' "" "SELECT 1" 0 'X' pgpool-II-4.6.0/src/test/regression/tests/082.guard_against_bad_protocol/pgproto2.data0000664000175000017500000000006114760001620025602 00000000000000'P' "" "SELECT 1" 0 'B' "" "" 0 0 0 'E' "" 0 'X' pgpool-II-4.6.0/src/test/regression/tests/082.guard_against_bad_protocol/test.sh0000775000175000017500000000317114760001620024516 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for pgpool hang due to protocol violation. # If frontend sends simple query before extended protocol ended, pgpool hangs. # # Discussion: # [pgpool-general: 8990] autosave=always jdbc option & it only sends query SAVEPOINT PGJDBC_AUTOSAVE and hangs # [pgpool-hackers: 4427] Guard against ill mannered frontend # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto export PGDATABASE=test rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo -n "creating test environment..." $PGPOOL_SETUP || exit 1 echo "done." echo "backend_weight1=0" >> etc/pgpool.conf source ./bashrc.ports ./startall wait_for_pgpool_startup # test1: # Wait for 1 seconds before pgproto ended. # Usually 1 seconds should be enough to finish pgproto. # If test suceeded, pgpool emits an error message: # "FATAL: simple query "SAVEPOINT PGJDBC_AUTOSAVE" arrived before ending an extended query message" # grep command below should catch the message. timeout 1 $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto.data |& grep 'simple query "SAVEPOINT PGJDBC_AUTOSAVE" arrived ' if [ $? != 0 ];then # timeout happened or pgproto returned non 0 status echo "test1 failed." ./shutdownall exit 1 fi # test2: # Check if reset queries can be executed even if extended query messages # do not end. timeout 1 $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto2.data if [ $? != 0 ];then # timeout happened or pgproto returned non 0 status echo "test2 failed." ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/033.prefer_lower_standby_delay/0000775000175000017500000000000014760007565023326 500000000000000pgpool-II-4.6.0/src/test/regression/tests/033.prefer_lower_standby_delay/test.sh0000775000175000017500000001672314760007565024575 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for prefer_lower_delay_standby and standby delay. # source $TESTLIBS TESTDIR=testdir PG_CTL=$PGBIN/pg_ctl PSQL="$PGBIN/psql -X " version=`$PSQL --version|awk '{print $3}'` major_version=`echo ${version%.*} | sed 's/\([0-9]*\).*/\1/'` if [ $major_version -ge 10 ];then REPLAY_PAUSE="SELECT pg_wal_replay_pause();" REPLAY_RESUME="SELECT pg_wal_replay_resume();" else REPLAY_PAUSE="SELECT pg_xlog_replay_pause();" REPLAY_RESUME="SELECT pg_xlog_replay_resume();" fi # PostgreSQL 13 or before does not have pg_get_wal_replay_pause_state(). # In these versions SELECT pg_wal_replay_pause() immediately pauses. if [ $major_version -ge 14 ];then REPLAY_STATE="SELECT pg_get_wal_replay_pause_state()" else REPLAY_STATE="SELECT 'paused'" fi # node 1,2 port number PORT1=11003 PORT2=11004 # request replication pause and wait for confirmation. # argument is a list of port numbers # (currently only PORT1 is used) function replay_pause { for i in $1 do echo ===$i=== $PSQL -p $i test -c "$REPLAY_PAUSE" done for p in $1 do for i in 1 2 3 4 do res=`$PSQL -p $p -q -t test -c "$REPLAY_STATE"|sed 's/ //'g` if [ "$res" = "paused" ];then break; else echo pause state: $res fi sleep 1 done if [ "$res" != "paused" ];then echo replay pause failed. ./shutdownall exit 1 fi done } 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 export PGPORT=$PGPOOL_PORT # The default wal_receiver_status_interval is 10 seconds, which is too # slow to know the standby delay. echo "wal_receiver_status_interval = 1s" >> data1/postgresql.conf echo "wal_receiver_status_interval = 1s" >> data2/postgresql.conf # Sleep time in seconds after pausing wal replay in case of # delay_threshold_by_time. By setting wal_receiver_status_interval to # 1 second, we could set this as short as 3 seconds. STIME=3 # ---------------------------------------------------------------------------------------- echo === Test1: delay_threshold with prefer_lower_delay_standby disabled. === # ---------------------------------------------------------------------------------------- echo "delay_threshold = 10" >> etc/pgpool.conf echo "sr_check_period = 1" >> etc/pgpool.conf echo "log_standby_delay = 'always'" >> etc/pgpool.conf echo "log_min_messages = 'DEBUG1'" >> etc/pgpool.conf echo "log_error_verbosity = verbose" >> etc/pgpool.conf # force load balance node to be 1. echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight2 = 0" >> etc/pgpool.conf ./startall wait_for_pgpool_startup # Pause replay on node 1. Since prefer_lower_delay_standby is # disabled, SELECT query should be sent to primary node. replay_pause $PORT1 $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: query was not sent to primary node. ./shutdownall exit 1 fi echo ok: testing delay_threshold with prefer_lower_delay_standby disabled succeeded. echo resume streaming replication node 1 $PSQL -p $PORT1 test -c "$REPLAY_RESUME" sleep 2 ./shutdownall # ---------------------------------------------------------------------------------------- echo === Test2: delay_threshold_by_time with prefer_lower_delay_standby disabled. === # ---------------------------------------------------------------------------------------- echo Start testing delay_threshold_by_time with prefer_lower_delay_standby disabled echo "delay_threshold = 0" >> etc/pgpool.conf echo "delay_threshold_by_time = 1000" >> etc/pgpool.conf ./startall wait_for_pgpool_startup # pause replay on node 1 replay_pause $PORT1 $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: query was not sent to primary node. ./shutdownall exit 1 fi echo ok: testing delay_threshold_by_time with prefer_lower_delay_standby disabled succeeded. ./shutdownall # unforce load balance node to be 1. echo "backend_weight0 = 1" >> etc/pgpool.conf echo "backend_weight2 = 1" >> etc/pgpool.conf # ---------------------------------------------------------------------------------------- echo === Test3: check to see if pgpool selects proper node for load balance === echo at the connection time with prefer_lower_delay_standby enabled. # ---------------------------------------------------------------------------------------- # Redirect connection from app "psql" to node 1. This will make writing test easier. echo "app_name_redirect_preference_list = 'psql:1'" >> etc/pgpool.conf echo "prefer_lower_delay_standby = on" >> etc/pgpool.conf ./startall wait_for_pgpool_startup echo start: prefer_lower_delay_standby is on. $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: query was not sent to node 2. ./shutdownall exit 1 fi echo ok: query is sent to another standby node. echo resume streaming replication node 1 $PSQL -p $PORT1 test -c "$REPLAY_RESUME" sleep 2 # ---------------------------------------------------------------------------------------- echo === Test4: check to see if pgpool selects proper node for load balance === echo while in a session. For the test we use SELECT using write echo function. It should be sent to primary node. # see bug #798. # https://www.pgpool.net/mantisbt/view.php?id=798 # ---------------------------------------------------------------------------------------- $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: write query is not sent to primary node. ./shutdownall exit 1 fi echo Test5: prefer_lower_delay_standby is off. $PSQL -p $PORT1 test -c "$REPLAY_RESUME" echo "prefer_lower_delay_standby = off" >> etc/pgpool.conf $PGPOOL_INSTALL_DIR/bin/pcp_reload_config -w -h localhost -p $PCP_PORT while : do $PSQL test -c "PGPOOL SHOW prefer_lower_delay_standby" |grep off if [ $? = 0 ]; then break fi sleep 1 done # pause replay on node 1 replay_pause $PORT1 $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: query was sent to standby node. ./shutdownall exit 1 fi echo ok: prefer lower delay standby works. ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/034.promote_node/0000775000175000017500000000000014760007565020424 500000000000000pgpool-II-4.6.0/src/test/regression/tests/034.promote_node/test.sh0000775000175000017500000000227414760007565021667 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for pcp_promote_mode. # source $TESTLIBS WHOAMI=`whoami` TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 4 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup for i in 1 2 3 4 5 6 7 8 9 10 do $PGPOOL_INSTALL_DIR/bin/pcp_node_info -h localhost -w -p $PCP_PORT if [ $? = 0 ];then break; fi sleep 1 done # promote node 3 $PGPOOL_INSTALL_DIR/bin/pcp_promote_node -h localhost -w -p $PCP_PORT -s 3 wait_for_pgpool_startup # check to see if alll nodes are up echo -n "starting to check follow primary results: " date cnt=60 while [ $cnt -gt 0 ] do # check to see if primary is now node 3 $PGBIN/psql -c "show pool_nodes" test|grep down if [ $? != 0 ];then node=`$PGBIN/psql -c "show pool_nodes" test|grep primary|awk '{print $1}'` if [ "$node" = 3 ];then echo "test succeeded" ./shutdownall exit 0 fi fi cnt=`expr $cnt - 1` echo "cnt: $cnt" sleep 1 done echo "test failed". ./shutdownall exit 1 pgpool-II-4.6.0/src/test/regression/tests/035.unix_sockets/0000775000175000017500000000000014760007565020451 500000000000000pgpool-II-4.6.0/src/test/regression/tests/035.unix_sockets/test.sh0000775000175000017500000001000714760007565021705 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for unix_socket_directories, unix_socket_group, unix_socket_permissions # and pcp_socket_dir. # unix_socket_group test works if UNIX_SOCK_GROUP exists and the user running # this test belongs to it. Therefore, we usually comment out it. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PGPOOLBIN=$PGPOOL_INSTALL_DIR/bin PCP_PORT=11001 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 dir=`pwd` UNIX_SOCK_PATH1=/tmp PCP_SOCK_PATH1=/tmp if [ -d $HOME/tmp ];then UNIX_SOCK_PATH2=$HOME/tmp PCP_SOCK_PATH2=$HOME/tmp else UNIX_SOCK_PATH2=$HOME PCP_SOCK_PATH2=$HOME fi UNIX_SOCK_FILE=.s.PGSQL.$PGPOOL_PORT PCP_SOCK_FILE=.s.PGSQL.$PCP_PORT UNIX_SOCK_GROUP=wheel USER=`whoami` echo "unix_socket_directories = '$UNIX_SOCK_PATH1,$UNIX_SOCK_PATH2'" >> etc/pgpool.conf echo "pcp_socket_dir = '$PCP_SOCK_PATH1,$PCP_SOCK_PATH2'" >> etc/pgpool.conf <> etc/pgpool.conf COMMENT_OUT echo "unix_socket_permissions = 0770" >> etc/pgpool.conf sed -i 's/localhost/*/g' ./pcppass ./startall export PGPORT=$PGPOOL_PORT export PCPPASSFILE=./pcppass wait_for_pgpool_startup echo check: multiple unix domain sokets if [ ! -e $UNIX_SOCK_PATH1/$UNIX_SOCK_FILE ]; then echo "fail: not exist $UNIX_SOCK_PATH1/$UNIX_SOCK_FILE" ./shutdownall exit 1 fi if [ ! -e $UNIX_SOCK_PATH2/$UNIX_SOCK_FILE ]; then echo "fail: not exist $UNIX_SOCK_PATH2/$UNIX_SOCK_FILE" ./shutdownall exit 1 fi echo ok: multiple unix domain sockets echo check: connect to unix domain sockets res=`$PSQL -t -h $UNIX_SOCK_PATH1 test -c "SELECT 1"` if [ $res -ne 1 ]; then echo "fail: cannot connect to $UNIX_SOCK_PATH2/$UNIX_SOCK_FILE" ./shutdownall exit 1 fi res=`$PSQL -t -h $UNIX_SOCK_PATH1 test -c "SELECT 1"` if [ $res -ne 1 ]; then echo "fail: cannot connect to $UNIX_SOCK_PATH2/$UNIX_SOCK_FILE" ./shutdownall exit 1 fi echo ok: connect to unix domain sockets <> pgpool$n/etc/pgpool.conf echo "trusted_server_command = 'ping -q -c3 %h'" >> 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 } #------------------------------------------------------------------- dir=`pwd` failed=false export PCPPASSFILE=$dir/$TESTDIR/pgpool0/pcppass cd $dir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR $WATCHDOG_SETUP -wn 2 || exit 1 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." sleep 10 grep "watchdog failed to ping host:" $log >/dev/null if [ $? -eq 0 ];then failed=true fi ./shutdownall if [ $failed = "true" ];then exit 1 fi exit 0 pgpool-II-4.6.0/src/test/regression/tests/037.failover_session/0000775000175000017500000000000014760007565021307 500000000000000pgpool-II-4.6.0/src/test/regression/tests/037.failover_session/test.sh0000775000175000017500000000653014760007565022551 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for session disconnection with failover. # This test is for streaming replication mode only. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGBENCH=$PGBENCH_PATH export PGDATABASE=test rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create streaming replication, 3-node test environment. echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 3 -s || exit 1 echo "done." source ./bashrc.ports # PCP_PORT is defined in bashrc.ports PCP_DETACH_NODE="$PGPOOL_INSTALL_DIR/bin/pcp_detach_node -w -h localhost -p $PCP_PORT 2" # customize pgpool.conf. disable load balance to node 2. # Also modify health check parameters so that health check detects # backend down earlier. cat >> etc/pgpool.conf <> etc/pgpool.conf echo "load_balance_mode = off" >> etc/pgpool.conf ./startall wait_for_pgpool_startup ($PGBENCH -n -S -c 10 -T 5)& sleep 1 #$PG_CTL -D data2 stop $PCP_DETACH_NODE wait $! if [ $? != 0 ];then echo "pgbench exited with error. test3 failed." r3=fail else echo "pgbench suceeded. test3 ok." r3=ok fi ./shutdownall echo "=== test4: load_balance_mode = off and pgbench with -C option" # Same test as test3. The only the difference is load_balance_mode is # off instead of backend_weitht2 = 0. To make sure that both have same # effect against failover. ./startall wait_for_pgpool_startup ($PGBENCH -n -S -C -c 10 -T 5)& sleep 1 echo $PCP_DETACH_NODE $PCP_DETACH_NODE sleep 3 $PG_CTL -D data2 stop wait $! if [ $? != 0 ];then echo "pgbench exited with error. test4 failed." r4=fail else echo "pgbench suceeded. test4 ok." r4=ok fi ./shutdownall if [ $r1 = ok -a $r2 = ok -a $r3 = ok -a $r4 = ok ]; then echo "all test succeeded" exit 0 else echo "some tests failed" echo "test1: $r1 test2: $r2 test3: $r3 test4: $r4" exit 1 fi pgpool-II-4.6.0/src/test/regression/tests/038.pcp_commands/0000775000175000017500000000000014760007565020401 500000000000000pgpool-II-4.6.0/src/test/regression/tests/038.pcp_commands/test.sh0000775000175000017500000000245314760007565021643 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for pcp commands. # 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 export PGPORT=$PGPOOL_PORT echo "=== test1: pcp_log_rotate" BASEDIR=`pwd` echo "logging_collector = on" >> etc/pgpool.conf echo "log_directory = '$BASEDIR/log'" >> etc/pgpool.conf echo "log_filename = 'pgpool.log'" >> etc/pgpool.conf ./startall wait_for_pgpool_startup mv log/pgpool.log log/pgpool.log.1 sleep 1 $PSQL -h localhost -c "SELECT 1" test > /dev/null 2>&1 grep "SELECT 1" log/pgpool.log.1 > /dev/null 2>&1 if [ $? != 0 ];then r1=fail echo "test1 failed before running pcp_log_rotate." else $PGPOOL_INSTALL_DIR/bin/pcp_log_rotate -h localhost -w -p $PCP_PORT $PSQL -h localhost -c "SELECT 1" test > /dev/null 2>&1 sleep 1 grep "SELECT 1" log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then r1=ok echo "test1 ok" else echo "test1 failed." fi fi ./shutdownall if [ $r1 = ok ]; then echo "all test succeeded" exit 0 else echo "some tests failed" echo "test1: $r1" exit 1 fi pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/0000775000175000017500000000000014760007565022056 500000000000000pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/expected.i0000664000175000017500000000526714760007565023763 00000000000000 ==== mode: i option: none === i --- 1 2 3 (3 rows) FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 3) <= BE ReadyForQuery(I) FE=> Terminate ==== mode: i option: terse === LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 LOG: RowDescription message from backend 1 LOG: DataRow message from backend 1 LOG: last DataRow message from backend 1 repeated 2 times LOG: CommandComplete message from backend 1 LOG: ReadyForQuery message from backend 1 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 1 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 1 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE DataRow <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M last DataRow message from backend 1 repeated 2 times <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 1 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 1 <= BE ReadyForQuery(I) FE=> Terminate ==== mode: i option: verbose === LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 LOG: RowDescription message from backend 1 LOG: DataRow message from backend 1 LOG: DataRow message from backend 1 LOG: DataRow message from backend 1 LOG: CommandComplete message from backend 1 LOG: ReadyForQuery message from backend 1 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 1 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 1 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 1 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 1 <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/expected.n0000664000175000017500000000526714760007565023770 00000000000000 ==== mode: n option: none === i --- 1 2 3 (3 rows) FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 3) <= BE ReadyForQuery(I) FE=> Terminate ==== mode: n option: terse === LOG: ReadyForQuery message from backend 0 LOG: RowDescription message from backend 0 LOG: DataRow message from backend 0 LOG: last DataRow message from backend 0 repeated 2 times LOG: CommandComplete message from backend 0 LOG: ReadyForQuery message from backend 0 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M last ReadyForQuery message from backend 0 repeated 1 times <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 0 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 0 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 0 <= BE DataRow <= BE DataRow <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M last DataRow message from backend 0 repeated 2 times <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 0 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 0 <= BE ReadyForQuery(I) FE=> Terminate ==== mode: n option: verbose === LOG: ReadyForQuery message from backend 0 LOG: RowDescription message from backend 0 LOG: DataRow message from backend 0 LOG: DataRow message from backend 0 LOG: DataRow message from backend 0 LOG: CommandComplete message from backend 0 LOG: ReadyForQuery message from backend 0 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 0 <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 0 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 0 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 0 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 0 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 0 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 0 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 0 <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/expected.s0000664000175000017500000000540214760007565023764 00000000000000 ==== mode: s option: none === i --- 1 2 3 (3 rows) FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE ParseComplete <= BE BindComplete <= BE DataRow <= BE DataRow <= BE DataRow <= BE CommandComplete(SELECT 3) <= BE ReadyForQuery(I) FE=> Terminate ==== mode: s option: terse === LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 LOG: RowDescription message from backend 1 LOG: DataRow message from backend 1 LOG: last DataRow message from backend 1 repeated 2 times LOG: CommandComplete message from backend 1 LOG: ReadyForQuery message from backend 1 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 1 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 1 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE DataRow <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M last DataRow message from backend 1 repeated 2 times <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 1 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 1 <= BE ReadyForQuery(I) FE=> Terminate ==== mode: s option: verbose === LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 LOG: RowDescription message from backend 1 LOG: DataRow message from backend 1 LOG: DataRow message from backend 1 LOG: DataRow message from backend 1 LOG: CommandComplete message from backend 1 LOG: ReadyForQuery message from backend 1 i --- 1 2 3 (3 rows) LOG: ReadyForQuery message from backend 0 LOG: ReadyForQuery message from backend 1 FE=> Parse(stmt="", query="SELECT * FROM t1") FE=> Bind(stmt="", portal="") FE=> Execute(portal="") FE=> Sync <= BE NoticeResponse(S LOG C XX000 M ParseComplete message from backend 1 <= BE ParseComplete <= BE NoticeResponse(S LOG C XX000 M BindComplete message from backend 1 <= BE BindComplete <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M DataRow message from backend 1 <= BE DataRow <= BE NoticeResponse(S LOG C XX000 M CommandComplete message from backend 1 <= BE CommandComplete(SELECT 3) <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 0 <= BE NoticeResponse(S LOG C XX000 M ReadyForQuery message from backend 1 <= BE ReadyForQuery(I) FE=> Terminate pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/pgproto.data0000664000175000017500000000010114760007565024313 00000000000000'P' "" "SELECT * FROM t1" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' 'X' pgpool-II-4.6.0/src/test/regression/tests/039.log_backend_messages/test.sh0000775000175000017500000000324414760007565023317 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for log_backend_messages # source $TESTLIBS export PGDATABASE=test TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto # Loop test for streaming replication mode, snapshot isolation mode # and raw mode for mode in s i n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo -n "creating test environment..." $PGPOOL_SETUP -m $mode || exit 1 echo "done." echo > result # We set backend_weight0 to 0 to send ready queries to backend 1. # We set client_min_messages to log so that log messages appear on # the client screen. # We set connection_cache to off so that each time client connects # to pgpool, it receives ready for query from backend. cat >> etc/pgpool.conf <> result cat >> etc/pgpool.conf <> result 2>&1 <> result 2>&1 ./shutdownall done diff -c result ../expected.$mode if [ $? != 0 ];then echo "test failed in mode: $mode" exit 1 fi cd .. done exit 0 pgpool-II-4.6.0/src/test/regression/tests/077.invalid_failover_node/0000775000175000017500000000000014760007565022263 500000000000000pgpool-II-4.6.0/src/test/regression/tests/077.invalid_failover_node/test.sh0000775000175000017500000000404314760007565023522 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for "invalid degenerate backend request" issue. # ([pgpool-hackers: 4127] invalid degenerate backend request, node id : 2 status: [2] is not valid for failover) echo "starting test" date source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PCP_PROMOTE_NODE=$PGPOOL_INSTALL_DIR/bin/pcp_promote_node PCP_NODE_INFO=$PGPOOL_INSTALL_DIR/bin/pcp_node_info rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 3 || exit 1 echo "done." # set node 1 down state sed -i '2s/up/down/' log/pgpool_status # remove "-D" option from startall script sed -i 's/pgpool -D/pgpool/' startall source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup echo === make sure that health check process for node 1 does not exist === ps x|grep "health check" $PCP_NODE_INFO -w -p $PCP_PORT -a echo === promote node 2 as a primary node === $PCP_PROMOTE_NODE -w -p $PCP_PORT --switchover 2 wait_for_pgpool_startup date # wait until node 1 up ok=ng u=3 for i in {1..30} do $PCP_NODE_INFO -w -p $PCP_PORT 1|grep waiting if [ $? -eq 0 ];then ok=ok break; fi echo -n "`expr $u \* $i` " date sleep $u done if [ $ok != "ok" ];then echo === pcp_promote_node did not complete === ./shutdownall exit 1 fi echo === make sure that health check process for node 1 does exist === ps x|grep "health check" echo === shutdown node 1 === $PG_CTL -D data1 stop # we cannot use wait_for_pgpool_startup here because we want to detect the node 1 down by health check. #wait_for_pgpool_startup echo sleep 5 sleep 5 date echo === make sure that node 1 is now down === ok=ng u=2 for i in {1..15} do $PCP_NODE_INFO -w -p $PCP_PORT 1|grep "down down" if [ $? -eq 0 ];then ok=ok break; fi echo `expr $u \* $i` sleep 2 done if [ $ok != "ok" ];then echo === failover did not complete === ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/078.aborted_transaction/0000775000175000017500000000000014760007565021767 500000000000000pgpool-II-4.6.0/src/test/regression/tests/078.aborted_transaction/expected.txt0000664000175000017500000000140314760007565024247 00000000000000BEGIN; BEGIN SELECT * FROM non_existing_table; ERROR: relation "non_existing_table" does not exist LINE 1: SELECT * FROM non_existing_table; ^ SELECT 1; ERROR: current transaction is aborted, commands ignored until end of transaction block DETAIL: statement: SELECT 1; END; ROLLBACK BEGIN; BEGIN aaa; ERROR: syntax error at or near "aaa" LINE 1: aaa; ^ SELECT 1; ERROR: current transaction is aborted, commands ignored until end of transaction block DETAIL: statement: SELECT 1; END; ROLLBACK SELECT 1; ?column? ---------- 1 (1 row) BEGIN; BEGIN SAVEPOINT s1; SAVEPOINT aaa; ERROR: syntax error at or near "aaa" LINE 1: aaa; ^ ROLLBACK TO s1; ROLLBACK SELECT 1; ?column? ---------- 1 (1 row) END; COMMIT pgpool-II-4.6.0/src/test/regression/tests/078.aborted_transaction/test.sh0000775000175000017500000000155014760007565023226 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for aborted transaction. source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP || exit 1 echo "done." echo "backend_weight1 = 0" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup $PSQL -e test > results.txt 2>&1 </dev/null then echo "test succeeded" else echo "test failed" diff -c ../expected.txt results.txt ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/tests/081.detach_primary_all_down/0000775000175000017500000000000014760007565022606 500000000000000pgpool-II-4.6.0/src/test/regression/tests/081.detach_primary_all_down/test.sh0000775000175000017500000000713414760007565024051 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for that detach_false_primary could bring down all backends. # See [pgpool-hackers: 4431] for more details. # # It is possible that all DB nodes go down if detach_false_primary is enabled. # Story: # There are 3 watchdog nodes pgpool0, pgpool1 and pgpool2. # There are 2 DB nodes node0 and node1 (initially node 0 is primary). # follow_primary_command is disabled. # 1) Node 0 goes down at pgpool0 due to a network trouble. BUT actually # node 0 is alive. # 2) Node 0 goes down at pgpool1 due to a network trouble. BUT actually # node 0 is alive. # 3) Failover is triggered. Since pgpool0 and pgpool1 agree, node 0 is set to down. # node 1 is promoted. # 4) Before new status is synched with pgpool2, pgpool2's sr_check # finds that there are two primary nodes due to # #3. detach_false_primary is triggered and node 1 goes down. # 5) Now all backends are in down status. # 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 } 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 3 node pgpool with 2 backends. $WATCHDOG_SETUP -wn 3 -n 2 # enable detach_false_primary and health_check_test. We need to # disable follow_primary_command, othewise node 0 goes down by # follow_primary_command and the test may not reveals the problem. # Also we set sr_check_period to very short so that # detach_false_primary is triggered before the new status is synched # by watchdog leader. for i in 0 1 2 do echo "detach_false_primary = on" >> pgpool$i/etc/pgpool.conf echo "health_check_test = on" >> pgpool$i/etc/pgpool.conf echo "follow_primary_command = ''" >> pgpool$i/etc/pgpool.conf echo "sr_check_period = 1" >> pgpool$i/etc/pgpool.conf done cd pgpool0 source ./bashrc.ports cd .. ./startall echo -n "waiting for watchdog node 0 starting up... " log=pgpool0/log/pgpool.log wait_for_watchdog_startup $log echo "done." $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT $PGPOOL_INSTALL_DIR/bin/pcp_node_info -h localhost -p $PCP_PORT # Let node 0 down at pgpool0 echo "0 down" > pgpool0/log/backend_down_request # Let node 0 down at pgpool1 echo "0 down" > pgpool1/log/backend_down_request # Wait up to 30 seconds before the problem (all nodes go down). # Observe that pgpool1 and pgpool2 print: # LOG: pgpool_worker_child: invalid node found 1 # which means sr_check ran detach_false_primary but did not trigger failover: # LOG: do not detach invalid node 1 because I am not the leader or quorum does not exist for t in {1..30} do for i in 0 1 2 do date echo "node info after failover at pgppol$i" cd pgpool$i source ./bashrc.ports cd .. $PGPOOL_INSTALL_DIR/bin/pcp_node_info -h localhost -p $PCP_PORT done # check whether all node down. n0=`$PGPOOL_INSTALL_DIR/bin/pcp_node_info -h localhost -p $PCP_PORT 0|awk '{print $5}'` n1=`$PGPOOL_INSTALL_DIR/bin/pcp_node_info -h localhost -p $PCP_PORT 1|awk '{print $5}'` if [ $n0 = "down" -a $n1 = "down" ];then echo "all nodes go down." ./shutdownall exit 1 fi sleep 1 done echo "test succeeded." ./shutdownall exit 0 pgpool-II-4.6.0/src/test/regression/.gitignore0000664000175000017500000000232414760007565016174 00000000000000/clean /regression.log /log/ /temp/ /tests/010.rewrite_timestamp/timestamp/result/ /tests/010.rewrite_timestamp/timestamp/test.diff /tests/010.rewrite_timestamp/timestamp/timestamp-test /tests/024.cert_auth/certrecord/ /tests/024.cert_auth/crl_openssl.conf /tests/024.cert_auth/crl_session.log /tests/024.cert_auth/crlnumber /tests/024.cert_auth/crlnumber.old /tests/024.cert_auth/frontend.crt /tests/024.cert_auth/frontend.key /tests/024.cert_auth/frontend.req /tests/024.cert_auth/index.txt /tests/024.cert_auth/index.txt.attr /tests/024.cert_auth/index.txt.attr.old /tests/024.cert_auth/index.txt.old /tests/024.cert_auth/root.crt /tests/024.cert_auth/root.key /tests/024.cert_auth/serial /tests/024.cert_auth/serial.old /tests/024.cert_auth/server.crl /tests/024.cert_auth/server.crt /tests/024.cert_auth/server.key /tests/024.cert_auth/server.req /tests/024.cert_auth/server_revoked.crl /tests/029.cert_passphrase/frontend.crt /tests/029.cert_passphrase/frontend.key /tests/029.cert_passphrase/postgresql.req /tests/029.cert_passphrase/root.crt /tests/029.cert_passphrase/root.key /tests/029.cert_passphrase/root.srl /tests/029.cert_passphrase/server.crt /tests/029.cert_passphrase/server.key /tests/029.cert_passphrase/server.req pgpool-II-4.6.0/src/test/regression/README0000664000175000017500000000271414760007565015067 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 successful 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.6.0/src/test/regression/libs.sh0000664000175000017500000000260614760007565015474 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/main 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|main">/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.* netstat -t -p 2>/dev/null|grep pgpool } #------------------------------------------- # check segmentation fault #------------------------------------------- function check_segfault { egrep -i "segmentation fault|segfault" log/pgpool.log >/dev/null 2>&1 } pgpool-II-4.6.0/src/test/regression/regress.sh0000775000175000017500000001433714760007565016224 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 # -c test pgpool using sample scripts and config files # -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 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_VERSION=`$PGPOOL_PATH/bin/pgpool --version 2>&1` export PGPOOL_INSTALL_DIR=$PGPOOL_PATH # where to look for pgpool.conf.sample files. export PGPOOLDIR=${PGPOOLDIR:-"$PGPOOL_INSTALL_DIR/etc"} 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/\..*//'` export LANG=C export ENABLE_TEST=true } function print_info { echo ${CBLUE}"*************************"${CNORM} echo "REGRESSION MODE : "${CBLUE}$MODE${CNORM} echo "Pgpool-II version : "${CBLUE}$PGPOOL_VERSION${CNORM} echo "Pgpool-II install path : "${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 " -c test pgpool using sample scripts and config files\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:cd?" 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";; c) export TEST_SAMPLES="true";; 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_DIR" ]]; then PGPOOL_PATH=$PGPOOL_INSTALL_DIR fi export PGPOOL_SETUP=$PGPOOL_PATH/bin/pgpool_setup export WATCHDOG_SETUP=$PGPOOL_PATH/bin/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 # skip the test if there's no test.sh if [ ! -f test.sh ];then cd .. continue; fi echo -n "testing $i..." clean_all timeout $TIMEOUT ./test.sh > $log/$i 2>&1 rtn=$? check_segfault if [ $? -eq 0 ];then echo "fail: Segmentation fault detected" >> $log/$i segfault=1 rtn=1 fi if [ $rtn = 0 ];then echo ${CGREEN}"ok."${CNORM} ok=`expr $ok + 1` elif [ $rtn = 124 ];then echo "timeout." timeout=`expr $timeout + 1` else if [ "$segfault" = "1" ];then echo ${CRED}"segfault."${CNORM} else echo ${CRED}"failed."${CNORM} fi fail=`expr $fail + 1` fi cd .. done total=`expr $ok + $fail + $timeout` echo "out of $total ok:$ok failed:$fail timeout:$timeout" pgpool-II-4.6.0/src/utils/0000775000175000017500000000000014760010077012254 500000000000000pgpool-II-4.6.0/src/utils/error/0000775000175000017500000000000014760010070013376 500000000000000pgpool-II-4.6.0/src/utils/error/elog.c0000664000175000017500000023213414760007565014434 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-2023, 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 "main/pgpool_logger.h" #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; /* * 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_pipe_chunks(char *data, int len, int dest); 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); static inline bool should_output_to_server(int elevel); static inline bool should_output_to_client(int elevel); /* * 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 || elevel == FRONTEND_LOG) { if (log_min_level == LOG || log_min_level <= ERROR) return true; } else if (elevel == FRONTEND_DEBUG) { if (log_min_level <= DEBUG1) 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; } /* * should_output_to_server --- should message of given elevel go to the log? */ static inline bool should_output_to_server(int elevel) { return is_log_level_output(elevel, pool_config->log_min_messages); } /* * should_output_to_client --- should message of given elevel go to the client? */ static inline bool should_output_to_client(int elevel) { /* 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. */ return (elevel >= pool_config->client_min_messages || elevel == INFO || elevel == FRONTEND_ONLY_ERROR); } return false; } /* * message_level_is_interesting --- would ereport/elog do anything? * * Returns true if ereport/elog with this elevel will not be a no-op. * This is useful to short-circuit any expensive preparatory work that * might be needed for a logging message. There is no point in * prepending this to a bare ereport/elog call, however. */ bool message_level_is_interesting(int elevel) { /* * Keep this in sync with the decision-making in errstart(). */ if (elevel >= ERROR || should_output_to_server(elevel) || should_output_to_client(elevel)) return true; return false; } /* * 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; } else if (elevel == FRONTEND_DEBUG || elevel == FRONTEND_LOG) { frontend_invalid = true; } 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 || elevel == FRONTEND_LOG || elevel == FRONTEND_DEBUG) { 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 = should_output_to_server(elevel); output_to_client = should_output_to_client(elevel); /* 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) { /* * Oops, 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 || elevel == FRONTEND_LOG || elevel == FRONTEND_DEBUG) { /* * 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 = should_output_to_server(FATAL); edata->output_to_client = should_output_to_client(FATAL); /* * 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 FRONTEND_LOG: case FRONTEND_DEBUG: 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 * unconvertible 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; } /* * Send data to the syslogger using the chunked protocol * * Note: when there are multiple backends writing into the syslogger pipe, * it's critical that each write go into the pipe indivisibly, and not * get interleaved with data from other processes. Fortunately, the POSIX * spec requires that writes to pipes be atomic so long as they are not * more than PIPE_BUF bytes long. So we divide long messages into chunks * that are no more than that length, and send one chunk per write() call. * The collector process knows how to reassemble the chunks. * * Because of the atomic write requirement, there are only two possible * results from write() here: -1 for failure, or the requested number of * bytes. There is not really anything we can do about a failure; retry would * probably be an infinite loop, and we can't even report the error usefully. * (There is noplace else we could send it!) So we might as well just ignore * the result from write(). However, on some platforms you get a compiler * warning from ignoring write()'s result, so do a little dance with casting * rc to void to shut up the compiler. */ static void write_pipe_chunks(char *data, int len, int dest) { PipeProtoChunk p; int fd = fileno(stderr); int rc; Assert(len > 0); p.proto.nuls[0] = p.proto.nuls[1] = '\0'; p.proto.pid = myProcPid; /* write all but the last chunk */ while (len > PIPE_MAX_PAYLOAD) { p.proto.is_last = (dest == LOG_DESTINATION_CSVLOG ? 'F' : 'f'); p.proto.len = PIPE_MAX_PAYLOAD; memcpy(p.proto.data, data, PIPE_MAX_PAYLOAD); rc = write(fd, &p, PIPE_HEADER_SIZE + PIPE_MAX_PAYLOAD); (void) rc; data += PIPE_MAX_PAYLOAD; len -= PIPE_MAX_PAYLOAD; } /* write the last chunk */ p.proto.is_last = (dest == LOG_DESTINATION_CSVLOG ? 'T' : 't'); p.proto.len = len; memcpy(p.proto.data, data, len); rc = write(fd, &p, PIPE_HEADER_SIZE + 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; POOL_CONNECTION *frontend = NULL; POOL_SESSION_CONTEXT *session = pool_get_session_context(true); char strbuf[129]; 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 */ { char *appname; appname = get_application_name(); 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': { time_t now = time(NULL); strftime(strbuf, sizeof(strbuf), "%Y-%m-%d %H:%M:%S", localtime(&now)); if (padding != 0) appendStringInfo(buf, "%*s", padding, strbuf); else appendStringInfoString(buf, strbuf); } break; case 'm': { struct timeval timeval; time_t seconds; struct tm *now; char msbuf[13]; gettimeofday(&timeval, NULL); seconds = timeval.tv_sec; now = localtime(&seconds); strftime(strbuf, sizeof(strbuf), "%Y-%m-%d %H:%M:%S", now); snprintf(msbuf, sizeof(msbuf), ".%03d", (int) (timeval.tv_usec / 1000)); memcpy(strbuf + 19, msbuf, 5); 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: case FRONTEND_DEBUG: syslog_level = LOG_DEBUG; break; case LOG: case COMMERROR: case INFO: case FRONTEND_LOG: 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) { /* * Use the chunking protocol if we know the syslogger should be * catching stderr output, and we are not ourselves the syslogger. * Otherwise, just do a vanilla write to stderr. */ if (redirection_done && processType != PT_LOGGER) write_pipe_chunks(buf.data, buf.len, LOG_DESTINATION_STDERR); else 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: case FRONTEND_DEBUG: prefix = _("DEBUG"); break; case LOG: case COMMERROR: case FRONTEND_LOG: 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); } /* 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 extension 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.6.0/src/utils/error/assert.c0000664000175000017500000000237314760001620014771 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.6.0/src/utils/mmgr/0000775000175000017500000000000014760010070013207 500000000000000pgpool-II-4.6.0/src/utils/mmgr/mcxt.c0000664000175000017500000007337314760007565014302 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; } /* * 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.6.0/src/utils/mmgr/aset.c0000664000175000017500000011644714760001620014245 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.6.0/src/utils/pcp/0000775000175000017500000000000014760010070013027 500000000000000pgpool-II-4.6.0/src/utils/pcp/pcp_stream.c0000664000175000017500000001530314760001620015253 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.6.0/src/utils/psqlscan.c0000664000175000017500000034056414760010070014171 00000000000000#line 2 "utils/psqlscan.c" #line 2 "utils/psqlscan.l" /*------------------------------------------------------------------------- * * psqlscan.l * lexical scanner for SQL commands * * This lexer used to be part of psql, and that heritage is reflected in * the file name as well as function and typedef names, though it can now * be used by other frontend programs as well. It's also possible to extend * this lexer with a compatible add-on lexer to handle program-specific * backslash commands. * * This code is mainly concerned with determining where the end of a SQL * statement is: we are looking for semicolons that are not within quotes, * comments, or parentheses. The most reliable way to handle this is to * borrow the backend's flex lexer rules, lock, stock, and barrel. The rules * below are (except for a few) the same as the backend's, but their actions * are just ECHO whereas the backend's actions generally do other things. * * XXX The rules in this file must be kept in sync with the backend lexer!!! * * XXX Avoid creating backtracking cases --- see the backend lexer for info. * * See psqlscan_int.h for additional commentary. * * * Portions Copyright (c) 2023, PgPool Global Development Group * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/fe_utils/psqlscan.l * *------------------------------------------------------------------------- */ #line 41 "utils/psqlscan.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) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE psql_yyrestart(yyin ,yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_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 psql_yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] void psql_yyrestart (FILE *input_file ,yyscan_t yyscanner ); void psql_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE psql_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void psql_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void psql_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void psql_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void psql_yypop_buffer_state (yyscan_t yyscanner ); static void psql_yyensure_buffer_stack (yyscan_t yyscanner ); static void psql_yy_load_buffer_state (yyscan_t yyscanner ); static void psql_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); #define YY_FLUSH_BUFFER psql_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) YY_BUFFER_STATE psql_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE psql_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE psql_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *psql_yyalloc (yy_size_t ,yyscan_t yyscanner ); void *psql_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); void psql_yyfree (void * ,yyscan_t yyscanner ); #define yy_new_buffer psql_yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ psql_yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ psql_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ psql_yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ psql_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define psql_yywrap(yyscanner) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; #define YY_NUM_RULES 86 #define YY_END_OF_BUFFER 87 /* 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[210] = { 0, 0, 0, 10, 10, 0, 0, 0, 0, 9, 9, 0, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 87, 85, 1, 1, 64, 35, 64, 85, 63, 13, 50, 51, 63, 63, 63, 63, 67, 67, 63, 52, 63, 63, 63, 84, 84, 84, 84, 84, 84, 54, 10, 16, 5, 5, 6, 6, 40, 37, 9, 21, 16, 19, 18, 18, 18, 18, 22, 22, 16, 28, 32, 32, 34, 38, 1, 64, 49, 29, 65, 30, 1, 43, 74, 2, 74, 67, 78, 73, 78, 72, 71, 78, 60, 59, 55, 42, 44, 62, 46, 48, 45, 47, 84, 8, 14, 12, 41, 11, 53, 10, 5, 7, 4, 3, 40, 39, 9, 21, 20, 18, 18, 18, 18, 17, 18, 18, 22, 25, 26, 24, 24, 25, 32, 31, 33, 65, 66, 66, 30, 1, 1, 74, 82, 82, 82, 2, 75, 74, 70, 73, 77, 76, 69, 72, 68, 71, 67, 60, 59, 61, 36, 15, 3, 18, 18, 18, 18, 26, 24, 24, 27, 33, 74, 82, 81, 81, 76, 83, 83, 80, 80, 68, 79, 79, 74, 57, 56, 61, 18, 18, 18, 18, 18, 26, 24, 24, 27, 58, 18, 24, 24, 24, 23, 24, 24, 24, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 23, 23, 24, 25, 26, 27, 28, 29, 7, 30, 31, 30, 30, 32, 30, 33, 33, 33, 33, 33, 33, 33, 34, 35, 33, 33, 33, 33, 33, 36, 33, 33, 37, 33, 33, 16, 38, 16, 9, 39, 7, 30, 31, 30, 30, 32, 30, 33, 33, 33, 33, 33, 33, 33, 34, 35, 33, 33, 33, 33, 33, 40, 33, 33, 41, 33, 33, 42, 7, 43, 7, 1, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 } ; static yyconst flex_int32_t yy_meta[44] = { 0, 1, 1, 2, 2, 3, 4, 3, 5, 3, 3, 6, 1, 1, 7, 3, 1, 3, 1, 7, 8, 8, 9, 10, 11, 1, 3, 12, 3, 3, 13, 13, 13, 14, 14, 14, 14, 14, 15, 16, 14, 14, 11, 1 } ; static yyconst flex_int16_t yy_base[260] = { 0, 0, 0, 372, 371, 39, 64, 359, 350, 344, 299, 294, 286, 58, 82, 44, 69, 42, 49, 290, 287, 277, 276, 261, 1004, 85, 92, 230, 1004, 0, 89, 0, 1004, 1004, 1004, 1004, 238, 80, 240, 95, 102, 134, 1004, 36, 222, 215, 0, 230, 228, 218, 215, 212, 52, 0, 1004, 0, 0, 100, 201, 0, 204, 0, 0, 198, 1004, 145, 148, 152, 184, 0, 0, 182, 146, 0, 0, 183, 175, 102, 0, 0, 1004, 150, 166, 185, 1004, 185, 0, 198, 0, 1004, 102, 211, 157, 125, 215, 0, 0, 216, 1004, 1004, 131, 0, 0, 0, 0, 0, 1004, 1004, 1004, 169, 1004, 1004, 0, 0, 169, 1004, 0, 0, 1004, 0, 0, 1004, 242, 245, 140, 249, 1004, 136, 261, 0, 1004, 247, 0, 0, 0, 0, 1004, 138, 250, 1004, 254, 136, 0, 285, 259, 1004, 286, 263, 0, 1004, 295, 164, 100, 299, 303, 307, 310, 327, 103, 315, 132, 113, 0, 1004, 1004, 0, 337, 367, 370, 373, 323, 0, 0, 0, 100, 0, 358, 1004, 177, 371, 1004, 375, 1004, 331, 0, 1004, 31, 41, 1004, 1004, 8, 397, 400, 404, 409, 416, 1004, 0, 0, 1004, 1004, 420, 0, 0, 0, 1004, 0, 0, 0, 1004, 437, 453, 469, 485, 501, 517, 533, 549, 563, 571, 584, 596, 612, 628, 644, 660, 676, 692, 708, 724, 736, 745, 757, 773, 782, 796, 801, 810, 819, 833, 845, 854, 860, 866, 875, 884, 893, 902, 911, 927, 936, 942, 948, 954, 960, 966, 972, 978, 984, 990 } ; static yyconst flex_int16_t yy_def[260] = { 0, 209, 1, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 216, 216, 217, 217, 212, 212, 214, 214, 209, 209, 209, 209, 218, 209, 218, 219, 218, 209, 209, 209, 209, 218, 209, 218, 209, 39, 220, 209, 218, 218, 218, 221, 221, 221, 221, 221, 221, 209, 222, 209, 223, 223, 209, 209, 224, 209, 225, 226, 209, 209, 209, 209, 209, 209, 227, 227, 209, 228, 229, 229, 230, 209, 209, 218, 218, 209, 231, 232, 233, 209, 234, 235, 234, 40, 209, 209, 209, 209, 236, 209, 237, 238, 220, 209, 209, 209, 218, 218, 218, 218, 221, 209, 209, 209, 209, 209, 209, 222, 223, 209, 209, 239, 224, 209, 225, 226, 209, 209, 209, 209, 209, 209, 209, 240, 227, 209, 209, 241, 242, 243, 229, 209, 244, 231, 209, 209, 232, 233, 233, 234, 209, 209, 209, 235, 209, 144, 245, 209, 209, 246, 247, 209, 209, 236, 40, 237, 238, 248, 209, 209, 239, 249, 240, 240, 240, 209, 250, 251, 252, 244, 150, 209, 209, 209, 246, 209, 209, 209, 209, 157, 209, 236, 87, 209, 209, 248, 249, 249, 209, 249, 240, 209, 253, 254, 209, 209, 249, 255, 256, 257, 209, 258, 259, 256, 0, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209 } ; static yyconst flex_int16_t yy_nxt[1048] = { 0, 24, 25, 26, 25, 27, 28, 29, 30, 31, 29, 32, 33, 34, 31, 31, 35, 36, 37, 38, 39, 40, 40, 40, 41, 42, 43, 44, 45, 29, 46, 47, 48, 46, 49, 46, 50, 51, 52, 46, 50, 51, 24, 24, 56, 74, 56, 70, 56, 56, 75, 200, 74, 57, 56, 71, 56, 75, 58, 209, 65, 66, 67, 101, 102, 56, 56, 56, 56, 56, 209, 56, 70, 56, 56, 68, 111, 111, 57, 56, 71, 56, 72, 58, 65, 66, 67, 77, 77, 77, 56, 56, 56, 56, 77, 77, 77, 80, 84, 68, 85, 85, 85, 85, 77, 77, 77, 72, 136, 81, 81, 81, 81, 87, 114, 88, 88, 88, 88, 115, 151, 151, 151, 151, 189, 89, 90, 91, 89, 89, 92, 89, 93, 89, 94, 89, 93, 89, 188, 89, 95, 152, 209, 89, 80, 96, 136, 122, 123, 123, 125, 125, 125, 166, 125, 125, 125, 128, 98, 126, 162, 99, 124, 126, 158, 127, 131, 131, 131, 127, 138, 138, 138, 138, 80, 163, 100, 155, 155, 155, 164, 118, 132, 114, 151, 151, 133, 134, 115, 140, 143, 136, 143, 121, 143, 143, 156, 151, 151, 143, 143, 128, 143, 178, 143, 144, 144, 144, 144, 121, 118, 143, 143, 143, 143, 116, 149, 146, 150, 150, 150, 150, 209, 110, 147, 109, 153, 209, 153, 108, 146, 154, 154, 154, 154, 159, 159, 159, 159, 107, 209, 106, 104, 209, 122, 123, 123, 125, 125, 125, 103, 125, 125, 125, 86, 83, 126, 79, 209, 124, 126, 209, 127, 168, 123, 123, 127, 170, 170, 170, 138, 138, 138, 138, 138, 138, 138, 138, 169, 144, 144, 144, 144, 144, 144, 144, 144, 63, 63, 140, 143, 146, 143, 76, 143, 143, 76, 63, 147, 143, 143, 153, 143, 153, 143, 63, 154, 154, 154, 154, 54, 143, 143, 143, 143, 175, 175, 175, 175, 154, 154, 154, 154, 179, 179, 179, 179, 155, 155, 155, 155, 155, 155, 187, 176, 159, 159, 159, 159, 192, 193, 193, 181, 196, 196, 196, 183, 157, 157, 157, 157, 155, 155, 155, 194, 54, 60, 184, 184, 184, 185, 185, 185, 185, 185, 60, 186, 185, 185, 168, 123, 123, 168, 123, 123, 168, 123, 123, 175, 175, 175, 175, 54, 54, 169, 209, 209, 169, 209, 209, 195, 179, 179, 179, 179, 179, 179, 179, 179, 192, 193, 193, 192, 193, 193, 209, 125, 125, 125, 209, 181, 192, 193, 193, 194, 126, 209, 194, 168, 123, 123, 127, 192, 193, 193, 209, 201, 209, 209, 209, 209, 209, 209, 195, 209, 209, 209, 201, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 78, 209, 209, 209, 78, 209, 209, 209, 209, 78, 82, 209, 209, 82, 82, 82, 209, 209, 82, 82, 209, 82, 97, 209, 97, 209, 97, 97, 97, 97, 97, 97, 97, 209, 97, 105, 209, 209, 105, 105, 105, 209, 209, 105, 105, 209, 105, 112, 112, 112, 112, 112, 209, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 209, 113, 113, 113, 113, 113, 113, 113, 113, 113, 117, 117, 117, 209, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 119, 119, 119, 119, 119, 209, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 209, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 129, 129, 129, 129, 129, 209, 129, 129, 129, 129, 129, 129, 129, 129, 209, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 135, 135, 135, 135, 209, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 137, 209, 209, 209, 209, 209, 209, 209, 137, 137, 209, 137, 139, 139, 139, 209, 209, 139, 139, 209, 139, 141, 209, 209, 141, 141, 141, 209, 209, 141, 141, 209, 141, 142, 209, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 145, 145, 145, 209, 209, 145, 145, 209, 145, 148, 209, 209, 209, 148, 209, 209, 209, 209, 148, 157, 157, 157, 209, 209, 157, 209, 209, 157, 160, 160, 160, 209, 209, 160, 160, 209, 160, 161, 161, 161, 209, 209, 161, 161, 209, 161, 165, 209, 209, 209, 165, 209, 209, 209, 209, 165, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 171, 171, 171, 209, 209, 171, 172, 172, 172, 209, 209, 172, 173, 173, 173, 209, 209, 173, 174, 209, 209, 174, 174, 174, 209, 209, 174, 174, 209, 174, 177, 209, 209, 209, 209, 177, 177, 209, 177, 180, 180, 180, 209, 209, 180, 180, 209, 180, 182, 182, 209, 209, 209, 182, 182, 209, 182, 190, 190, 190, 209, 209, 190, 190, 209, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 197, 197, 197, 209, 209, 197, 198, 198, 198, 209, 209, 198, 199, 199, 199, 209, 209, 199, 202, 202, 202, 209, 209, 202, 203, 203, 203, 209, 209, 203, 204, 204, 204, 209, 209, 204, 205, 205, 205, 209, 209, 205, 206, 206, 206, 209, 209, 206, 207, 207, 207, 209, 209, 207, 208, 208, 208, 209, 209, 208, 23, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209 } ; static yyconst flex_int16_t yy_chk[1048] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 17, 5, 15, 5, 5, 17, 190, 18, 5, 5, 15, 5, 18, 5, 187, 13, 13, 13, 43, 43, 5, 5, 5, 5, 6, 186, 6, 16, 6, 6, 13, 52, 52, 6, 6, 16, 6, 15, 6, 14, 14, 14, 25, 25, 25, 6, 6, 6, 6, 26, 26, 26, 30, 37, 14, 37, 37, 37, 37, 77, 77, 77, 16, 174, 30, 30, 30, 30, 39, 57, 39, 39, 39, 39, 57, 152, 152, 90, 90, 161, 39, 39, 39, 39, 39, 39, 39, 39, 40, 39, 39, 39, 40, 160, 40, 41, 90, 158, 40, 141, 41, 137, 65, 65, 65, 66, 66, 66, 127, 67, 67, 67, 124, 41, 66, 100, 41, 65, 67, 93, 66, 72, 72, 72, 67, 81, 81, 81, 81, 82, 109, 41, 92, 92, 92, 109, 76, 72, 114, 151, 151, 72, 72, 114, 81, 83, 75, 83, 71, 83, 83, 92, 178, 178, 83, 83, 68, 83, 151, 83, 85, 85, 85, 85, 63, 60, 83, 83, 83, 83, 58, 87, 85, 87, 87, 87, 87, 97, 51, 85, 50, 91, 97, 91, 49, 87, 91, 91, 91, 91, 94, 94, 94, 94, 48, 97, 47, 45, 97, 122, 122, 122, 123, 123, 123, 44, 125, 125, 125, 38, 36, 123, 27, 97, 122, 125, 23, 123, 128, 128, 128, 125, 131, 131, 131, 138, 138, 138, 138, 140, 140, 140, 140, 128, 144, 144, 144, 144, 147, 147, 147, 147, 22, 21, 138, 143, 144, 143, 20, 143, 143, 19, 12, 144, 143, 143, 146, 143, 146, 143, 11, 146, 146, 146, 146, 10, 143, 143, 143, 143, 150, 150, 150, 150, 153, 153, 153, 153, 154, 154, 154, 154, 155, 155, 155, 156, 156, 156, 159, 150, 159, 159, 159, 159, 166, 166, 166, 154, 170, 170, 170, 155, 157, 157, 157, 157, 183, 183, 183, 166, 9, 8, 157, 157, 157, 157, 157, 157, 157, 157, 7, 157, 157, 157, 167, 167, 167, 168, 168, 168, 169, 169, 169, 176, 176, 176, 176, 4, 3, 167, 0, 0, 168, 0, 0, 169, 179, 179, 179, 179, 181, 181, 181, 181, 191, 191, 191, 192, 192, 192, 0, 193, 193, 193, 0, 179, 194, 194, 194, 191, 193, 0, 192, 195, 195, 195, 193, 201, 201, 201, 0, 194, 0, 0, 0, 0, 0, 0, 195, 0, 0, 0, 201, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 218, 0, 0, 0, 218, 0, 0, 0, 0, 218, 219, 0, 0, 219, 219, 219, 0, 0, 219, 219, 0, 219, 220, 0, 220, 0, 220, 220, 220, 220, 220, 220, 220, 0, 220, 221, 0, 0, 221, 221, 221, 0, 0, 221, 221, 0, 221, 222, 222, 222, 222, 222, 0, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 0, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 0, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 0, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, 0, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 0, 227, 227, 227, 227, 227, 227, 227, 227, 0, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 0, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, 0, 0, 0, 0, 0, 0, 0, 230, 230, 0, 230, 231, 231, 231, 0, 0, 231, 231, 0, 231, 232, 0, 0, 232, 232, 232, 0, 0, 232, 232, 0, 232, 233, 0, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 0, 0, 234, 234, 0, 234, 235, 0, 0, 0, 235, 0, 0, 0, 0, 235, 236, 236, 236, 0, 0, 236, 0, 0, 236, 237, 237, 237, 0, 0, 237, 237, 0, 237, 238, 238, 238, 0, 0, 238, 238, 0, 238, 239, 0, 0, 0, 239, 0, 0, 0, 0, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 0, 0, 241, 242, 242, 242, 0, 0, 242, 243, 243, 243, 0, 0, 243, 244, 0, 0, 244, 244, 244, 0, 0, 244, 244, 0, 244, 245, 0, 0, 0, 0, 245, 245, 0, 245, 246, 246, 246, 0, 0, 246, 246, 0, 246, 247, 247, 0, 0, 0, 247, 247, 0, 247, 248, 248, 248, 0, 0, 248, 248, 0, 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 250, 0, 0, 250, 251, 251, 251, 0, 0, 251, 252, 252, 252, 0, 0, 252, 253, 253, 253, 0, 0, 253, 254, 254, 254, 0, 0, 254, 255, 255, 255, 0, 0, 255, 256, 256, 256, 0, 0, 256, 257, 257, 257, 0, 0, 257, 258, 258, 258, 0, 0, 258, 259, 259, 259, 0, 0, 259, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "utils/psqlscan.l" #line 39 "utils/psqlscan.l" /* LCOV_EXCL_START */ #include "parser/pg_config_manual.h" #include "pool.h" #include "utils/psqlscan.h" #include "utils/psqlscan_int.h" #include "utils/pqexpbuffer.h" #include "utils/pgstrcasecmp.h" #include "utils/elog.h" #include "parser/pool_parser.h" #define pg_log_warning(str, var) elog(WARNING, (str), (var)) #define pg_malloc palloc #define pg_malloc0 palloc0 static char *pg_strdup(const char *in); /* * We must have a typedef YYSTYPE for psql_yylex's first argument, but this lexer * doesn't presently make use of that argument, so just declare it as int. */ typedef int YYSTYPE; /* * Set the type of yyextra; we use it as a pointer back to the containing * PsqlScanState. */ #define YY_EXTRA_TYPE PsqlScanState /* Return values from psql_yylex() */ #define LEXRES_EOL 0 /* end of input */ #define LEXRES_SEMI 1 /* command-terminating semicolon found */ #define LEXRES_BACKSLASH 2 /* backslash command start */ #define ECHO psqlscan_emit(cur_state, yytext, yyleng) /* * Work around a bug in flex 2.5.35: it emits a couple of functions that * it forgets to emit declarations for. Since we use -Wmissing-prototypes, * this would cause warnings. Providing our own declarations should be * harmless even when the bug gets fixed. */ extern int psql_yyget_column(yyscan_t yyscanner); extern void psql_yyset_column(int column_no, yyscan_t yyscanner); #define YY_NO_INPUT 1 /* * All of the following definitions and rules should exactly match * src/backend/parser/scan.l so far as the flex patterns are concerned. * The rule bodies are just ECHO as opposed to what the backend does, * however. (But be sure to duplicate code that affects the lexing process, * such as BEGIN() and yyless().) Also, psqlscan uses a single <> rule * whereas scan.l has a separate one for each exclusive state. */ /* * OK, here is a short description of lex/flex rules behavior. * The longest pattern which matches an input string is always chosen. * For equal-length patterns, the first occurring in the rules list is chosen. * INITIAL is the starting state, to which all non-conditional rules apply. * Exclusive states change parsing rules while the state is active. When in * an exclusive state, only those rules defined for that state apply. * * We use exclusive states for quoted strings, extended comments, * and to eliminate parsing troubles for numeric strings. * Exclusive states: * bit string literal * extended C-style comments * delimited identifiers (double-quoted identifiers) * hexadecimal byte string * standard quoted strings * quote stop (detect continued strings) * extended quoted strings (support backslash escape sequences) * $foo$ quoted strings * quoted identifier with Unicode escapes * quoted string with Unicode escapes * * Note: we intentionally don't mimic the backend's state; we have * no need to distinguish it from state, and no good way to get out * of it in error cases. The backend just throws yyerror() in those * cases, but that's not an option here. */ /* * In order to make the world safe for Windows and Mac clients as well as * Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n * sequence will be seen as two successive newlines, but that doesn't cause * any problems. Comments that start with -- and extend to the next * newline are treated as equivalent to a single whitespace character. * * NOTE a fine point: if there is no newline following --, we will absorb * everything to the end of the input as a comment. This is correct. Older * versions of Postgres failed to recognize -- as a comment if the input * did not end with a newline. * * XXX perhaps \f (formfeed) should be treated as a newline as well? * * XXX if you change the set of whitespace characters, fix scanner_isspace() * to agree. */ /* * SQL requires at least one newline in the whitespace separating * string literals that are to be concatenated. Silly, but who are we * to argue? Note that {whitespace_with_newline} should not have * after * it, whereas {whitespace} should generally have a * after it... */ /* If we see {quote} then {quotecontinue}, the quoted string continues */ /* * {quotecontinuefail} is needed to avoid lexer backup when we fail to match * {quotecontinue}. It might seem that this could just be {whitespace}*, * but if there's a dash after {whitespace_with_newline}, it must be consumed * to see if there's another dash --- which would start a {comment} and thus * allow continuation of the {quotecontinue} token. */ /* Bit string * It is tempting to scan the string for only those characters * which are allowed. However, this leads to silently swallowed * characters if illegal characters are included in the string. * For example, if xbinside is [01] then B'ABCD' is interpreted * as a zero-length string, and the ABCD' is lost! * Better to pass the string forward and let the input routines * validate the contents. */ /* Hexadecimal byte string */ /* National character */ /* Quoted string that allows backslash escapes */ /* Extended quote * xqdouble implements embedded quote, '''' */ /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string * in the form of an identifier, except that it may not contain "$", * and extends to the first occurrence of an identical string. * There is *no* processing of the quoted text. * * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim} * fails to match its trailing "$". */ /* Double quote * Allows embedded spaces and other special characters into identifiers. */ /* Quoted identifier with Unicode escapes */ /* Quoted string with Unicode escapes */ /* error rule to avoid backup */ /* C-style comments * * The "extended comment" syntax closely resembles allowable operator syntax. * The tricky part here is to get lex to recognize a string starting with * slash-star as a comment, when interpreting it as an operator would produce * a longer match --- remember lex will prefer a longer match! Also, if we * have something like plus-slash-star, lex will think this is a 3-character * operator whereas we want to see it as a + operator and a comment start. * The solution is two-fold: * 1. append {op_chars}* to xcstart so that it matches as much text as * {operator} would. Then the tie-breaker (first matching rule of same * length) ensures xcstart wins. We put back the extra stuff with yyless() * in case it contains a star-slash that should terminate the comment. * 2. In the operator rule, check for slash-star within the operator, and * if found throw it back with yyless(). This handles the plus-slash-star * problem. * Dash-dash comments have similar interactions with the operator rule. */ /* Assorted special-case operators and operator-like tokens */ /* * These operator-like tokens (unlike the above ones) also match the {operator} * rule, which means that they might be overridden by a longer match if they * are followed by a comment start or a + or - character. Accordingly, if you * add to this list, you must also add corresponding code to the {operator} * block to return the correct token in such cases. (This is not needed in * psqlscan.l since the token value is ignored there.) */ /* * "self" is the set of chars that should be returned as single-character * tokens. "op_chars" is the set of chars that can make up "Op" tokens, * which can be one or more characters long (but if a single-char token * appears in the "self" set, it is not to be returned as an Op). Note * that the sets overlap, but each has some chars that are not in the other. * * If you change either set, adjust the character lists appearing in the * rule for "operator"! */ /* * Numbers * * Unary minus is not part of a number here. Instead we pass it separately to * the parser, and there it gets coerced via doNegate(). * * {numericfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. * * {realfail} is added to prevent the need for scanner * backup when the {real} rule fails to match completely. */ /* psql-specific: characters allowed in variable names */ /* * Dollar quoted strings are totally opaque, and no escaping is done on them. * Other quoted strings must allow some special characters such as single-quote * and newline. * Embedded single-quotes are implemented both in the SQL standard * style of two adjacent single quotes "''" and in the Postgres/Java style * of escaped-quote "\'". * Other embedded escaped characters are matched explicitly and the leading * backslash is dropped from the string. * Note that xcstart must appear before operator, as explained above! * Also whitespace (comment) must appear before operator. */ #line 996 "utils/psqlscan.c" #define INITIAL 0 #define xb 1 #define xc 2 #define xd 3 #define xh 4 #define xq 5 #define xqs 6 #define xe 7 #define xdolq 8 #define xui 9 #define xus 10 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; yy_size_t yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; int yy_start_stack_ptr; int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; char *yytext_r; int yy_more_flag; int yy_more_len; YYSTYPE * yylval_r; }; /* end struct yyguts_t */ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r int psql_yylex_init (yyscan_t* scanner); int psql_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int psql_yylex_destroy (yyscan_t yyscanner ); int psql_yyget_debug (yyscan_t yyscanner ); void psql_yyset_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE psql_yyget_extra (yyscan_t yyscanner ); void psql_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *psql_yyget_in (yyscan_t yyscanner ); void psql_yyset_in (FILE * in_str ,yyscan_t yyscanner ); FILE *psql_yyget_out (yyscan_t yyscanner ); void psql_yyset_out (FILE * out_str ,yyscan_t yyscanner ); yy_size_t psql_yyget_leng (yyscan_t yyscanner ); char *psql_yyget_text (yyscan_t yyscanner ); int psql_yyget_lineno (yyscan_t yyscanner ); void psql_yyset_lineno (int line_number ,yyscan_t yyscanner ); int psql_yyget_column (yyscan_t yyscanner ); void psql_yyset_column (int column_no ,yyscan_t yyscanner ); YYSTYPE * psql_yyget_lval (yyscan_t yyscanner ); void psql_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int psql_yywrap (yyscan_t yyscanner ); #else extern int psql_yywrap (yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner ); #else static int input (yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ 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 , yyscanner) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int psql_yylex \ (YYSTYPE * yylval_param ,yyscan_t yyscanner); #define YY_DECL int psql_yylex \ (YYSTYPE * yylval_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; #line 387 "utils/psqlscan.l" /* Declare some local variables inside psql_yylex(), for convenience */ PsqlScanState cur_state = yyextra; PQExpBuffer output_buf = cur_state->output_buf; /* * Force flex into the state indicated by start_state. This has a * couple of purposes: it lets some of the functions below set a new * starting state without ugly direct access to flex variables, and it * allows us to transition from one flex lexer to another so that we * can lex different parts of the source string using separate lexers. */ BEGIN(cur_state->start_state); #line 1259 "utils/psqlscan.c" yylval = yylval_param; if ( !yyg->yy_init ) { yyg->yy_init = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { psql_yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = psql_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } psql_yy_load_buffer_state(yyscanner ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; /* Support of yytext. */ *yy_cp = yyg->yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yyg->yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 210 ) 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 != 209 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yyg->yy_hold_char; yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 404 "utils/psqlscan.l" { /* * Note that the whitespace rule includes both true * whitespace and single-line ("--" style) comments. * We suppress whitespace until we have collected some * non-whitespace data. (This interacts with some * decisions in MainLoop(); see there for details.) */ if (output_buf->len > 0) ECHO; } YY_BREAK case 2: YY_RULE_SETUP #line 416 "utils/psqlscan.l" { cur_state->xcdepth = 0; BEGIN(xc); /* Put back any characters past slash-star; see above */ yyless(2); ECHO; } YY_BREAK case 3: YY_RULE_SETUP #line 425 "utils/psqlscan.l" { cur_state->xcdepth++; /* Put back any characters past slash-star; see above */ yyless(2); ECHO; } YY_BREAK case 4: YY_RULE_SETUP #line 432 "utils/psqlscan.l" { if (cur_state->xcdepth <= 0) BEGIN(INITIAL); else cur_state->xcdepth--; ECHO; } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP #line 440 "utils/psqlscan.l" { ECHO; } YY_BREAK case 6: YY_RULE_SETUP #line 444 "utils/psqlscan.l" { ECHO; } YY_BREAK case 7: YY_RULE_SETUP #line 448 "utils/psqlscan.l" { ECHO; } YY_BREAK /* */ case 8: YY_RULE_SETUP #line 453 "utils/psqlscan.l" { BEGIN(xb); ECHO; } YY_BREAK case 9: /* rule 9 can match eol */ #line 458 "utils/psqlscan.l" case 10: /* rule 10 can match eol */ YY_RULE_SETUP #line 458 "utils/psqlscan.l" { ECHO; } YY_BREAK case 11: YY_RULE_SETUP #line 462 "utils/psqlscan.l" { /* Hexadecimal bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "x" on the string * to mark it for the input routine as a hex string. */ BEGIN(xh); ECHO; } YY_BREAK case 12: YY_RULE_SETUP #line 473 "utils/psqlscan.l" { yyless(1); /* eat only 'n' this time */ ECHO; } YY_BREAK case 13: YY_RULE_SETUP #line 478 "utils/psqlscan.l" { if (cur_state->std_strings) BEGIN(xq); else BEGIN(xe); ECHO; } YY_BREAK case 14: YY_RULE_SETUP #line 485 "utils/psqlscan.l" { BEGIN(xe); ECHO; } YY_BREAK case 15: YY_RULE_SETUP #line 489 "utils/psqlscan.l" { BEGIN(xus); ECHO; } YY_BREAK case 16: YY_RULE_SETUP #line 494 "utils/psqlscan.l" { /* * When we are scanning a quoted string and see an end * quote, we must look ahead for a possible continuation. * If we don't see one, we know the end quote was in fact * the end of the string. To reduce the lexer table size, * we use a single "xqs" state to do the lookahead for all * types of strings. */ cur_state->state_before_str_stop = YYSTATE; BEGIN(xqs); ECHO; } YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 507 "utils/psqlscan.l" { /* * Found a quote continuation, so return to the in-quote * state and continue scanning the literal. Nothing is * added to the literal's contents. */ BEGIN(cur_state->state_before_str_stop); ECHO; } YY_BREAK case 18: /* rule 18 can match eol */ #line 517 "utils/psqlscan.l" case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 517 "utils/psqlscan.l" { /* * Failed to see a quote continuation. Throw back * everything after the end quote, and handle the string * according to the state we were in previously. */ yyless(0); BEGIN(INITIAL); /* There's nothing to echo ... */ } YY_BREAK case 20: YY_RULE_SETUP #line 528 "utils/psqlscan.l" { ECHO; } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 531 "utils/psqlscan.l" { ECHO; } YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP #line 534 "utils/psqlscan.l" { ECHO; } YY_BREAK case 23: YY_RULE_SETUP #line 537 "utils/psqlscan.l" { ECHO; } YY_BREAK case 24: YY_RULE_SETUP #line 540 "utils/psqlscan.l" { ECHO; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP #line 543 "utils/psqlscan.l" { ECHO; } YY_BREAK case 26: YY_RULE_SETUP #line 546 "utils/psqlscan.l" { ECHO; } YY_BREAK case 27: YY_RULE_SETUP #line 549 "utils/psqlscan.l" { ECHO; } YY_BREAK case 28: YY_RULE_SETUP #line 552 "utils/psqlscan.l" { /* This is only needed for \ just before EOF */ ECHO; } YY_BREAK case 29: YY_RULE_SETUP #line 557 "utils/psqlscan.l" { cur_state->dolqstart = pg_strdup(yytext); BEGIN(xdolq); ECHO; } YY_BREAK case 30: YY_RULE_SETUP #line 562 "utils/psqlscan.l" { /* throw back all but the initial "$" */ yyless(1); ECHO; } YY_BREAK case 31: YY_RULE_SETUP #line 567 "utils/psqlscan.l" { if (strcmp(yytext, cur_state->dolqstart) == 0) { pfree(cur_state->dolqstart); cur_state->dolqstart = NULL; BEGIN(INITIAL); } else { /* * When we fail to match $...$ to dolqstart, transfer * the $... part to the output, but put back the final * $ for rescanning. Consider $delim$...$junk$delim$ */ yyless(yyleng - 1); } ECHO; } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP #line 585 "utils/psqlscan.l" { ECHO; } YY_BREAK case 33: YY_RULE_SETUP #line 588 "utils/psqlscan.l" { ECHO; } YY_BREAK case 34: YY_RULE_SETUP #line 591 "utils/psqlscan.l" { /* This is only needed for $ inside the quoted text */ ECHO; } YY_BREAK case 35: YY_RULE_SETUP #line 596 "utils/psqlscan.l" { BEGIN(xd); ECHO; } YY_BREAK case 36: YY_RULE_SETUP #line 600 "utils/psqlscan.l" { BEGIN(xui); ECHO; } YY_BREAK case 37: YY_RULE_SETUP #line 604 "utils/psqlscan.l" { BEGIN(INITIAL); ECHO; } YY_BREAK case 38: YY_RULE_SETUP #line 608 "utils/psqlscan.l" { BEGIN(INITIAL); ECHO; } YY_BREAK case 39: YY_RULE_SETUP #line 612 "utils/psqlscan.l" { ECHO; } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP #line 615 "utils/psqlscan.l" { ECHO; } YY_BREAK case 41: YY_RULE_SETUP #line 619 "utils/psqlscan.l" { /* throw back all but the initial u/U */ yyless(1); ECHO; } YY_BREAK case 42: YY_RULE_SETUP #line 625 "utils/psqlscan.l" { ECHO; } YY_BREAK case 43: YY_RULE_SETUP #line 629 "utils/psqlscan.l" { ECHO; } YY_BREAK case 44: YY_RULE_SETUP #line 633 "utils/psqlscan.l" { ECHO; } YY_BREAK case 45: YY_RULE_SETUP #line 637 "utils/psqlscan.l" { ECHO; } YY_BREAK case 46: YY_RULE_SETUP #line 641 "utils/psqlscan.l" { ECHO; } YY_BREAK case 47: YY_RULE_SETUP #line 645 "utils/psqlscan.l" { ECHO; } YY_BREAK case 48: YY_RULE_SETUP #line 649 "utils/psqlscan.l" { ECHO; } YY_BREAK case 49: YY_RULE_SETUP #line 653 "utils/psqlscan.l" { ECHO; } YY_BREAK /* * These rules are specific to psql --- they implement parenthesis * counting and detection of command-ending semicolon. These must * appear before the {self} rule so that they take precedence over it. */ case 50: YY_RULE_SETUP #line 663 "utils/psqlscan.l" { cur_state->paren_depth++; ECHO; } YY_BREAK case 51: YY_RULE_SETUP #line 668 "utils/psqlscan.l" { if (cur_state->paren_depth > 0) cur_state->paren_depth--; ECHO; } YY_BREAK case 52: YY_RULE_SETUP #line 674 "utils/psqlscan.l" { ECHO; if (cur_state->paren_depth == 0 && cur_state->begin_depth == 0) { /* Terminate lexing temporarily */ cur_state->start_state = YY_START; cur_state->identifier_count = 0; return LEXRES_SEMI; } } YY_BREAK /* * psql-specific rules to handle backslash commands and variable * substitution. We want these before {self}, also. */ case 53: YY_RULE_SETUP #line 690 "utils/psqlscan.l" { /* Force a semi-colon or colon into the query buffer */ psqlscan_emit(cur_state, yytext + 1, 1); if (yytext[1] == ';') cur_state->identifier_count = 0; } YY_BREAK case 54: YY_RULE_SETUP #line 697 "utils/psqlscan.l" { /* Terminate lexing temporarily */ cur_state->start_state = YY_START; return LEXRES_BACKSLASH; } YY_BREAK case 55: YY_RULE_SETUP #line 703 "utils/psqlscan.l" { /* Possible psql variable substitution */ char *varname; char *value; varname = psqlscan_extract_substring(cur_state, yytext + 1, yyleng - 1); if (cur_state->callbacks->get_variable) value = cur_state->callbacks->get_variable(varname, PQUOTE_PLAIN, cur_state->cb_passthrough); else value = NULL; if (value) { /* It is a variable, check for recursion */ if (psqlscan_var_is_current_source(cur_state, varname)) { /* Recursive expansion --- don't go there */ pg_log_warning("skipping recursive expansion of variable \"%s\"", varname); /* Instead copy the string as is */ ECHO; } else { /* OK, perform substitution */ psqlscan_push_new_buffer(cur_state, value, varname); /* psql_yy_scan_string already made buffer active */ } pfree(value); } else { /* * if the variable doesn't exist we'll copy the string * as is */ ECHO; } pfree(varname); } YY_BREAK case 56: YY_RULE_SETUP #line 749 "utils/psqlscan.l" { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_LITERAL); } YY_BREAK case 57: YY_RULE_SETUP #line 754 "utils/psqlscan.l" { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_IDENT); } YY_BREAK case 58: YY_RULE_SETUP #line 759 "utils/psqlscan.l" { psqlscan_test_variable(cur_state, yytext, yyleng); } YY_BREAK /* * These rules just avoid the need for scanner backup if one of the * three rules above fails to match completely. */ case 59: YY_RULE_SETUP #line 768 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 60: YY_RULE_SETUP #line 774 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 61: YY_RULE_SETUP #line 780 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK case 62: YY_RULE_SETUP #line 785 "utils/psqlscan.l" { /* Throw back everything but the colon */ yyless(1); ECHO; } YY_BREAK /* * Back to backend-compatible rules. */ case 63: YY_RULE_SETUP #line 795 "utils/psqlscan.l" { ECHO; } YY_BREAK case 64: YY_RULE_SETUP #line 799 "utils/psqlscan.l" { /* * Check for embedded slash-star or dash-dash; those * are comment starts, so operator must stop there. * Note that slash-star or dash-dash at the first * character will match a prior rule, not this one. */ int nchars = yyleng; char *slashstar = strstr(yytext, "/*"); char *dashdash = strstr(yytext, "--"); if (slashstar && dashdash) { /* if both appear, take the first one */ if (slashstar > dashdash) slashstar = dashdash; } else if (!slashstar) slashstar = dashdash; if (slashstar) nchars = slashstar - yytext; /* * For SQL compatibility, '+' and '-' cannot be the * last char of a multi-char operator unless the operator * contains chars that are not in SQL operators. * The idea is to lex '=-' as two operators, but not * to forbid operator names like '?-' that could not be * sequences of SQL operators. */ if (nchars > 1 && (yytext[nchars - 1] == '+' || yytext[nchars - 1] == '-')) { int ic; for (ic = nchars - 2; ic >= 0; ic--) { char c = yytext[ic]; if (c == '~' || c == '!' || c == '@' || c == '#' || c == '^' || c == '&' || c == '|' || c == '`' || c == '?' || c == '%') break; } if (ic < 0) { /* * didn't find a qualifying character, so remove * all trailing [+-] */ do { nchars--; } while (nchars > 1 && (yytext[nchars - 1] == '+' || yytext[nchars - 1] == '-')); } } if (nchars < yyleng) { /* Strip the unwanted chars from the token */ yyless(nchars); } ECHO; } YY_BREAK case 65: YY_RULE_SETUP #line 866 "utils/psqlscan.l" { ECHO; } YY_BREAK case 66: YY_RULE_SETUP #line 869 "utils/psqlscan.l" { ECHO; } YY_BREAK case 67: YY_RULE_SETUP #line 873 "utils/psqlscan.l" { ECHO; } YY_BREAK case 68: YY_RULE_SETUP #line 876 "utils/psqlscan.l" { ECHO; } YY_BREAK case 69: YY_RULE_SETUP #line 879 "utils/psqlscan.l" { ECHO; } YY_BREAK case 70: YY_RULE_SETUP #line 882 "utils/psqlscan.l" { ECHO; } YY_BREAK case 71: YY_RULE_SETUP #line 885 "utils/psqlscan.l" { ECHO; } YY_BREAK case 72: YY_RULE_SETUP #line 888 "utils/psqlscan.l" { ECHO; } YY_BREAK case 73: YY_RULE_SETUP #line 891 "utils/psqlscan.l" { ECHO; } YY_BREAK case 74: YY_RULE_SETUP #line 894 "utils/psqlscan.l" { ECHO; } YY_BREAK case 75: YY_RULE_SETUP #line 897 "utils/psqlscan.l" { /* throw back the .., and treat as integer */ yyless(yyleng - 2); ECHO; } YY_BREAK case 76: YY_RULE_SETUP #line 902 "utils/psqlscan.l" { ECHO; } YY_BREAK case 77: YY_RULE_SETUP #line 905 "utils/psqlscan.l" { ECHO; } YY_BREAK case 78: YY_RULE_SETUP #line 908 "utils/psqlscan.l" { ECHO; } YY_BREAK case 79: YY_RULE_SETUP #line 911 "utils/psqlscan.l" { ECHO; } YY_BREAK case 80: YY_RULE_SETUP #line 914 "utils/psqlscan.l" { ECHO; } YY_BREAK case 81: YY_RULE_SETUP #line 917 "utils/psqlscan.l" { ECHO; } YY_BREAK case 82: YY_RULE_SETUP #line 920 "utils/psqlscan.l" { ECHO; } YY_BREAK case 83: YY_RULE_SETUP #line 923 "utils/psqlscan.l" { ECHO; } YY_BREAK case 84: YY_RULE_SETUP #line 928 "utils/psqlscan.l" { /* * We need to track if we are inside a BEGIN .. END block * in a function definition, so that semicolons contained * therein don't terminate the whole statement. Short of * writing a full parser here, the following heuristic * should work. First, we track whether the beginning of * the statement matches CREATE [OR REPLACE] * {FUNCTION|PROCEDURE} */ if (cur_state->identifier_count == 0) memset(cur_state->identifiers, 0, sizeof(cur_state->identifiers)); if (pg_strcasecmp(yytext, "create") == 0 || pg_strcasecmp(yytext, "function") == 0 || pg_strcasecmp(yytext, "procedure") == 0 || pg_strcasecmp(yytext, "or") == 0 || pg_strcasecmp(yytext, "replace") == 0) { if (cur_state->identifier_count < sizeof(cur_state->identifiers)) cur_state->identifiers[cur_state->identifier_count] = pg_tolower((unsigned char) yytext[0]); } cur_state->identifier_count++; if (cur_state->identifiers[0] == 'c' && (cur_state->identifiers[1] == 'f' || cur_state->identifiers[1] == 'p' || (cur_state->identifiers[1] == 'o' && cur_state->identifiers[2] == 'r' && (cur_state->identifiers[3] == 'f' || cur_state->identifiers[3] == 'p'))) && cur_state->paren_depth == 0) { if (pg_strcasecmp(yytext, "begin") == 0) cur_state->begin_depth++; else if (pg_strcasecmp(yytext, "case") == 0) { /* * CASE also ends with END. We only need to track * this if we are already inside a BEGIN. */ if (cur_state->begin_depth >= 1) cur_state->begin_depth++; } else if (pg_strcasecmp(yytext, "end") == 0) { if (cur_state->begin_depth > 0) cur_state->begin_depth--; } } ECHO; } YY_BREAK case 85: YY_RULE_SETUP #line 981 "utils/psqlscan.l" { ECHO; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(xb): case YY_STATE_EOF(xc): case YY_STATE_EOF(xd): case YY_STATE_EOF(xh): case YY_STATE_EOF(xq): case YY_STATE_EOF(xqs): case YY_STATE_EOF(xe): case YY_STATE_EOF(xdolq): case YY_STATE_EOF(xui): case YY_STATE_EOF(xus): #line 985 "utils/psqlscan.l" { if (cur_state->buffer_stack == NULL) { cur_state->start_state = YY_START; return LEXRES_EOL; /* end of input reached */ } /* * We were expanding a variable, so pop the inclusion * stack and keep lexing */ psqlscan_pop_buffer_stack(cur_state); psqlscan_select_top_buffer(cur_state); } YY_BREAK case 86: YY_RULE_SETUP #line 1000 "utils/psqlscan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 2252 "utils/psqlscan.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yyg->yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * psql_yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yyg->yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } else switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_END_OF_FILE: { yyg->yy_did_buffer_switch_on_eof = 0; if ( psql_yywrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of psql_yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = yyg->yytext_ptr; register int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; else { 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) (yyg->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. */ psql_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } if ( yyg->yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; psql_yyrestart(yyin ,yyscanner); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) psql_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } yyg->yy_n_chars += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { register yy_state_type yy_current_state; register char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 210 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 210 ) 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 == 209); (void)yyg; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; else { /* need more input */ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ psql_yyrestart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( psql_yywrap(yyscanner ) ) return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(yyscanner); #else return input(yyscanner); #endif } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; break; } } } c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ void psql_yyrestart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ psql_yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = psql_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } psql_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); psql_yy_load_buffer_state(yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ void psql_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * psql_yypop_buffer_state(); * psql_yypush_buffer_state(new_buffer); */ psql_yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; psql_yy_load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during * EOF (psql_yywrap()) processing, but the only time this flag * is looked at is after psql_yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } static void psql_yy_load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */ YY_BUFFER_STATE psql_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) psql_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in psql_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 *) psql_yyalloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in psql_yy_create_buffer()" ); b->yy_is_our_buffer = 1; psql_yy_init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with psql_yy_create_buffer() * @param yyscanner The scanner object. */ void psql_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) psql_yyfree((void *) b->yy_ch_buf ,yyscanner ); psql_yyfree((void *) b ,yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a psql_yyrestart() or at EOF. */ static void psql_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; psql_yy_flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then psql_yy_init_buffer was _probably_ * called from psql_yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ void psql_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) psql_yy_load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param yyscanner The scanner object. */ void psql_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; psql_yyensure_buffer_stack(yyscanner); /* This block is copied from psql_yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from psql_yy_switch_to_buffer. */ psql_yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. */ void psql_yypop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; psql_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { psql_yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void psql_yyensure_buffer_stack (yyscan_t yyscanner) { yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; yyg->yy_buffer_stack = (struct yy_buffer_state**)psql_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in psql_yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; } if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)psql_yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in psql_yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE psql_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) psql_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in psql_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; psql_yy_switch_to_buffer(b ,yyscanner ); return b; } /** Setup the input buffer state to scan a string. The next call to psql_yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * psql_yy_scan_bytes() instead. */ YY_BUFFER_STATE psql_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) { return psql_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to psql_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. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE psql_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) psql_yyalloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in psql_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 = psql_yy_scan_buffer(buf,n ,yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in psql_yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ *yyg->yy_c_buf_p = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ YY_EXTRA_TYPE psql_yyget_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } /** Get the current line number. * @param yyscanner The scanner object. */ int psql_yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ int psql_yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ FILE *psql_yyget_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ FILE *psql_yyget_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ yy_size_t psql_yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ char *psql_yyget_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ void psql_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /** Set the current line number. * @param line_number * @param yyscanner The scanner object. */ void psql_yyset_lineno (int line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "psql_yyset_lineno called with no buffer" ); yylineno = line_number; } /** Set the current column. * @param line_number * @param yyscanner The scanner object. */ void psql_yyset_column (int column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "psql_yyset_column called with no buffer" ); yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * @param yyscanner The scanner object. * @see psql_yy_switch_to_buffer */ void psql_yyset_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = in_str ; } void psql_yyset_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = out_str ; } int psql_yyget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } void psql_yyset_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flex_debug = bdebug ; } /* Accessor methods for yylval and yylloc */ YYSTYPE * psql_yyget_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } void psql_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } /* User-visible API */ /* psql_yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ int psql_yylex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) psql_yyalloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); return yy_init_globals ( *ptr_yy_globals ); } /* psql_yylex_init_extra has the same functionality as psql_yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to psql_yyalloc in * the yyextra field. */ int psql_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; psql_yyset_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) psql_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); psql_yyset_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from psql_yylex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * psql_yylex_init() */ return 0; } /* psql_yylex_destroy is for both reentrant and non-reentrant scanners. */ int psql_yylex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ psql_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; psql_yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ psql_yyfree(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ psql_yyfree(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * psql_yylex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ psql_yyfree ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *psql_yyalloc (yy_size_t size , yyscan_t yyscanner) { return (void *) malloc( size ); } void *psql_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { /* 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 psql_yyfree (void * ptr , yyscan_t yyscanner) { free( (char *) ptr ); /* see psql_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 1000 "utils/psqlscan.l" /* LCOV_EXCL_STOP */ /* * Create a lexer working state struct. * * callbacks is a struct of function pointers that encapsulate some * behavior we need from the surrounding program. This struct must * remain valid for the lifespan of the PsqlScanState. */ PsqlScanState psql_scan_create(const PsqlScanCallbacks *callbacks) { PsqlScanState state; state = (PsqlScanStateData *) pg_malloc0(sizeof(PsqlScanStateData)); state->callbacks = callbacks; psql_yylex_init(&state->scanner); psql_yyset_extra(state,state->scanner); psql_scan_reset(state); return state; } /* * Destroy a lexer working state struct, releasing all resources. */ void psql_scan_destroy(PsqlScanState state) { psql_scan_finish(state); psql_scan_reset(state); psql_yylex_destroy(state->scanner); pfree(state); } /* * Set the callback passthrough pointer for the lexer. * * This could have been integrated into psql_scan_create, but keeping it * separate allows the application to change the pointer later, which might * be useful. */ void psql_scan_set_passthrough(PsqlScanState state, void *passthrough) { state->cb_passthrough = passthrough; } /* * Set up to perform lexing of the given input line. * * The text at *line, extending for line_len bytes, will be scanned by * subsequent calls to the psql_scan routines. psql_scan_finish should * be called when scanning is complete. Note that the lexer retains * a pointer to the storage at *line --- this string must not be altered * or freed until after psql_scan_finish is called. * * encoding is the libpq identifier for the character encoding in use, * and std_strings says whether standard_conforming_strings is on. */ void psql_scan_setup(PsqlScanState state, const char *line, int line_len, int encoding, bool std_strings) { /* Mustn't be scanning already */ Assert(state->scanbufhandle == NULL); Assert(state->buffer_stack == NULL); /* Do we need to hack the character set encoding? */ state->encoding = encoding; state->safe_encoding = pg_valid_server_encoding_id(encoding); /* Save standard-strings flag as well */ state->std_strings = std_strings; /* Set up flex input buffer with appropriate translation and padding */ state->scanbufhandle = psqlscan_prepare_buffer(state, line, line_len, &state->scanbuf); state->scanline = line; /* Set lookaside data in case we have to map unsafe encoding */ state->curline = state->scanbuf; state->refline = state->scanline; } /* * Do lexical analysis of SQL command text. * * The text previously passed to psql_scan_setup is scanned, and appended * (possibly with transformation) to query_buf. * * The return value indicates the condition that stopped scanning: * * PSCAN_SEMICOLON: found a command-ending semicolon. (The semicolon is * transferred to query_buf.) The command accumulated in query_buf should * be executed, then clear query_buf and call again to scan the remainder * of the line. * * PSCAN_BACKSLASH: found a backslash that starts a special command. * Any previous data on the line has been transferred to query_buf. * The caller will typically next apply a separate flex lexer to scan * the special command. * * PSCAN_INCOMPLETE: the end of the line was reached, but we have an * incomplete SQL command. *prompt is set to the appropriate prompt type. * * PSCAN_EOL: the end of the line was reached, and there is no lexical * reason to consider the command incomplete. The caller may or may not * choose to send it. *prompt is set to the appropriate prompt type if * the caller chooses to collect more input. * * In the PSCAN_INCOMPLETE and PSCAN_EOL cases, psql_scan_finish() should * be called next, then the cycle may be repeated with a fresh input line. * * In all cases, *prompt is set to an appropriate prompt type code for the * next line-input operation. */ PsqlScanResult psql_scan(PsqlScanState state, PQExpBuffer query_buf, promptStatus_t *prompt) { PsqlScanResult result; int lexresult; /* Must be scanning already */ Assert(state->scanbufhandle != NULL); /* Set current output target */ state->output_buf = query_buf; /* Set input source */ if (state->buffer_stack != NULL) psql_yy_switch_to_buffer(state->buffer_stack->buf,state->scanner); else psql_yy_switch_to_buffer(state->scanbufhandle,state->scanner); /* And lex. */ lexresult = psql_yylex(NULL,state->scanner); /* * Check termination state and return appropriate result info. */ switch (lexresult) { case LEXRES_EOL: /* end of input */ switch (state->start_state) { case INITIAL: case xqs: /* we treat this like INITIAL */ if (state->paren_depth > 0) { result = PSCAN_INCOMPLETE; *prompt = PROMPT_PAREN; } else if (state->begin_depth > 0) { result = PSCAN_INCOMPLETE; *prompt = PROMPT_CONTINUE; } else if (query_buf->len > 0) { result = PSCAN_EOL; *prompt = PROMPT_CONTINUE; } else { /* never bother to send an empty buffer */ result = PSCAN_INCOMPLETE; *prompt = PROMPT_READY; } break; case xb: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xc: result = PSCAN_INCOMPLETE; *prompt = PROMPT_COMMENT; break; case xd: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOUBLEQUOTE; break; case xh: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xe: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xq: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xdolq: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOLLARQUOTE; break; case xui: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOUBLEQUOTE; break; case xus: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; default: /* can't get here */ fprintf(stderr, "invalid YY_START\n"); exit(1); } break; case LEXRES_SEMI: /* semicolon */ result = PSCAN_SEMICOLON; *prompt = PROMPT_READY; break; case LEXRES_BACKSLASH: /* backslash */ result = PSCAN_BACKSLASH; *prompt = PROMPT_READY; break; default: /* can't get here */ fprintf(stderr, "invalid psql_yylex result\n"); exit(1); } return result; } /* * Clean up after scanning a string. This flushes any unread input and * releases resources (but not the PsqlScanState itself). Note however * that this does not reset the lexer scan state; that can be done by * psql_scan_reset(), which is an orthogonal operation. * * It is legal to call this when not scanning anything (makes it easier * to deal with error recovery). */ void psql_scan_finish(PsqlScanState state) { /* Drop any incomplete variable expansions. */ while (state->buffer_stack != NULL) psqlscan_pop_buffer_stack(state); /* Done with the outer scan buffer, too */ if (state->scanbufhandle) psql_yy_delete_buffer(state->scanbufhandle,state->scanner); state->scanbufhandle = NULL; if (state->scanbuf) pfree(state->scanbuf); state->scanbuf = NULL; } /* * Reset lexer scanning state to start conditions. This is appropriate * for executing \r psql commands (or any other time that we discard the * prior contents of query_buf). It is not, however, necessary to do this * when we execute and clear the buffer after getting a PSCAN_SEMICOLON or * PSCAN_EOL scan result, because the scan state must be INITIAL when those * conditions are returned. * * Note that this is unrelated to flushing unread input; that task is * done by psql_scan_finish(). */ void psql_scan_reset(PsqlScanState state) { state->start_state = INITIAL; state->paren_depth = 0; state->xcdepth = 0; /* not really necessary */ if (state->dolqstart) pfree(state->dolqstart); state->dolqstart = NULL; state->identifier_count = 0; state->begin_depth = 0; } /* * Reselect this lexer (psqlscan.l) after using another one. * * Currently and for foreseeable uses, it's sufficient to reset to INITIAL * state, because we'd never switch to another lexer in a different state. * However, we don't want to reset e.g. paren_depth, so this can't be * the same as psql_scan_reset(). * * Note: psql setjmp error recovery just calls psql_scan_reset(), so that * must be a superset of this. * * Note: it seems likely that other lexers could just assign INITIAL for * themselves, since that probably has the value zero in every flex-generated * lexer. But let's not assume that. */ void psql_scan_reselect_sql_lexer(PsqlScanState state) { state->start_state = INITIAL; } /* * Return true if lexer is currently in an "inside quotes" state. * * This is pretty grotty but is needed to preserve the old behavior * that mainloop.c drops blank lines not inside quotes without even * echoing them. */ bool psql_scan_in_quote(PsqlScanState state) { return state->start_state != INITIAL && state->start_state != xqs; } /* * Push the given string onto the stack of stuff to scan. * * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer. */ void psqlscan_push_new_buffer(PsqlScanState state, const char *newstr, const char *varname) { StackElem *stackelem; stackelem = (StackElem *) pg_malloc(sizeof(StackElem)); /* * In current usage, the passed varname points at the current flex input * buffer; we must copy it before calling psqlscan_prepare_buffer() * because that will change the buffer state. */ stackelem->varname = varname ? pg_strdup(varname) : NULL; stackelem->buf = psqlscan_prepare_buffer(state, newstr, strlen(newstr), &stackelem->bufstring); state->curline = stackelem->bufstring; if (state->safe_encoding) { stackelem->origstring = NULL; state->refline = stackelem->bufstring; } else { stackelem->origstring = pg_strdup(newstr); state->refline = stackelem->origstring; } stackelem->next = state->buffer_stack; state->buffer_stack = stackelem; } /* * Pop the topmost buffer stack item (there must be one!) * * NB: after this, the flex input state is unspecified; caller must * switch to an appropriate buffer to continue lexing. * See psqlscan_select_top_buffer(). */ void psqlscan_pop_buffer_stack(PsqlScanState state) { StackElem *stackelem = state->buffer_stack; state->buffer_stack = stackelem->next; psql_yy_delete_buffer(stackelem->buf,state->scanner); pfree(stackelem->bufstring); if (stackelem->origstring) pfree(stackelem->origstring); if (stackelem->varname) pfree(stackelem->varname); pfree(stackelem); } /* * Select the topmost surviving buffer as the active input. */ void psqlscan_select_top_buffer(PsqlScanState state) { StackElem *stackelem = state->buffer_stack; if (stackelem != NULL) { psql_yy_switch_to_buffer(stackelem->buf,state->scanner); state->curline = stackelem->bufstring; state->refline = stackelem->origstring ? stackelem->origstring : stackelem->bufstring; } else { psql_yy_switch_to_buffer(state->scanbufhandle,state->scanner); state->curline = state->scanbuf; state->refline = state->scanline; } } /* * Check if specified variable name is the source for any string * currently being scanned */ bool psqlscan_var_is_current_source(PsqlScanState state, const char *varname) { StackElem *stackelem; for (stackelem = state->buffer_stack; stackelem != NULL; stackelem = stackelem->next) { if (stackelem->varname && strcmp(stackelem->varname, varname) == 0) return true; } return false; } /* * Set up a flex input buffer to scan the given data. We always make a * copy of the data. If working in an unsafe encoding, the copy has * multibyte sequences replaced by FFs to avoid fooling the lexer rules. * * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer. */ YY_BUFFER_STATE psqlscan_prepare_buffer(PsqlScanState state, const char *txt, int len, char **txtcopy) { char *newtxt; /* Flex wants two \0 characters after the actual data */ newtxt = pg_malloc(len + 2); *txtcopy = newtxt; newtxt[len] = newtxt[len + 1] = YY_END_OF_BUFFER_CHAR; if (state->safe_encoding) memcpy(newtxt, txt, len); else { /* Gotta do it the hard way */ int i = 0; while (i < len) { int thislen = PQmblen(txt + i, state->encoding); /* first byte should always be okay... */ newtxt[i] = txt[i]; i++; while (--thislen > 0 && i < len) newtxt[i++] = (char) 0xFF; } } return psql_yy_scan_buffer(newtxt,len + 2,state->scanner); } /* * psqlscan_emit() --- body for ECHO macro * * NB: this must be used for ALL and ONLY the text copied from the flex * input data. If you pass it something that is not part of the yytext * string, you are making a mistake. Internally generated text can be * appended directly to state->output_buf. */ void psqlscan_emit(PsqlScanState state, const char *txt, int len) { PQExpBuffer output_buf = state->output_buf; if (state->safe_encoding) appendBinaryPQExpBuffer(output_buf, txt, len); else { /* Gotta do it the hard way */ const char *reference = state->refline; int i; reference += (txt - state->curline); for (i = 0; i < len; i++) { char ch = txt[i]; if (ch == (char) 0xFF) ch = reference[i]; appendPQExpBufferChar(output_buf, ch); } } } /* * psqlscan_extract_substring --- fetch value of (part of) the current token * * This is like psqlscan_emit(), except that the data is returned as a * malloc'd string rather than being pushed directly to state->output_buf. */ char * psqlscan_extract_substring(PsqlScanState state, const char *txt, int len) { char *result = (char *) pg_malloc(len + 1); if (state->safe_encoding) memcpy(result, txt, len); else { /* Gotta do it the hard way */ const char *reference = state->refline; int i; reference += (txt - state->curline); for (i = 0; i < len; i++) { char ch = txt[i]; if (ch == (char) 0xFF) ch = reference[i]; result[i] = ch; } } result[len] = '\0'; return result; } /* * psqlscan_escape_variable --- process :'VARIABLE' or :"VARIABLE" * * If the variable name is found, escape its value using the appropriate * quoting method and emit the value to output_buf. (Since the result is * surely quoted, there is never any reason to rescan it.) If we don't * find the variable or escaping fails, emit the token as-is. */ void psqlscan_escape_variable(PsqlScanState state, const char *txt, int len, PsqlScanQuoteType quote) { char *varname; char *value; /* Variable lookup. */ varname = psqlscan_extract_substring(state, txt + 2, len - 3); if (state->callbacks->get_variable) value = state->callbacks->get_variable(varname, quote, state->cb_passthrough); else value = NULL; pfree(varname); if (value) { /* Emit the suitably-escaped value */ appendPQExpBufferStr(state->output_buf, value); pfree(value); } else { /* Emit original token as-is */ psqlscan_emit(state, txt, len); } } void psqlscan_test_variable(PsqlScanState state, const char *txt, int len) { char *varname; char *value; varname = psqlscan_extract_substring(state, txt + 3, len - 4); if (state->callbacks->get_variable) value = state->callbacks->get_variable(varname, PQUOTE_PLAIN, state->cb_passthrough); else value = NULL; pfree(varname); if (value != NULL) { psqlscan_emit(state, "TRUE", 4); pfree(value); } else { psqlscan_emit(state, "FALSE", 5); } } /* * "Safe" wrapper around strdup() using palloc(). * For pgpool backend. */ static char * pg_strdup(const char *in) { char *tmp; if (!in) { ereport(ERROR, (errmsg("cannot duplicate null pointer (internal error)"))); } tmp = pstrdup(in); if (!tmp) { ereport(ERROR, (errmsg("out of memory"))); } return tmp; } #undef pg_log_warning #undef pg_malloc #undef pg_malloc0 pgpool-II-4.6.0/src/utils/pool_select_walker.c0000664000175000017500000012077214760007565016236 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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" #include "protocol/pool_pg_utils.h" /* * Possible argument (property) values for function_volatile_property */ typedef enum { FUNC_VOLATILE, FUNC_STABLE, FUNC_IMMUTABLE } FUNC_VOLATILE_PROPERTY; 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 row_security_enabled(char *table_name); static bool row_security_enabled_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); static bool function_volatile_property(char *fname, FUNC_VOLATILE_PROPERTY property); static bool function_has_return_type(char *fname, char *typename); /* * Return true if this SELECT has function calls *and* supposed to * modify database. We check write/read_only function list to determine * whether the function modifies database. * If node is PrepareStmt, we look into PrepareStmt->query instead. */ bool pool_has_function_call(Node *node) { SelectContext ctx; if (IsA(node, PrepareStmt)) { PrepareStmt *prepare_statement = (PrepareStmt *) node; node = (Node *) (prepare_statement->query); } 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 a row security enabled table. */ bool pool_has_row_security(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.row_security = false; raw_expression_tree_walker(node, row_security_enabled_walker, &ctx); return ctx.row_security; } /* * 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 readonlylist or writelist 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: READONLYLIST and WRITELIST */ 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, "read_only_function_list") == 0 || strcmp(param_name, "write_function_list") == 0) { lists_patterns = pool_config->lists_patterns; pattc = &pool_config->pattc; } else if (strcmp(param_name, "cache_safe_memqcache_table_list") == 0 || strcmp(param_name, "cache_unsafe_memqcache_table_list") == 0) { lists_patterns = pool_config->lists_memqcache_table_patterns; pattc = &pool_config->memqcache_table_pattc; } else if (strcmp(param_name, "primary_routing_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 readonly list pattern */ case READONLYLIST: ereport(DEBUG2, (errmsg("comparing function name in readonly list regex array"), errdetail("pattern_compare: %s (%s) matched: %s", param_name, lists_patterns[i].pattern, s))); result = 1; break; /* return 1 if string matches writelist pattern */ case WRITELIST: ereport(DEBUG2, (errmsg("comparing function name in writelist 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 write/readonly list 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) { fname = make_function_name_from_funccall(fcall); ereport(DEBUG1, (errmsg("function call walker, function name: \"%s\"", fname))); check_object_relationship_list(strVal(llast(fcall->funcname)), true); if (ctx->pg_terminate_backend_pid == 0 && strcmp("pg_terminate_backend", strVal(llast(fcall->funcname))) == 0) { /* PostgreSQL 14 or after accept two arguments. */ if (list_length(fcall->args) == 1 || list_length(fcall->args) == 2) { Node *arg = linitial(fcall->args); if (IsA(arg, A_Const) && IsA(&((A_Const *) arg)->val, Integer)) { ctx->pg_terminate_backend_pid = ((A_Const *) arg)->val.ival.ival; ereport(DEBUG1, (errmsg("pg_terminate_backend pid = %d", ctx->pg_terminate_backend_pid))); } } } /* * If both read_only_function_list and write_function_list is empty, * check volatile property of the function in the system catalog. */ if (pool_config->num_read_only_function_list == 0 && pool_config->num_write_function_list == 0) { if (function_volatile_property(fname, FUNC_VOLATILE)) { ctx->has_function_call = true; return false; } return raw_expression_tree_walker(node, function_call_walker, context); } /* * Check read_only list if any. */ if (pool_config->num_read_only_function_list > 0) { /* Search function in the read_only list regex patterns */ if (pattern_compare(fname, READONLYLIST, "read_only_function_list") == 1) { /* * If the function is found in the read_only list, we can * ignore it */ return raw_expression_tree_walker(node, function_call_walker, context); } /* * Since the function was not found in read_only list, we have * found a writing function. */ ctx->has_function_call = true; return false; } /* * Check write list if any. */ if (pool_config->num_write_function_list > 0) { /* Search function in the write list regex patterns */ if (pattern_compare(fname, WRITELIST, "write_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); } /* * Walker function to find a row security enabled table. */ static bool row_security_enabled_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("row secuirty walker. checking relation \"%s\"", relname))); if (row_security_enabled(relname)) { ctx->row_security = true; return false; } } return raw_expression_tree_walker(node, row_security_enabled_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_catalog.pg_class AS c, pg_catalog.pg_namespace AS n WHERE c.relname = '%s' AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'" #define ISBELONGTOPGCATALOGQUERY2 "SELECT count(*) FROM pg_catalog.pg_class AS c, pg_catalog.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_catalog.pg_class AS c, pg_catalog.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_catalog.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; } /* * Returns true if table_name enables row security. */ static bool row_security_enabled(char *table_name) { /* * Query to know if the target table enables row security. This is valid for * PostgreSQL 9.5 or later. Remember that to_regclass() is available in * PostgreSQL 9.4 or later and we can use to_regclass() unconditionally. */ #define ISROWSECURITYQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = pg_catalog.to_regclass('%s') AND c.relrowsecurity" static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; bool result; char *query; if (table_name == NULL) return false; backend = pool_get_session_context(false)->backend; /* * Check backend version. PostgreSQL 9.5 or later have relrowsecurity * column. */ if (Pgversion(backend)->major < 95) return false; query = ISROWSECURITYQUERY; 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 row security"))); 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 pg_catalog.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 = MAIN_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) { fname = make_function_name_from_funccall(fcall); 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; } /* check return type is timestamptz */ if (function_has_return_type(fname, "timestamptz")) { /* timestamptz should not be cached */ ctx->has_non_immutable_function_call = true; return false; } /* return type is timetz */ if (function_has_return_type(fname, "timetz")) { /* timetz should not be cached */ ctx->has_non_immutable_function_call = true; return false; } } } /* Check type cast */ else if (IsA(node, TypeCast)) { /* TIMESTAMP WITH TIME ZONE and TIME WITH TIME ZONE should not be cached. */ TypeCast *tc = (TypeCast *) node; if (isSystemType((Node *) tc->typeName, "timestamptz") || isSystemType((Node *) tc->typeName, "timetz")) { ctx->has_non_immutable_function_call = true; return false; } } else if (IsA(node, SQLValueFunction)) { /* * SQLValueFunctions (CURRENT_TIME, CURRENT_USER etc.) are regarded as * non immutable functions. */ 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) { return function_volatile_property(fname, FUNC_IMMUTABLE); } /* * Check volatile property of function specified by the name. * If the function property is match with "property" argument, returns true. * Note that "fname" can be schema qualified. */ static bool function_volatile_property(char *fname, FUNC_VOLATILE_PROPERTY property) { /* * Query to know if function's volatile property. */ #define VOLATILE_FUNCTION_QUERY "SELECT count(*) FROM pg_catalog.pg_proc AS p, pg_catalog.pg_namespace AS n WHERE p.proname = '%s' AND n.oid = p.pronamespace AND n.nspname %s '%s' AND p.provolatile = '%c'" bool result; char query[1024]; char *rawstring = NULL; List *names = NIL; POOL_CONNECTION_POOL *backend; static POOL_RELCACHE *relcache; char prop_volatile; /* We need a modifiable copy of the input string. */ rawstring = pstrdup(fname); /* split "schemaname.funcname" */ if(!SplitIdentifierString(rawstring, '.', (Node **) &names) || names == NIL) { pfree(rawstring); list_free(names); ereport(WARNING, (errmsg("invalid function name %s", fname))); return false; } /* * Get volatile property character. */ switch (property) { case FUNC_STABLE: prop_volatile = 's'; break; case FUNC_IMMUTABLE: prop_volatile = 'i'; break; default: prop_volatile = 'v'; break; } /* with schema qualification */ if(list_length(names) == 2) { snprintf(query, sizeof(query), VOLATILE_FUNCTION_QUERY, (char *) llast(names), "=", (char *) linitial(names), prop_volatile); } else { snprintf(query, sizeof(query), VOLATILE_FUNCTION_QUERY, (char *) llast(names), "~", ".*", prop_volatile); } backend = pool_get_session_context(false)->backend; if (!relcache) { /* * We pass "%s" as a template query so that pool_search_relcache * passes whole query. */ relcache = pool_create_relcache(pool_config->relcache_size, "%s", int_register_func, int_unregister_func, false); if (relcache == NULL) { pfree(rawstring); list_free(names); ereport(WARNING, (errmsg("unable to create relcache, while checking the function volatile property"))); return false; } ereport(DEBUG1, (errmsg("checking the function volatile property"), errdetail("relcache created"))); } /* * We pass whole query as "table" parameter of pool_search_relcache so * that each relcache entry is distinguished by actual query string. */ result = (pool_search_relcache(relcache, backend, query) == 0) ? 0 : 1; pfree(rawstring); list_free(names); ereport(DEBUG1, (errmsg("checking the function volatile property"), errdetail("search result = %d (%c)", result, prop_volatile))); 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_catalog.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, 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 function name from FuncCall. Make schema qualification name if * necessary. The returned function name is in static area. So next * call to this function will break previous result. */ char * make_function_name_from_funccall(FuncCall *fcall) { /* * Function name. Max size is calculated as follows: schema * name(NAMEDATALEN byte) + quotation marks for schema name(2 byte) + * period(1 byte) + table name (NAMEDATALEN byte) + quotation marks * for table name(2 byte) + NULL(1 byte) */ static char funcname[NAMEDATALEN * 2 + 1 + 2 * 2 + 1]; List *names; if(fcall == NULL) { ereport(WARNING, (errmsg("FuncCall argument is NULL, while getting function name from FuncCall"))); return ""; } *funcname = '\0'; names = fcall->funcname; switch (list_length(names)) { case 1: strcat(funcname, "\""); strncat(funcname, strVal(linitial(names)), NAMEDATALEN); strcat(funcname, "\""); break; case 2: strcat(funcname, "\""); strncat(funcname, strVal(linitial(names)), NAMEDATALEN); strcat(funcname, "\""); strcat(funcname, "."); strcat(funcname, "\""); strncat(funcname, strVal(lsecond(names)), NAMEDATALEN); strcat(funcname, "\""); break; case 3: strcat(funcname, "\""); strncat(funcname, strVal(lsecond(names)), NAMEDATALEN); strcat(funcname, "\""); strcat(funcname, "."); strcat(funcname, "\""); strncat(funcname, strVal(lthird(names)), NAMEDATALEN); strcat(funcname, "\""); break; default: ereport(WARNING, (errmsg("invalid function name, too many indirections, while getting function name from FuncCall"))); break; } ereport(DEBUG1, (errmsg("make function name from funccall: funcname:\"%s\"", funcname))); return funcname; } /* * 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(NAMEDATALEN byte) + quotation marks for schema name(2 byte) + * period(1 byte) + table name (NAMEDATALEN byte) + quotation marks * for table name(2 byte) + NULL(1 byte) */ static char tablename[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, 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, NAMEDATALEN); strcat(tablename, "\""); ereport(DEBUG1, (errmsg("make table name from rangevar: tablename:\"%s\"", tablename))); return tablename; } /* * Return whether given function has the given type name. If one or more * functions match, return true. */ static bool function_has_return_type(char *fname, char *typename) { /* * Query to count the number of records matching given function name and type name. */ #define FUNCTION_RETURN_TYPE_MATCHEING_QUERY "SELECT count(*) FROM pg_catalog.pg_type AS t, pg_catalog.pg_proc AS p, pg_catalog.pg_namespace AS n WHERE p.proname = '%s' AND n.oid = p.pronamespace AND n.nspname %s '%s' AND p.prorettype = t.oid AND t.typname = '%s';" bool result; char query[1024]; char *rawstring = NULL; List *names = NIL; POOL_CONNECTION_POOL *backend; static POOL_RELCACHE *relcache; /* We need a modifiable copy of the input string. */ rawstring = pstrdup(fname); /* split "schemaname.funcname" */ if(!SplitIdentifierString(rawstring, '.', (Node **) &names) || names == NIL) { pfree(rawstring); list_free(names); ereport(WARNING, (errmsg("invalid function name %s", fname))); return false; } if (list_length(names) == 2) { /* with schema qualification */ snprintf(query, sizeof(query), FUNCTION_RETURN_TYPE_MATCHEING_QUERY, (char *) llast(names), "=", (char *) linitial(names), typename); } else { snprintf(query, sizeof(query), FUNCTION_RETURN_TYPE_MATCHEING_QUERY, (char *) llast(names), "~", ".*", typename); } backend = pool_get_session_context(false)->backend; if (!relcache) { /* * We pass "%s" as a template query so that pool_search_relcache * passes whole query. */ relcache = pool_create_relcache(pool_config->relcache_size, "%s", int_register_func, int_unregister_func, false); if (relcache == NULL) { pfree(rawstring); list_free(names); ereport(WARNING, (errmsg("unable to create relcache, while checking the function volatile property"))); return false; } ereport(DEBUG1, (errmsg("checking the function matches the given type name"), errdetail("relcache created"))); } /* * We pass whole query as "table" parameter of pool_search_relcache so * that each relcache entry is distinguished by actual query string. */ result = (pool_search_relcache(relcache, backend, query) == 0) ? 0 : 1; pfree(rawstring); list_free(names); ereport(DEBUG1, (errmsg("checking the function matches the given type name"), errdetail("search result = %d (function name: %s type name: %s)", result, fname, typename))); return result; } pgpool-II-4.6.0/src/utils/strlcpy.c0000664000175000017500000000466314760001620014043 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.6.0/src/utils/psprintf.c0000664000175000017500000001302214760001620014175 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 * *------------------------------------------------------------------------- */ #include #include #include "pool.h" #ifndef POOL_PRIVATE #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.6.0/src/utils/pool_params.c0000664000175000017500000000664214760001620014656 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. * * params.c: Parameter Status handling routines * */ #include "config.h" #include #include #include "utils/elog.h" #include "utils/pool_params.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.6.0/src/utils/ps_status.c0000664000175000017500000002447714760007565014413 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-2020 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 "utils/ps_status.h" #include "pool_type.h" #include #include extern char **environ; bool update_process_title = true; char remote_ps_data[NI_MAXHOST + NI_MAXSERV + 2]; /* used for set_ps_display */ /* * 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 = MAIN_CONNECTION(backend)->sp; if (MAIN(backend)->tstate == 'T') { snprintf(psbuf, sizeof(psbuf), "%s %s %s idle in transaction", sp->user, sp->database, remote_ps_data); set_process_status(IDLE_IN_TRANS); } else { snprintf(psbuf, sizeof(psbuf), "%s %s %s idle", sp->user, sp->database, remote_ps_data); set_process_status(IDLE); } set_ps_display(psbuf, false); } pgpool-II-4.6.0/src/utils/pool_shmem.c0000664000175000017500000001140014760001620014470 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2022, 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 #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* shared_mem_chunk = NULL; static char* shared_mem_free_pos = NULL; static size_t chunk_size = 0; static void IpcMemoryDetach(int status, Datum shmaddr); static void IpcMemoryDelete(int status, Datum shmId); void initialize_shared_memory_main_segment(size_t size) { /* only main process is allowed to create the chunk */ if (mypid != getpid()) { /* should never happen */ ereport(LOG, (errmsg("initialize_shared_memory_chunk called from invalid process"))); return; } if (shared_mem_chunk) return; ereport(LOG, (errmsg("allocating shared memory segment of size: %zu ",size))); shared_mem_chunk = pool_shared_memory_create(size); shared_mem_free_pos = (char*)shared_mem_chunk; chunk_size = size; memset(shared_mem_chunk, 0, size); } void * pool_shared_memory_segment_get_chunk(size_t size) { void *ptr = NULL; if (mypid != getpid()) { /* should never happen */ ereport(ERROR, (errmsg("initialize_shared_memory_chunk called from invalid process"))); return NULL; } /* check if we have enough space left in chunk */ if ((shared_mem_free_pos - (char*)shared_mem_chunk) + MAXALIGN(size) > chunk_size) { ereport(ERROR, (errmsg("no space left in shared memory segment"))); return NULL; } /* * return the current shared_mem_free_pos pointer * and advance it by size */ ptr = (void*)shared_mem_free_pos; shared_mem_free_pos += MAXALIGN(size); return ptr; } /* * 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: %zu", size), errdetail("shared memory creation failed with error \"%m\""))); /* 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: \"%m\"", shmid))); /* 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 space (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: %m", (void *) shmaddr))); } /* * 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 with error \"%m\"", shmId, IPC_RMID))); } 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.6.0/src/utils/pool_sema.c0000664000175000017500000001111414760001620014306 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 with error \"%m\"", semId))); } /* * 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", numSems), errdetail("%m"))); 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:\"%m\"", numSems), 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"), errdetail("%m"))); } /* * 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"), errdetail("%m"))); 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"), errdetail("%m"))); } pgpool-II-4.6.0/src/utils/pool_signal.c0000664000175000017500000001132314760007565014656 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2020, 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 = 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, committing suicide. */ 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.6.0/src/utils/pool_path.c0000664000175000017500000001705114760001620014323 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.6.0/src/utils/pool_ip.c0000664000175000017500000003570314760001620014003 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.6.0/src/utils/pool_relcache.c0000664000175000017500000004050014760007565015146 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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 #include #include "pool.h" #include "utils/pool_relcache.h" #include "context/pool_session_context.h" #include "query_cache/pool_memqcache.h" #include "protocol/pool_process_query.h" #include "pool_config.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "parser/scansup.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[MAX_QUERY_LENGTH]; 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_LOAD_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 = MAIN_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 = MAIN_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(POOL_MEMQ_SHARED_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); /* * So far, we have already obtained a lock. But to register * a query cache entry, we need to acquire an exclusive lock. * Unfortunately: * (1) we don't know if we already acquired an exclusive or not. * (2) we cannot escalate a shared lock to an exclusive lock. * So we release the lock and obtain an exclusive lock. This may * create a window and thus we might try to register duplicate * query cache entry if other process is trying to register the same entry * in the window. But it should be harmless. */ pool_shmem_unlock(); pool_shmem_lock(POOL_MEMQ_EXCLUSIVE_LOCK); 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 occurred"))); } 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"); } /* * SplitIdentifierString --- parse a string containing identifiers * * This is the guts of textToQualifiedNameList, and is exported for use in * other situations such as parsing GUC variables. In the GUC case, it's * important to avoid memory leaks, so the API is designed to minimize the * amount of stuff that needs to be allocated and freed. * * Inputs: * rawstring: the input string; must be overwritable! On return, it's * been modified to contain the separated identifiers. * separator: the separator punctuation expected between identifiers * (typically '.' or ','). Whitespace may also appear around * identifiers. * Outputs: * namelist: filled with a palloc'd list of pointers to identifiers within * rawstring. Caller should list_free() this even on error return. * * Returns true if okay, false if there is a syntax error in the string. * * Note that an empty string is considered okay here, though not in * textToQualifiedNameList. */ bool SplitIdentifierString(char *rawstring, char separator, Node **nlist) { char *nextp = rawstring; bool done = false; List **namelist = (List **) nlist; *namelist = NIL; while (scanner_isspace(*nextp)) nextp++; /* skip leading whitespace */ if (*nextp == '\0') return true; /* allow empty string */ /* At the top of the loop, we are at start of a new identifier. */ do { char *curname; char *endp; if (*nextp == '"') { /* Quoted name --- collapse quote-quote pairs, no downcasing */ curname = nextp + 1; for (;;) { endp = strchr(nextp + 1, '"'); if (endp == NULL) return false; /* mismatched quotes */ if (endp[1] != '"') break; /* found end of quoted name */ /* Collapse adjacent quotes into one quote, and look again */ memmove(endp, endp + 1, strlen(endp)); nextp = endp; } /* endp now points at the terminating quote */ nextp = endp + 1; } else { /* Unquoted name --- extends to separator or whitespace */ char *downname; int len; curname = nextp; while (*nextp && *nextp != separator && !scanner_isspace(*nextp)) nextp++; endp = nextp; if (curname == nextp) return false; /* empty unquoted name not allowed */ /* * Downcase the identifier, using same code as main lexer does. * * XXX because we want to overwrite the input in-place, we cannot * support a downcasing transformation that increases the string * length. This is not a problem given the current implementation * of downcase_truncate_identifier, but we'll probably have to do * something about this someday. */ len = endp - curname; downname = downcase_truncate_identifier(curname, len, false); Assert(strlen(downname) <= len); strncpy(curname, downname, len); /* strncpy is required here */ pfree(downname); } while (scanner_isspace(*nextp)) nextp++; /* skip trailing whitespace */ if (*nextp == separator) { nextp++; while (scanner_isspace(*nextp)) nextp++; /* skip leading whitespace for next */ /* we expect another name, so done remains false */ } else if (*nextp == '\0') done = true; else return false; /* invalid syntax */ /* Now safe to overwrite separator with a null */ *endp = '\0'; /* Truncate name if it's overlength */ truncate_identifier(curname, strlen(curname), false); /* * Finished isolating current name --- add it to list */ *namelist = lappend(*namelist, curname); /* Loop back if we didn't reach end of string */ } while (!done); return true; } char * remove_quotes_and_schema_from_relname(char *table) { static char rel[MAX_ITEM_LENGTH]; char *rawstring; List *names; rawstring = pstrdup(table); if(SplitIdentifierString(rawstring, '.', (Node **) &names) && names != NIL) { /* * Since table name is always the last one in the list, * we use llast() to get table name. */ strlcpy(rel, llast(names), sizeof(rel)); } else { rel[0] = '\0'; } pfree(rawstring); list_free(names); 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.6.0/src/utils/pool_process_reporting.c0000664000175000017500000026547514760007565017173 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2024 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 "main/health_check.h" #include "protocol/pool_proto_modules.h" #include "protocol/pool_process_query.h" #include "utils/elog.h" #include "utils/pool_stream.h" #include "utils/statistics.h" #include "pool_config.h" #include "query_cache/pool_memqcache.h" #include "version.h" #include "protocol/pool_pg_utils.h" #include #include #include #include static void send_row_description_and_data_rows(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short num_fields, char **field_names, int *offsettbl, char *data, int row_size, int nrows); static void write_one_field(POOL_CONNECTION * frontend, char *field); static void write_one_field_v2(POOL_CONNECTION * frontend, char *field); static char *db_node_status(int node); static char *db_node_role(int node); 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; /* CLUSTERING MODE */ StrNCpy(status[i].name, "backend_clustering_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->backend_clustering_mode); StrNCpy(status[i].desc, "clustering mode", POOLCONFIG_MAXDESCLEN); i++; /* CONNECTIONS */ /* - pgpool Connection Settings - */ StrNCpy(status[i].name, "listen_addresses", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_listen_addresses; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->listen_addresses[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_listen_addresses - 1) strncat(status[i].value, ",", len); } 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++; StrNCpy(status[i].name, "unix_socket_directories", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_unix_socket_directories; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->unix_socket_directories[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_unix_socket_directories - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "pgpool socket directories", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "unix_socket_group", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->unix_socket_group); StrNCpy(status[i].desc, "owning user of the unix sockets", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "unix_socket_permissions", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%04o", pool_config->unix_socket_permissions); StrNCpy(status[i].desc, "access permissions of the unix sockets.", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "pcp_listen_addresses", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_pcp_listen_addresses; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->pcp_listen_addresses[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_pcp_listen_addresses - 1) strncat(status[i].value, ",", len); } 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); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_pcp_socket_directories; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->pcp_socket_dir[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_pcp_socket_directories - 1) strncat(status[i].value, ",", len); } 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, "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, "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, "single PEM format file containing CA root certificate(s)", 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_crl_file", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_crl_file); StrNCpy(status[i].desc, "SSL certificate revocation list file", 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++; StrNCpy(status[i].name, "ssl_passphrase_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_passphrase_command); StrNCpy(status[i].desc, "external command to be invoked when a passphrase for decrypting an SSL file such as a private key needs to be obtained", POOLCONFIG_MAXDESCLEN); i++; /* POOLS */ /* - Pool size - */ 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++; StrNCpy(status[i].name, "process_management_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->process_management); StrNCpy(status[i].desc, "process management mode", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "process_management_strategy", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->process_management_strategy); StrNCpy(status[i].desc, "process management strategy", POOLCONFIG_MAXDESCLEN); i++; 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, "min_spare_children", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->min_spare_children); StrNCpy(status[i].desc, "min # of spare children waitting for connection", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "max_spare_children", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->max_spare_children); StrNCpy(status[i].desc, "max # of spare children waitting for connection", 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_disconnections", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_disconnections); StrNCpy(status[i].desc, "if true, print closing connections to the log", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_pcp_processes", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_pcp_processes); StrNCpy(status[i].desc, "if true, print PCP process forks and a normal exit status 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, "notice_per_node_statement", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->notice_per_node_statement); StrNCpy(status[i].desc, "if non 0, logs all SQL statements on each node as notice message", 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_backend_messages", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_backend_messages); StrNCpy(status[i].desc, "if non 0, logs any backend 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 facility", 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, "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, "read_only_function_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_read_only_function_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->read_only_function_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_read_only_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, "write_function_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_write_function_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->write_function_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_write_function_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "functions those write to database", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "primary_routing_query_pattern_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_primary_routing_query_pattern_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->primary_routing_query_pattern_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_primary_routing_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, "dml_adaptive_object_relationship_list", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->dml_adaptive_object_relationship_list); StrNCpy(status[i].desc, "list of relationships between objects", 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++; /* - 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++; StrNCpy(status[i].name, "delay_threshold_by_time", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->delay_threshold_by_time); StrNCpy(status[i].desc, "standby delay threshold by time", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "prefer_lower_delay_standby", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->prefer_lower_delay_standby); StrNCpy(status[i].desc, "load balancing considering streaming delay", POOLCONFIG_MAXDESCLEN); i++; /* - Special commands - */ StrNCpy(status[i].name, "follow_primary_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->follow_primary_command); StrNCpy(status[i].desc, "follow primary command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "user_redirect_preference_list", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->user_redirect_preference_list); StrNCpy(status[i].desc, "redirect by user name", 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, "failover_on_backend_shutdown", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->failover_on_backend_shutdown); StrNCpy(status[i].desc, "failover on backend shutdown", 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 stage", 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 leader 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, "trusted_server_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->trusted_server_command); StrNCpy(status[i].desc, "command executed when upper servers are observed", 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 leader pgpool", 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 REQUEST to neighbour host", 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 signal (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 signal (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++; #ifdef NOT_USED /* for security reason */ 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++; #endif for (j = 0; j < MAX_WATCHDOG_NUM; j++) { if (WD_INFO(j).pgpool_port == 0) continue; if (j == pool_config->pgpool_node_id) { snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", WD_INFO(j).hostname); StrNCpy(status[i].desc, "hostname or IP address of local pgpool node", POOLCONFIG_MAXDESCLEN); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "pgpool_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).pgpool_port); StrNCpy(status[i].desc, "local pgpool port number", POOLCONFIG_MAXDESCLEN); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "wd_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).wd_port); StrNCpy(status[i].desc, "local watchdog port number", POOLCONFIG_MAXDESCLEN); i++; } else { snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", WD_INFO(j).hostname); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "hostname or IP address of pgpool node #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "pgpool_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).pgpool_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "pgpool port number of pgpool node #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "wd_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).wd_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "watchdog port number of pgpool node #%d", j); i++; } } for (j = 0; j < MAX_WATCHDOG_NUM; j++) { if (pool_config->hb_ifs[j].dest_port == 0) continue; if (j == pool_config->pgpool_node_id) { snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->hb_ifs[j].addr); StrNCpy(status[i].desc, "IP address or hostname for receiving heartbeat", POOLCONFIG_MAXDESCLEN); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_device%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->hb_ifs[j].if_name); StrNCpy(status[i].desc, "name of NIC device for receiving hearbeat", POOLCONFIG_MAXDESCLEN); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->hb_ifs[j].dest_port); StrNCpy(status[i].desc, "port number for receiving heartbeat", POOLCONFIG_MAXDESCLEN); i++; } else { snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->hb_ifs[j].addr); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "destination IP address or hostname for sending heartbeat to pgpool node #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_device%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->hb_ifs[j].if_name); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "name of NIC device for sending hearbeat to pgpool node #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->hb_ifs[j].dest_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "destination port for sending heartbeat to pgpool node #%d", j); 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. Mandatory 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, "Temporary 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, "cache_safe_memqcache_table_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_cache_safe_memqcache_table_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->cache_safe_memqcache_table_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_cache_safe_memqcache_table_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "tables to memqcache", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "cache_unsafe_memqcache_table_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_cache_unsafe_memqcache_table_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->cache_unsafe_memqcache_table_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_cache_unsafe_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++; } *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 * If node_id is -1, get all node info. */ POOL_REPORT_NODES * get_nodes(int *nrows, int node_id) { 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(true); struct tm tm; for (i = 0; i < NUM_BACKENDS; i++) { if (node_id != -1 && node_id != i) continue; bi = pool_get_node_info(i); snprintf(nodes[i].node_id, POOLCONFIG_MAXIDLEN, "%d", i); StrNCpy(nodes[i].hostname, bi->backend_hostname, MAX_DB_HOST_NAMELEN); 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)); if (session_context) snprintf(nodes[i].load_balance_node, POOLCONFIG_MAXWEIGHTLEN, "%s", (session_context->load_balance_node_id == i) ? "true" : "false"); else snprintf(nodes[i].load_balance_node, POOLCONFIG_MAXWEIGHTLEN, "%s", "false"); snprintf(nodes[i].delay, POOLCONFIG_MAXWEIGHTLEN, "%d", 0); snprintf(nodes[i].pg_status, POOLCONFIG_MAXSTATLEN, "%s", db_node_status(i)); 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"); if (bi->standby_delay_by_time) { snprintf(nodes[i].delay, POOLCONFIG_MAXWEIGHTLEN, "%.6f", ((float)bi->standby_delay)/1000000); if (bi->standby_delay >= 2*1000*1000) strcat(nodes[i].delay, " seconds"); else strcat(nodes[i].delay, " second"); } else snprintf(nodes[i].delay, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, bi->standby_delay); } if (!strcmp(nodes[i].pg_status, "up")) { snprintf(nodes[i].pg_role, POOLCONFIG_MAXWEIGHTLEN, "%s", db_node_role(i)); } else { snprintf(nodes[i].pg_role, POOLCONFIG_MAXWEIGHTLEN, "unknown"); } } else { if (i == REAL_MAIN_NODE_ID) snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "main"); else snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "replica"); snprintf(nodes[i].pg_role, POOLCONFIG_MAXWEIGHTLEN, "%s", nodes[i].role); } /* 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", "pg_status", "lb_weight", "role", "pg_role", "select_cnt", "load_balance_node", "replication_delay", "replication_state", "replication_sync_state", "last_status_change"}; static int offsettbl[] = { offsetof(POOL_REPORT_NODES, node_id), offsetof(POOL_REPORT_NODES, hostname), offsetof(POOL_REPORT_NODES, port), offsetof(POOL_REPORT_NODES, status), offsetof(POOL_REPORT_NODES, pg_status), offsetof(POOL_REPORT_NODES, lb_weight), offsetof(POOL_REPORT_NODES, role), offsetof(POOL_REPORT_NODES, pg_role), offsetof(POOL_REPORT_NODES, select), offsetof(POOL_REPORT_NODES, load_balance_node), offsetof(POOL_REPORT_NODES, delay), offsetof(POOL_REPORT_NODES, rep_state), offsetof(POOL_REPORT_NODES, rep_sync_state), offsetof(POOL_REPORT_NODES, last_status_change) }; int nrows; short num_fields; POOL_REPORT_NODES *nodes; num_fields = sizeof(field_names) / sizeof(char *); nodes = get_nodes(&nrows, -1); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)nodes, sizeof(POOL_REPORT_NODES), nrows); pfree(nodes); } /* * Used by pcp_proc_info and SHOW pool_pools */ 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 = palloc0( 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++) { int exist_live_connection = 0; pi = &process_info[child]; proc_id = pi->pid; for (pool = 0; pool < pool_config->max_pool; pool++) { poolBE = pool * MAX_NUM_BACKENDS; if (pi->connection_info[poolBE].connected) { exist_live_connection = 1; break; } } for (pool = 0; pool < pool_config->max_pool; pool++) { int idle_duration = pi->connection_info[pool * MAX_NUM_BACKENDS].client_idle_duration; int load_balancing_node_id = pi->connection_info[pool * MAX_NUM_BACKENDS].load_balancing_node; int client_idle_time = pool_config->client_idle_limit; if (pool_config->client_idle_limit > 0) { client_idle_time = pool_config->client_idle_limit - idle_duration; } for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++) { poolBE = pool * MAX_NUM_BACKENDS + backend_id; snprintf(pools[lines].pool_pid, sizeof(pools[lines].pool_pid), "%d", proc_id); if (pi->start_time) { if ((pool_config->child_life_time > 0) && (pi->connected) && (!exist_live_connection)) { char proc_start_time[POOLCONFIG_MAXDATELEN + 1]; int wait_for_connect_time = pool_config->child_life_time - pi->wait_for_connect; strftime(proc_start_time, sizeof(proc_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time)); snprintf(pools[lines].process_start_time, sizeof(pools[lines].process_start_time), "%s (%d:%02d before process restarting)", proc_start_time, wait_for_connect_time / 60, wait_for_connect_time % 60); } else { strftime(pools[lines].process_start_time, sizeof(pools[lines].process_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time)); } } else *(pools[lines].process_start_time) = '\0'; snprintf(pools[lines].pool_id, sizeof(pools[lines].pool_id), "%d", pool); snprintf(pools[lines].backend_id, sizeof(pools[lines].backend_id), "%d", backend_id); snprintf(pools[lines].client_connection_count, sizeof(pools[lines].client_connection_count), "%d", pi->client_connection_count); if (pi->connection_info[poolBE].client_connection_time == 0) { *(pools[lines].client_connection_time) = '\0'; } else { strftime(pools[lines].client_connection_time, sizeof(pools[lines].client_connection_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].client_connection_time)); } if (pi->connection_info[poolBE].client_disconnection_time == 0) { *(pools[lines].client_disconnection_time) = '\0'; } else { strftime(pools[lines].client_disconnection_time, sizeof(pools[lines].client_disconnection_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].client_disconnection_time)); } if ((pool_config->client_idle_limit > 0) && (pi->connection_info[poolBE].connected)) { snprintf(pools[lines].client_idle_duration, sizeof(pools[lines].client_idle_duration), "%d (%d:%02d before client disconnected)", idle_duration, client_idle_time / 60, client_idle_time % 60); } else snprintf(pools[lines].client_idle_duration, sizeof(pools[lines].client_idle_duration), "%d", idle_duration); if (strlen(pi->connection_info[poolBE].database) == 0) { StrNCpy(pools[lines].database, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(pools[lines].username, "", POOLCONFIG_MAXIDENTLEN); *(pools[lines].backend_connection_time) = '\0'; snprintf(pools[lines].pool_majorversion, sizeof(pools[lines].pool_majorversion), "%d", 0); snprintf(pools[lines].pool_minorversion, sizeof(pools[lines].pool_minorversion), "%d", 0); } else { StrNCpy(pools[lines].database, pi->connection_info[poolBE].database, POOLCONFIG_MAXIDENTLEN); StrNCpy(pools[lines].username, pi->connection_info[poolBE].user, POOLCONFIG_MAXIDENTLEN); strftime(pools[lines].backend_connection_time, sizeof(pools[lines].backend_connection_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].create_time)); snprintf(pools[lines].pool_majorversion, sizeof(pools[lines].pool_majorversion), "%d", pi->connection_info[poolBE].major); snprintf(pools[lines].pool_minorversion, sizeof(pools[lines].pool_minorversion), "%d", pi->connection_info[poolBE].minor); } snprintf(pools[lines].pool_counter, sizeof(pools[lines].pool_counter), "%d", pi->connection_info[poolBE].counter); snprintf(pools[lines].pool_backendpid, sizeof(pools[lines].pool_backendpid), "%d", ntohl(pi->connection_info[poolBE].pid)); snprintf(pools[lines].pool_connected, sizeof(pools[lines].pool_connected), "%d", pi->connection_info[poolBE].connected); switch(pi->status) { case WAIT_FOR_CONNECT: StrNCpy(pools[lines].status, "Wait for connection", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case COMMAND_EXECUTE: StrNCpy(pools[lines].status, "Execute command", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case IDLE: StrNCpy(pools[lines].status, "Idle", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case IDLE_IN_TRANS: StrNCpy(pools[lines].status, "Idle in transaction", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case CONNECTING: StrNCpy(pools[lines].status, "Connecting", POOLCONFIG_MAXPROCESSSTATUSLEN); break; default: *(pools[lines].status) = '\0'; } if (pi->connection_info[poolBE].connected && backend_id == load_balancing_node_id) StrNCpy(pools[lines].load_balance_node, "1", POOLCONFIG_MAXPROCESSSTATUSLEN); else StrNCpy(pools[lines].load_balance_node, "0", POOLCONFIG_MAXPROCESSSTATUSLEN); lines++; } } } *nrows = lines; return pools; } /* * SHOW pool_pools; */ void pools_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { short num_fields; static char *field_names[] = {"pool_pid", "start_time", "client_connection_count", "pool_id", "backend_id", "database", "username", "backend_connection_time", "client_connection_time", "client_disconnection_time", "client_idle_duration", "majorversion", "minorversion", "pool_counter", "pool_backendpid", "pool_connected", "status", "load_balance_node"}; int n; int *offsettbl; int nrows; POOL_REPORT_POOLS *pools; num_fields = sizeof(field_names) / sizeof(char *); offsettbl = pool_report_pools_offsets(&n); pools = get_pools(&nrows); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)pools, sizeof(POOL_REPORT_POOLS), nrows); pfree(pools); } /* * Used by SHOW pool_processes */ POOL_REPORT_PROCESSES * get_processes(int *nrows) { int child; int pool; int poolBE; ProcessInfo *pi = NULL; int proc_id; POOL_REPORT_PROCESSES *processes = palloc0(pool_config->num_init_children * sizeof(POOL_REPORT_PROCESSES)); for (child = 0; child < pool_config->num_init_children; child++) { int exist_live_connection = 0; pi = &process_info[child]; proc_id = pi->pid; for (pool = 0; pool < pool_config->max_pool; pool++) { poolBE = pool * MAX_NUM_BACKENDS; if (pi->connection_info[poolBE].connected) { exist_live_connection = 1; break; } } snprintf(processes[child].pool_pid, POOLCONFIG_MAXCOUNTLEN, "%d", proc_id); if ((pool_config->child_life_time > 0) && (pi->connected) && (!exist_live_connection)) { char proc_start_time[POOLCONFIG_MAXDATELEN + 1]; int wait_for_connect_time = pool_config->child_life_time - pi->wait_for_connect; strftime(proc_start_time, sizeof(proc_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time)); snprintf(processes[child].process_start_time, sizeof(processes[child].process_start_time), "%s (%d:%02d before process restarting)", proc_start_time, wait_for_connect_time / 60, wait_for_connect_time % 60); } else { strftime(processes[child].process_start_time, sizeof(processes[child].process_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time)); } snprintf(processes[child].client_connection_count, sizeof(processes[child].client_connection_count), "%d", pi->client_connection_count); StrNCpy(processes[child].database, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(processes[child].username, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(processes[child].backend_connection_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].backend_connection_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); } } switch(pi->status) { case WAIT_FOR_CONNECT: StrNCpy(processes[child].status, "Wait for connection", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case COMMAND_EXECUTE: StrNCpy(processes[child].status, "Execute command", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case IDLE: StrNCpy(processes[child].status, "Idle", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case IDLE_IN_TRANS: StrNCpy(processes[child].status, "Idle in transaction", POOLCONFIG_MAXPROCESSSTATUSLEN); break; case CONNECTING: StrNCpy(processes[child].status, "Connecting", POOLCONFIG_MAXPROCESSSTATUSLEN); break; default: *(processes[child].status) = '\0'; } } *nrows = child; return processes; } /* * SHOW pool_processes */ void processes_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"pool_pid", "start_time", "client_connection_count", "database", "username", "backend_connection_time", "pool_counter", "status"}; static int offsettbl[] = { offsetof(POOL_REPORT_PROCESSES, pool_pid), offsetof(POOL_REPORT_PROCESSES, process_start_time), offsetof(POOL_REPORT_PROCESSES, client_connection_count), offsetof(POOL_REPORT_PROCESSES, database), offsetof(POOL_REPORT_PROCESSES, username), offsetof(POOL_REPORT_PROCESSES, backend_connection_time), offsetof(POOL_REPORT_PROCESSES, pool_counter), offsetof(POOL_REPORT_PROCESSES, status), }; int nrows; short num_fields; POOL_REPORT_PROCESSES *processes; num_fields = sizeof(field_names) / sizeof(char *); processes = get_processes(&nrows); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)processes, sizeof(POOL_REPORT_PROCESSES), nrows); pfree(processes); } POOL_REPORT_VERSION * get_version(void) { POOL_REPORT_VERSION *version = palloc(sizeof(POOL_REPORT_VERSION)); snprintf(version->version, POOLCONFIG_MAXVALLEN, "%s (%s)", VERSION, PGPOOLVERSION); return version; } /* * SHOW pool_version; */ void version_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"pool_version"}; static int offsettbl[] = { offsetof(POOL_REPORT_VERSION, version) }; int nrows = 1; short num_fields; POOL_REPORT_VERSION *version; num_fields = sizeof(field_names) / sizeof(char *); version = get_version(); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)version, sizeof(POOL_REPORT_VERSION), nrows); 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(POOL_MEMQ_SHARED_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); } /* * for SHOW health_check_stats */ POOL_HEALTH_CHECK_STATS * get_health_check_stats(int *nrows) { int i; POOL_HEALTH_CHECK_STATS *stats = palloc0(NUM_BACKENDS * sizeof(POOL_HEALTH_CHECK_STATS)); BackendInfo *bi = NULL; time_t t; double f; for (i = 0; i < NUM_BACKENDS; i++) { bi = pool_get_node_info(i); snprintf(stats[i].node_id, POOLCONFIG_MAXIDLEN, "%d", i); StrNCpy(stats[i].hostname, bi->backend_hostname, MAX_DB_HOST_NAMELEN); snprintf(stats[i].port, POOLCONFIG_MAXPORTLEN, "%d", bi->backend_port); snprintf(stats[i].status, POOLCONFIG_MAXSTATLEN, "%s", backend_status_to_str(bi)); if (STREAM) { if (i == REAL_PRIMARY_NODE_ID) { snprintf(stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "primary"); } else { snprintf(stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "standby"); } } else { if (i == REAL_MAIN_NODE_ID) snprintf(stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "main"); else snprintf(stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "replica"); } /* status last changed */ t = bi->status_changed_time; ereport(LOG,(errmsg("status_changed_time %ld", t))); strftime(stats[i].last_status_change, POOLCONFIG_MAXDATELEN, "%F %T", localtime(&t)); snprintf(stats[i].total_count, POOLCONFIG_MAXLONGCOUNTLEN, UINT64_FORMAT, health_check_stats[i].total_count); snprintf(stats[i].success_count, POOLCONFIG_MAXLONGCOUNTLEN, UINT64_FORMAT, health_check_stats[i].success_count); snprintf(stats[i].fail_count, POOLCONFIG_MAXLONGCOUNTLEN, UINT64_FORMAT, health_check_stats[i].fail_count); snprintf(stats[i].skip_count, POOLCONFIG_MAXLONGCOUNTLEN, UINT64_FORMAT, health_check_stats[i].skip_count); snprintf(stats[i].retry_count, POOLCONFIG_MAXLONGCOUNTLEN, UINT64_FORMAT, health_check_stats[i].retry_count); snprintf(stats[i].max_retry_count, POOLCONFIG_MAXCOUNTLEN, "%d", health_check_stats[i].max_retry_count); if (pool_config->health_check_params[i].health_check_period > 0) f = (double)health_check_stats[i].retry_count / (health_check_stats[i].total_count - health_check_stats[i].skip_count); else f = 0.0; snprintf(stats[i].average_retry_count, POOLCONFIG_MAXWEIGHTLEN, "%f", f); if (pool_config->health_check_params[i].health_check_period > 0) f = (double)health_check_stats[i].total_health_check_duration / (health_check_stats[i].total_count - health_check_stats[i].skip_count); else f = 0.0; snprintf(stats[i].average_health_check_duration, POOLCONFIG_MAXWEIGHTLEN, "%f", f); snprintf(stats[i].max_health_check_duration, POOLCONFIG_MAXCOUNTLEN, "%d", health_check_stats[i].max_health_check_duration); snprintf(stats[i].min_health_check_duration, POOLCONFIG_MAXCOUNTLEN, "%d", health_check_stats[i].min_health_check_duration); t = health_check_stats[i].last_health_check; if (t > 0) strftime(stats[i].last_health_check, POOLCONFIG_MAXDATELEN, "%F %T", localtime(&t)); t = health_check_stats[i].last_successful_health_check; if (t > 0) strftime(stats[i].last_successful_health_check, POOLCONFIG_MAXDATELEN, "%F %T", localtime(&t)); t = health_check_stats[i].last_skip_health_check; if (t > 0) strftime(stats[i].last_skip_health_check, POOLCONFIG_MAXDATELEN, "%F %T", localtime(&t)); t = health_check_stats[i].last_failed_health_check; if (t > 0) strftime(stats[i].last_failed_health_check, POOLCONFIG_MAXDATELEN, "%F %T", localtime(&t)); } *nrows = i; return stats; } /* * SHOW health_check_stats; */ void show_health_check_stats(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"node_id", "hostname", "port", "status", "role", "last_status_change", "total_count", "success_count", "fail_count", "skip_count", "retry_count", "average_retry_count", "max_retry_count", "max_duration", "min_duration", "average_duration", "last_health_check", "last_successful_health_check", "last_skip_health_check", "last_failed_health_check"}; static int offsettbl[] = { offsetof(POOL_HEALTH_CHECK_STATS, node_id), offsetof(POOL_HEALTH_CHECK_STATS, hostname), offsetof(POOL_HEALTH_CHECK_STATS, port), offsetof(POOL_HEALTH_CHECK_STATS, status), offsetof(POOL_HEALTH_CHECK_STATS, role), offsetof(POOL_HEALTH_CHECK_STATS, last_status_change), offsetof(POOL_HEALTH_CHECK_STATS, total_count), offsetof(POOL_HEALTH_CHECK_STATS, success_count), offsetof(POOL_HEALTH_CHECK_STATS, fail_count), offsetof(POOL_HEALTH_CHECK_STATS, skip_count), offsetof(POOL_HEALTH_CHECK_STATS, retry_count), offsetof(POOL_HEALTH_CHECK_STATS, average_retry_count), offsetof(POOL_HEALTH_CHECK_STATS, max_retry_count), offsetof(POOL_HEALTH_CHECK_STATS, max_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, min_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, average_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, last_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_successful_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_skip_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_failed_health_check), }; int nrows; short num_fields; POOL_HEALTH_CHECK_STATS *stats; num_fields = sizeof(field_names) / sizeof(char *); stats = get_health_check_stats(&nrows); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)stats, sizeof(POOL_HEALTH_CHECK_STATS), nrows); pfree(stats); } /* * for SHOW backend_stats */ POOL_BACKEND_STATS * get_backend_stats(int *nrows) { int i; POOL_BACKEND_STATS *backend_stats = palloc(NUM_BACKENDS * sizeof(POOL_BACKEND_STATS)); BackendInfo *bi = NULL; pool_get_session_context(false); for (i = 0; i < NUM_BACKENDS; i++) { bi = pool_get_node_info(i); snprintf(backend_stats[i].node_id, POOLCONFIG_MAXIDLEN, "%d", i); StrNCpy(backend_stats[i].hostname, bi->backend_hostname, MAX_DB_HOST_NAMELEN); snprintf(backend_stats[i].port, POOLCONFIG_MAXPORTLEN, "%d", bi->backend_port); snprintf(backend_stats[i].status, POOLCONFIG_MAXSTATLEN, "%s", backend_status_to_str(bi)); snprintf(backend_stats[i].select_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_select_count(i)); snprintf(backend_stats[i].insert_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_insert_count(i)); snprintf(backend_stats[i].update_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_update_count(i)); snprintf(backend_stats[i].delete_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_delete_count(i)); snprintf(backend_stats[i].ddl_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_ddl_count(i)); snprintf(backend_stats[i].other_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_other_count(i)); snprintf(backend_stats[i].panic_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_panic_count(i)); snprintf(backend_stats[i].fatal_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_fatal_count(i)); snprintf(backend_stats[i].error_cnt, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_error_count(i)); if (STREAM) { if (i == REAL_PRIMARY_NODE_ID) { snprintf(backend_stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "primary"); } else { snprintf(backend_stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "standby"); } } else { if (i == REAL_MAIN_NODE_ID) snprintf(backend_stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "main"); else snprintf(backend_stats[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "replica"); } } *nrows = i; return backend_stats; } /* * SHOW backend_stats; */ void show_backend_stats(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"node_id", "hostname", "port", "status", "role", "select_cnt", "insert_cnt", "update_cnt", "delete_cnt", "ddl_cnt", "other_cnt", "panic_cnt", "fatal_cnt", "error_cnt"}; static int offsettbl[] = { offsetof(POOL_BACKEND_STATS, node_id), offsetof(POOL_BACKEND_STATS, hostname), offsetof(POOL_BACKEND_STATS, port), offsetof(POOL_BACKEND_STATS, status), offsetof(POOL_BACKEND_STATS, role), offsetof(POOL_BACKEND_STATS, select_cnt), offsetof(POOL_BACKEND_STATS, insert_cnt), offsetof(POOL_BACKEND_STATS, update_cnt), offsetof(POOL_BACKEND_STATS, delete_cnt), offsetof(POOL_BACKEND_STATS, ddl_cnt), offsetof(POOL_BACKEND_STATS, other_cnt), offsetof(POOL_BACKEND_STATS, panic_cnt), offsetof(POOL_BACKEND_STATS, fatal_cnt), offsetof(POOL_BACKEND_STATS, error_cnt), }; int nrows; short num_fields; POOL_BACKEND_STATS *backend_stats; num_fields = sizeof(field_names) / sizeof(char *); backend_stats = get_backend_stats(&nrows); send_row_description_and_data_rows(frontend, backend, num_fields, field_names, offsettbl, (char *)backend_stats, sizeof(POOL_BACKEND_STATS), nrows); pfree(backend_stats); } /* * Send row description and data rows. * * Params: * frontend/backend: connections to frontend and backend. * * num_fields: number of fields * * field_names: array of field names * * offsettbl: offset array for each "data" member. The number of array * elements must match with num_fields. * * data: string data to be displayed as row data, 2-dimensions array. The * number of array elements must match with num_fields * nrows. * * row_size: byte length of data for 1 row. * * nrows: number of rows in data. */ static void send_row_description_and_data_rows(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short num_fields, char **field_names, int *offsettbl, char *data, int row_size, int nrows) { int i, j; short s; int len; unsigned char *nullmap; int nbytes; nbytes = (num_fields + 7) / 8; send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) { nullmap = palloc(nbytes); memset(nullmap, 0xff, nbytes); /* ascii row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); for (j = 0; j < num_fields; j++) { write_one_field_v2(frontend, data + i * row_size + offsettbl[j]); } } pfree(nullmap); } else { /* data row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ for (j = 0; j < num_fields; j++) { len += 4 + strlen(data + i * row_size + offsettbl[j]); } len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); for (j = 0; j < num_fields; j++) { write_one_field(frontend, data + i * row_size + offsettbl[j]); } } } send_complete_and_ready(frontend, backend, "SELECT", nrows); } /* Write one field to frontend (v3) */ static void write_one_field(POOL_CONNECTION * frontend, char *field) { int size, hsize; size = strlen(field); hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, field, size); } /* Write one field to frontend (v2) */ static void write_one_field_v2(POOL_CONNECTION * frontend, char *field) { int size, hsize; size = strlen(field); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, field, size); } /* * Get DB node status. Return values are "up", "down" or "unknown" (in case * when health check is not enabled). */ static char *db_node_status(int node) { #ifdef HAVE_PQPINGPARAMS BackendInfo *bkinfo; int i; char portstr[32]; char timeoutstr[32]; #define PARAMS_ARRAY_SIZE 8 const char *keywords[PARAMS_ARRAY_SIZE]; const char *values[PARAMS_ARRAY_SIZE]; PGPing ret; #endif /* * If health check is not enabled, return "unknown". */ if (pool_config->health_check_params[node].health_check_period == 0) { return "unknown"; } #ifdef HAVE_PQPINGPARAMS i = 0; keywords[i] = "user"; values[i] = pool_config->health_check_params[node].health_check_user; i++; /* * If health check database is not defined, use "postgres" database. */ keywords[i] = "dbname"; if (*pool_config->health_check_params[node].health_check_database == '\0') values[i] = "postgres"; else values[i] = pool_config->health_check_params[node].health_check_database; i++; bkinfo = pool_get_node_info(node); keywords[i] = "host"; values[i] = bkinfo->backend_hostname; i++; keywords[i] = "port"; snprintf(portstr, sizeof(portstr), "%d", bkinfo->backend_port); values[i] = portstr; i++; if (pool_config->connect_timeout > 0) { keywords[i] = "connect_timeout"; snprintf(timeoutstr, sizeof(timeoutstr), "%d", pool_config->connect_timeout / 1000); values[i] = timeoutstr; i++; } keywords[i] = NULL; values[i] = NULL; ret = PQpingParams(keywords, values, 1); if (ret == PQPING_OK) { return "up"; } return "down"; #else return "unknown"; #endif } /* * Get DB node role. Return values are "primary", "standby" or "unknown" (in case * when sr check is not enabled). */ static char *db_node_role(int node) { BackendInfo *bkinfo; POOL_CONNECTION_POOL_SLOT *slots[MAX_NUM_BACKENDS]; POOL_SELECT_RESULT *res; char *user; char *password; char *dbname; char *host; int port; char *sts; if (pool_config->sr_check_period == 0) { /* sr check is disabled */ return "unknown"; } bkinfo = pool_get_node_info(node); host = bkinfo->backend_hostname; port = bkinfo->backend_port; user = pool_config->sr_check_user; password = get_pgpool_config_user_password(user, pool_config->sr_check_password); dbname = pool_config->sr_check_database; if (*dbname == '\0') dbname = "postgres"; /* * Establish connection to backend. */ slots[node] = make_persistent_db_connection_noerror(node, host, port, dbname, user, password ? password : "", false); if (slots[node] == NULL) return "unknown"; /* * Query whether the node is in recovery. */ if (get_query_result(slots, node, "SELECT pg_catalog.pg_is_in_recovery()", &res)) { return "unknown"; } if (res->data[0] && !strcmp(res->data[0], "t")) { sts = "standby"; } else if (res->data[0] && !strcmp(res->data[0], "f")) { sts = "primary"; } else { sts = "unknown"; } free_select_result(res); /* * Discard connection to backend. */ discard_persistent_db_connection(slots[node]); return sts; } pgpool-II-4.6.0/src/utils/pool_ssl.c0000664000175000017500000007102514760001620014171 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2021 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 #include #include #include #include "pool.h" #include "config.h" #include "pool_config.h" #include "utils/pool_ssl.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_stream.h" #include "utils/pool_path.h" #include "main/pool_internal_comms.h" #ifdef USE_SSL static SSL_CTX *SSL_frontend_context = NULL; static bool SSL_initialized = false; static bool dummy_ssl_passwd_cb_called = false; static int dummy_ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata); static int ssl_external_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); static int run_ssl_passphrase_command(const char *prompt, char *buf, int size); static void pool_ssl_make_absolute_path(char *artifact_path, char *config_dir, char *absolute_path); #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': /* * At this point the server read buffer must be empty. Otherwise it * is possible that a man-in-the-middle attack is ongoing. * So we immediately close the communication channel. */ if (!pool_read_buffer_is_empty(cp)) { ereport(FATAL, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("received unencrypted data after SSL request"), errdetail("This could be an evidence of an attempted man-in-the-middle attack."))); } 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; case 'E': /* * Server failure of some sort, such as failure to fork a backend * process. Don't bother retrieving the error message; we should * not trust it as the server has not been authenticated yet. */ ereport(FATAL, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("server sent an error response during SSL exchange"))); 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); /* * At this point the frontend read buffer must be empty. Otherwise it * is possible that a man-in-the-middle attack is ongoing. * So we immediately close the communication channel. */ if (!pool_read_buffer_is_empty(cp)) { ereport(FATAL, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("received unencrypted data after SSL request"), errdetail("This could be either a client-software bug or evidence of an attempted man-in-the-middle attack."))); } 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: perror_ssl("SSL_read"); n = -1; break; case SSL_ERROR_ZERO_RETURN: /* SSL manual says: * ------------------------------------------------------------- * The TLS/SSL peer has closed the connection for * writing by sending the close_notify alert. No more data can be * read. Note that SSL_ERROR_ZERO_RETURN does not necessarily * indicate that the underlying transport has been closed. * ------------------------------------------------------------- * We don't want to trigger failover but it is also possible that * the connection has been closed. So returns 0 to ask pool_read() * to close connection to frontend. */ ereport(WARNING, (errmsg("ssl read: SSL_ERROR_ZERO_RETURN"))); perror_ssl("SSL_read"); n = 0; 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; char ssl_cert_path[POOLMAXPATHLEN + 1] = ""; char ssl_key_path[POOLMAXPATHLEN + 1] = ""; char ssl_ca_cert_path[POOLMAXPATHLEN + 1] = ""; char *conf_file_copy = pstrdup(get_config_file_name()); char *conf_dir = dirname(conf_file_copy); pool_ssl_make_absolute_path(pool_config->ssl_cert, conf_dir, ssl_cert_path); pool_ssl_make_absolute_path(pool_config->ssl_key, conf_dir, ssl_key_path); pool_ssl_make_absolute_path(pool_config->ssl_ca_cert, conf_dir, ssl_ca_cert_path); pfree(conf_file_copy); /* 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, ssl_cert_path); SSL_RETURN_ERROR_IF((error != 1), "Loading SSL certificate"); error = SSL_CTX_use_PrivateKey_file(cp->ssl_ctx, ssl_key_path, 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(ssl_ca_cert_path)) cacert = ssl_ca_cert_path; 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 dummy_ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata) { /* Set flag to change the error message we'll report */ dummy_ssl_passwd_cb_called = true; /* And return empty string */ Assert(size > 0); buf[0] = '\0'; return 0; } /* * Passphrase collection callback using ssl_passphrase_command */ static int ssl_external_passwd_cb(char *buf, int size, int rwflag, void *userdata) { /* same prompt as OpenSSL uses internally */ const char *prompt = "Enter PEM pass phrase:"; Assert(rwflag == 0); return run_ssl_passphrase_command(prompt, buf, size); } /* * 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; char ssl_cert_path[POOLMAXPATHLEN + 1] = ""; char ssl_key_path[POOLMAXPATHLEN + 1] = ""; char ssl_ca_cert_path[POOLMAXPATHLEN + 1] = ""; char *conf_file_copy = pstrdup(get_config_file_name()); char *conf_dir = dirname(conf_file_copy); pool_ssl_make_absolute_path(pool_config->ssl_cert, conf_dir, ssl_cert_path); pool_ssl_make_absolute_path(pool_config->ssl_key, conf_dir, ssl_key_path); pool_ssl_make_absolute_path(pool_config->ssl_ca_cert, conf_dir, ssl_ca_cert_path); pfree(conf_file_copy); /* 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 */ if(pool_config->ssl_passphrase_command && strlen(pool_config->ssl_passphrase_command)) SSL_CTX_set_default_passwd_cb(context, ssl_external_passwd_cb); else SSL_CTX_set_default_passwd_cb(context, dummy_ssl_passwd_cb); /* * Load and verify server's certificate and private key */ if (SSL_CTX_use_certificate_chain_file(context, ssl_cert_path) != 1) { ereport(WARNING, (errmsg("could not load server certificate file \"%s\": %s", ssl_cert_path, SSLerrmessage(ERR_get_error())))); goto error; } if (stat(ssl_key_path, &buf) != 0) { ereport(WARNING, (errmsg("could not access private key file \"%s\": %m", ssl_key_path))); goto error; } if (!S_ISREG(buf.st_mode)) { ereport(WARNING, (errmsg("private key file \"%s\" is not a regular file", ssl_key_path))); 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", ssl_key_path), 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. */ dummy_ssl_passwd_cb_called = false; if (SSL_CTX_use_PrivateKey_file(context, ssl_key_path, SSL_FILETYPE_PEM) != 1) { if (dummy_ssl_passwd_cb_called) ereport(WARNING, (errmsg("private key file \"%s\" cannot be reloaded because it requires a passphrase", ssl_key_path))); else ereport(WARNING, (errmsg("could not load private key file \"%s\": %s", ssl_key_path, 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 (strlen(ssl_ca_cert_path)) { char *cacert = ssl_ca_cert_path, *cacert_dir = NULL; 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", cacert, SSLerrmessage(ERR_get_error())))); goto error; } } /*---------- * Load the Certificate Revocation List (CRL). * http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci803160,00.html *---------- */ if (pool_config->ssl_crl_file && strlen(pool_config->ssl_crl_file)) { char ssl_crl_path[POOLMAXPATHLEN + 1] = ""; pool_ssl_make_absolute_path(pool_config->ssl_crl_file, conf_dir, ssl_crl_path); X509_STORE *cvstore = SSL_CTX_get_cert_store(context); if (cvstore) { /* Set the flags to check against the complete CRL chain */ if (X509_STORE_load_locations(cvstore, ssl_crl_path, NULL) == 1) { /* OpenSSL 0.9.6 does not support X509_V_FLAG_CRL_CHECK */ #ifdef X509_V_FLAG_CRL_CHECK X509_STORE_set_flags(cvstore, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); #else ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("SSL certificate revocation list file \"%s\" ignored", ssl_crl_path), errdetail("SSL library does not support certificate revocation lists."))); #endif } else { ereport(WARNING, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("could not load SSL certificate revocation list file \"%s\": %s", ssl_crl_path, SSLerrmessage(ERR_get_error())))); goto error; } } } if (strlen(ssl_ca_cert_path)) { /* * 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; } /* * Run ssl_passphrase_command * * The result will be put in buffer buf, which is of size size. The return * value is the length of the actual result. */ int run_ssl_passphrase_command(const char *prompt, char *buf, int size) { int loglevel = ERROR; StringInfoData command; char *p; FILE *fh; int pclose_rc; size_t len = 0; Assert(prompt); Assert(size > 0); buf[0] = '\0'; initStringInfo(&command); for (p = pool_config->ssl_passphrase_command; *p; p++) { if (p[0] == '%') { switch (p[1]) { case 'p': appendStringInfoString(&command, prompt); p++; break; case '%': appendStringInfoChar(&command, '%'); p++; break; default: appendStringInfoChar(&command, p[0]); } } else appendStringInfoChar(&command, p[0]); } fh = popen(command.data, "r"); if (fh == NULL) { ereport(loglevel, (errmsg("could not execute command \"%s\": %m", command.data))); goto error; } if (!fgets(buf, size, fh)) { if (ferror(fh)) { ereport(loglevel, (errmsg("could not read from command \"%s\": %m", command.data))); goto error; } } pclose_rc = pclose(fh); if (pclose_rc == -1) { ereport(loglevel, (errmsg("could not close pipe to external command: %m"))); goto error; } else if (pclose_rc != 0) { ereport(loglevel, (errmsg("command \"%s\" failed", command.data))); goto error; } /* strip trailing newline */ len = strlen(buf); if (len > 0 && buf[len - 1] == '\n') buf[--len] = '\0'; error: pfree(command.data); return len; } void pool_ssl_make_absolute_path(char *artifact_path, char *config_dir, char *absolute_path) { if (artifact_path && strlen(artifact_path)) { if(is_absolute_path(artifact_path)) strncpy(absolute_path, artifact_path, POOLMAXPATHLEN); else snprintf(absolute_path, POOLMAXPATHLEN, "%s/%s", config_dir, artifact_path); } } #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.6.0/src/utils/pool_stream.c0000664000175000017500000007215714760007565014710 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2023 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 #include "pool.h" #include "pool_config.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/socket_stream.h" #include "utils/pool_stream.h" #include "utils/pool_ssl.h" #include "main/pool_internal_comms.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_MAIN_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 error \"%m\""))); } } 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 :\"%m\""), 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 error \"%m\""))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("socket read failed with error \"%m\""))); } } else { ereport(FRONTEND_DEBUG, (errmsg("unable to read data from frontend"), errdetail("socket read failed with error \"%m\""))); } } 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_DEBUG, (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_MAIN_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 error \"%m\""))); } } 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 :\"%m\""), 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 error \"%m\""))); } 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 :\"%m\"", cp->db_node_id), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); else ereport(DEBUG5, (errmsg("write on frontend failed with error :\"%m\""), 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 :\"%m\"", cp->db_node_id), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); else ereport(DEBUG5, (errmsg("write on frontend failed with error :\"%m\""), 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_DEBUG, (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_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); 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 occurs */ 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_MAIN_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 error \"%m\""))); } } 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; } #ifdef DEBUG /* * Debug aid */ static void dump_buffer(char *buf, int len) { if (!message_level_is_interesting(DEBUG5)) return; while (--len) { ereport(DEBUG5, (errmsg("%02x", *buf++))); } } #endif /* * 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: \"%m\""))); 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.6.0/src/utils/socket_stream.c0000664000175000017500000000770514760007565015224 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/socket_stream.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif /* * set non-block flag */ void socket_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 \"%m\""))); } 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 \"%m\""))); } } /* * unset non-block flag */ void socket_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 \"%m\""))); } 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 \"%m\""))); } } #ifdef DEBUG /* * Debug aid */ static void dump_buffer(char *buf, int len) { if (!message_level_is_interesting(DEBUG5)) return; 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 :\"%m\""), errdetail("retrying..."))); continue; } ereport(LOG, (errmsg("write on socket failed"), errdetail("%m"))); 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("system call select() failed"), errdetail("%m"))); 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 :\"%m\""), errdetail("retrying..."))); continue; } ereport(LOG, (errmsg("read from socket failed with error :\"%m\""))); 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; } pgpool-II-4.6.0/src/utils/getopt_long.c0000664000175000017500000001121014760001620014646 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.6.0/src/utils/regex_array.c0000664000175000017500000001233514760007565014664 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 expression array. */ #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_array(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 separated 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.6.0/src/utils/json_writer.c0000664000175000017500000001637014760001620014706 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.6.0/src/utils/json.c0000664000175000017500000006171514760001620013315 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.6.0/src/utils/scram-common.c0000664000175000017500000001352514760001620014733 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.6.0/src/utils/base64.c0000664000175000017500000000747414760001620013432 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.6.0/src/utils/sha2.c0000664000175000017500000006506014760001620013176 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.6.0/src/utils/ssl_utils.c0000664000175000017500000001650514760001620014362 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.6.0/src/utils/statistics.c0000664000175000017500000001045014760001620014524 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 * */ /*-------------------------------------------------------------------- * statistics.c * * Various statistics related functions. *-------------------------------------------------------------------- */ #include #include #include "pool.h" #include "utils/statistics.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 */ uint64 panic_cnt; /* number of PANIC messages */ uint64 fatal_cnt; /* number of FATAL messages */ uint64 error_cnt; /* number of ERROR messages */ } 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++; } else if (IsA(parse_tree, InsertStmt)) { per_node_stat[backend_node_id].insert_cnt++; } else if (IsA(parse_tree, UpdateStmt)) { per_node_stat[backend_node_id].update_cnt++; } else if (IsA(parse_tree, DeleteStmt)) { per_node_stat[backend_node_id].delete_cnt++; } else { switch(nodeTag(parse_tree)) { case(T_CheckPointStmt): case(T_DeallocateStmt): case(T_DiscardStmt): case(T_ExecuteStmt): case(T_ExplainStmt): case(T_ListenStmt): case(T_LoadStmt): case(T_LockStmt): case(T_NotifyStmt): case(T_PrepareStmt): case(T_TransactionStmt): case(T_UnlistenStmt): case(T_VacuumStmt): case(T_VariableSetStmt): case(T_VariableShowStmt): per_node_stat[backend_node_id].other_cnt++; break; default: per_node_stat[backend_node_id].ddl_cnt++; } } } /* * Update error stat counter */ void error_stat_count_up(int backend_node_id, char *str) { if (strcasecmp(str, "PANIC") == 0) per_node_stat[backend_node_id].panic_cnt++; else if (strcasecmp(str, "FATAL") == 0) per_node_stat[backend_node_id].fatal_cnt++; else if (strcasecmp(str, "ERROR") == 0) per_node_stat[backend_node_id].error_cnt++; } /* * Stat counter read functions */ uint64 stat_get_select_count(int backend_node_id) { return per_node_stat[backend_node_id].select_cnt; } uint64 stat_get_insert_count(int backend_node_id) { return per_node_stat[backend_node_id].insert_cnt; } uint64 stat_get_update_count(int backend_node_id) { return per_node_stat[backend_node_id].update_cnt; } uint64 stat_get_delete_count(int backend_node_id) { return per_node_stat[backend_node_id].delete_cnt; } uint64 stat_get_ddl_count(int backend_node_id) { return per_node_stat[backend_node_id].ddl_cnt; } uint64 stat_get_other_count(int backend_node_id) { return per_node_stat[backend_node_id].other_cnt; } uint64 stat_get_panic_count(int backend_node_id) { return per_node_stat[backend_node_id].panic_cnt; } uint64 stat_get_fatal_count(int backend_node_id) { return per_node_stat[backend_node_id].fatal_cnt; } uint64 stat_get_error_count(int backend_node_id) { return per_node_stat[backend_node_id].error_cnt; } pgpool-II-4.6.0/src/utils/pool_health_check_stats.c0000664000175000017500000000705114760007565017224 00000000000000/* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2021 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 "pool.h" #include "pcp/libpcp_ext.h" /* * Returns an array consisting of POOL_HEALTH_CHECK_STATS struct member * offsets. The reason why we have this as a function is the table data needs * to be shared by both PCP server and clients. * Number of struct members will be stored in *n. */ int * pool_health_check_stats_offsets(int *n) { static int offsettbl[] = { offsetof(POOL_HEALTH_CHECK_STATS, node_id), offsetof(POOL_HEALTH_CHECK_STATS, hostname), offsetof(POOL_HEALTH_CHECK_STATS, port), offsetof(POOL_HEALTH_CHECK_STATS, status), offsetof(POOL_HEALTH_CHECK_STATS, role), offsetof(POOL_HEALTH_CHECK_STATS, last_status_change), offsetof(POOL_HEALTH_CHECK_STATS, total_count), offsetof(POOL_HEALTH_CHECK_STATS, success_count), offsetof(POOL_HEALTH_CHECK_STATS, fail_count), offsetof(POOL_HEALTH_CHECK_STATS, skip_count), offsetof(POOL_HEALTH_CHECK_STATS, retry_count), offsetof(POOL_HEALTH_CHECK_STATS, average_retry_count), offsetof(POOL_HEALTH_CHECK_STATS, max_retry_count), offsetof(POOL_HEALTH_CHECK_STATS, max_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, min_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, average_health_check_duration), offsetof(POOL_HEALTH_CHECK_STATS, last_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_successful_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_skip_health_check), offsetof(POOL_HEALTH_CHECK_STATS, last_failed_health_check), }; *n = sizeof(offsettbl)/sizeof(int); return offsettbl; } /* * Returns an array consisting of POOL_REPORT_POOLS struct member offsets. * The reason why we have this as a function is the table data needs to be * shared by both PCP server and clients. Number of struct members will be * stored in *n. */ int * pool_report_pools_offsets(int *n) { static int offsettbl[] = { offsetof(POOL_REPORT_POOLS, pool_pid), offsetof(POOL_REPORT_POOLS, process_start_time), offsetof(POOL_REPORT_POOLS, client_connection_count), offsetof(POOL_REPORT_POOLS, pool_id), offsetof(POOL_REPORT_POOLS, backend_id), offsetof(POOL_REPORT_POOLS, database), offsetof(POOL_REPORT_POOLS, username), offsetof(POOL_REPORT_POOLS, backend_connection_time), offsetof(POOL_REPORT_POOLS, client_connection_time), offsetof(POOL_REPORT_POOLS, client_disconnection_time), offsetof(POOL_REPORT_POOLS, client_idle_duration), offsetof(POOL_REPORT_POOLS, pool_majorversion), offsetof(POOL_REPORT_POOLS, pool_minorversion), offsetof(POOL_REPORT_POOLS, pool_counter), offsetof(POOL_REPORT_POOLS, pool_backendpid), offsetof(POOL_REPORT_POOLS, pool_connected), offsetof(POOL_REPORT_POOLS, status), offsetof(POOL_REPORT_POOLS, load_balance_node) }; *n = sizeof(offsettbl)/sizeof(int); return offsettbl; } pgpool-II-4.6.0/src/utils/psqlscan.l0000664000175000017500000012145314760001620014175 00000000000000%top{ /*------------------------------------------------------------------------- * * psqlscan.l * lexical scanner for SQL commands * * This lexer used to be part of psql, and that heritage is reflected in * the file name as well as function and typedef names, though it can now * be used by other frontend programs as well. It's also possible to extend * this lexer with a compatible add-on lexer to handle program-specific * backslash commands. * * This code is mainly concerned with determining where the end of a SQL * statement is: we are looking for semicolons that are not within quotes, * comments, or parentheses. The most reliable way to handle this is to * borrow the backend's flex lexer rules, lock, stock, and barrel. The rules * below are (except for a few) the same as the backend's, but their actions * are just ECHO whereas the backend's actions generally do other things. * * XXX The rules in this file must be kept in sync with the backend lexer!!! * * XXX Avoid creating backtracking cases --- see the backend lexer for info. * * See psqlscan_int.h for additional commentary. * * * Portions Copyright (c) 2023, PgPool Global Development Group * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/fe_utils/psqlscan.l * *------------------------------------------------------------------------- */ } %{ /* LCOV_EXCL_START */ #include "parser/pg_config_manual.h" #include "pool.h" #include "utils/psqlscan.h" #include "utils/psqlscan_int.h" #include "utils/pqexpbuffer.h" #include "utils/pgstrcasecmp.h" #include "utils/elog.h" #include "parser/pool_parser.h" #define pg_log_warning(str, var) elog(WARNING, (str), (var)) #define pg_malloc palloc #define pg_malloc0 palloc0 static char *pg_strdup(const char *in); /* * We must have a typedef YYSTYPE for yylex's first argument, but this lexer * doesn't presently make use of that argument, so just declare it as int. */ typedef int YYSTYPE; /* * Set the type of yyextra; we use it as a pointer back to the containing * PsqlScanState. */ #define YY_EXTRA_TYPE PsqlScanState /* Return values from yylex() */ #define LEXRES_EOL 0 /* end of input */ #define LEXRES_SEMI 1 /* command-terminating semicolon found */ #define LEXRES_BACKSLASH 2 /* backslash command start */ #define ECHO psqlscan_emit(cur_state, yytext, yyleng) /* * Work around a bug in flex 2.5.35: it emits a couple of functions that * it forgets to emit declarations for. Since we use -Wmissing-prototypes, * this would cause warnings. Providing our own declarations should be * harmless even when the bug gets fixed. */ extern int psql_yyget_column(yyscan_t yyscanner); extern void psql_yyset_column(int column_no, yyscan_t yyscanner); %} %option reentrant %option bison-bridge %option 8bit %option never-interactive %option nodefault %option noinput %option nounput %option noyywrap %option warn %option prefix="psql_yy" /* * All of the following definitions and rules should exactly match * src/backend/parser/scan.l so far as the flex patterns are concerned. * The rule bodies are just ECHO as opposed to what the backend does, * however. (But be sure to duplicate code that affects the lexing process, * such as BEGIN() and yyless().) Also, psqlscan uses a single <> rule * whereas scan.l has a separate one for each exclusive state. */ /* * OK, here is a short description of lex/flex rules behavior. * The longest pattern which matches an input string is always chosen. * For equal-length patterns, the first occurring in the rules list is chosen. * INITIAL is the starting state, to which all non-conditional rules apply. * Exclusive states change parsing rules while the state is active. When in * an exclusive state, only those rules defined for that state apply. * * We use exclusive states for quoted strings, extended comments, * and to eliminate parsing troubles for numeric strings. * Exclusive states: * bit string literal * extended C-style comments * delimited identifiers (double-quoted identifiers) * hexadecimal byte string * standard quoted strings * quote stop (detect continued strings) * extended quoted strings (support backslash escape sequences) * $foo$ quoted strings * quoted identifier with Unicode escapes * quoted string with Unicode escapes * * Note: we intentionally don't mimic the backend's state; we have * no need to distinguish it from state, and no good way to get out * of it in error cases. The backend just throws yyerror() in those * cases, but that's not an option here. */ %x xb %x xc %x xd %x xh %x xq %x xqs %x xe %x xdolq %x xui %x xus /* * In order to make the world safe for Windows and Mac clients as well as * Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n * sequence will be seen as two successive newlines, but that doesn't cause * any problems. Comments that start with -- and extend to the next * newline are treated as equivalent to a single whitespace character. * * NOTE a fine point: if there is no newline following --, we will absorb * everything to the end of the input as a comment. This is correct. Older * versions of Postgres failed to recognize -- as a comment if the input * did not end with a newline. * * XXX perhaps \f (formfeed) should be treated as a newline as well? * * XXX if you change the set of whitespace characters, fix scanner_isspace() * to agree. */ space [ \t\n\r\f] horiz_space [ \t\f] newline [\n\r] non_newline [^\n\r] comment ("--"{non_newline}*) whitespace ({space}+|{comment}) /* * SQL requires at least one newline in the whitespace separating * string literals that are to be concatenated. Silly, but who are we * to argue? Note that {whitespace_with_newline} should not have * after * it, whereas {whitespace} should generally have a * after it... */ special_whitespace ({space}+|{comment}{newline}) horiz_whitespace ({horiz_space}|{comment}) whitespace_with_newline ({horiz_whitespace}*{newline}{special_whitespace}*) quote ' /* If we see {quote} then {quotecontinue}, the quoted string continues */ quotecontinue {whitespace_with_newline}{quote} /* * {quotecontinuefail} is needed to avoid lexer backup when we fail to match * {quotecontinue}. It might seem that this could just be {whitespace}*, * but if there's a dash after {whitespace_with_newline}, it must be consumed * to see if there's another dash --- which would start a {comment} and thus * allow continuation of the {quotecontinue} token. */ quotecontinuefail {whitespace}*"-"? /* Bit string * It is tempting to scan the string for only those characters * which are allowed. However, this leads to silently swallowed * characters if illegal characters are included in the string. * For example, if xbinside is [01] then B'ABCD' is interpreted * as a zero-length string, and the ABCD' is lost! * Better to pass the string forward and let the input routines * validate the contents. */ xbstart [bB]{quote} xbinside [^']* /* Hexadecimal byte string */ xhstart [xX]{quote} xhinside [^']* /* National character */ xnstart [nN]{quote} /* Quoted string that allows backslash escapes */ xestart [eE]{quote} xeinside [^\\']+ xeescape [\\][^0-7] xeoctesc [\\][0-7]{1,3} xehexesc [\\]x[0-9A-Fa-f]{1,2} xeunicode [\\](u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}) xeunicodefail [\\](u[0-9A-Fa-f]{0,3}|U[0-9A-Fa-f]{0,7}) /* Extended quote * xqdouble implements embedded quote, '''' */ xqstart {quote} xqdouble {quote}{quote} xqinside [^']+ /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string * in the form of an identifier, except that it may not contain "$", * and extends to the first occurrence of an identical string. * There is *no* processing of the quoted text. * * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim} * fails to match its trailing "$". */ dolq_start [A-Za-z\200-\377_] dolq_cont [A-Za-z\200-\377_0-9] dolqdelim \$({dolq_start}{dolq_cont}*)?\$ dolqfailed \${dolq_start}{dolq_cont}* dolqinside [^$]+ /* Double quote * Allows embedded spaces and other special characters into identifiers. */ dquote \" xdstart {dquote} xdstop {dquote} xddouble {dquote}{dquote} xdinside [^"]+ /* Quoted identifier with Unicode escapes */ xuistart [uU]&{dquote} /* Quoted string with Unicode escapes */ xusstart [uU]&{quote} /* error rule to avoid backup */ xufailed [uU]& /* C-style comments * * The "extended comment" syntax closely resembles allowable operator syntax. * The tricky part here is to get lex to recognize a string starting with * slash-star as a comment, when interpreting it as an operator would produce * a longer match --- remember lex will prefer a longer match! Also, if we * have something like plus-slash-star, lex will think this is a 3-character * operator whereas we want to see it as a + operator and a comment start. * The solution is two-fold: * 1. append {op_chars}* to xcstart so that it matches as much text as * {operator} would. Then the tie-breaker (first matching rule of same * length) ensures xcstart wins. We put back the extra stuff with yyless() * in case it contains a star-slash that should terminate the comment. * 2. In the operator rule, check for slash-star within the operator, and * if found throw it back with yyless(). This handles the plus-slash-star * problem. * Dash-dash comments have similar interactions with the operator rule. */ xcstart \/\*{op_chars}* xcstop \*+\/ xcinside [^*/]+ ident_start [A-Za-z\200-\377_] ident_cont [A-Za-z\200-\377_0-9\$] identifier {ident_start}{ident_cont}* /* Assorted special-case operators and operator-like tokens */ typecast "::" dot_dot \.\. colon_equals ":=" /* * These operator-like tokens (unlike the above ones) also match the {operator} * rule, which means that they might be overridden by a longer match if they * are followed by a comment start or a + or - character. Accordingly, if you * add to this list, you must also add corresponding code to the {operator} * block to return the correct token in such cases. (This is not needed in * psqlscan.l since the token value is ignored there.) */ equals_greater "=>" less_equals "<=" greater_equals ">=" less_greater "<>" not_equals "!=" /* * "self" is the set of chars that should be returned as single-character * tokens. "op_chars" is the set of chars that can make up "Op" tokens, * which can be one or more characters long (but if a single-char token * appears in the "self" set, it is not to be returned as an Op). Note * that the sets overlap, but each has some chars that are not in the other. * * If you change either set, adjust the character lists appearing in the * rule for "operator"! */ self [,()\[\].;\:\+\-\*\/\%\^\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=] operator {op_chars}+ /* * Numbers * * Unary minus is not part of a number here. Instead we pass it separately to * the parser, and there it gets coerced via doNegate(). * * {numericfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. * * {realfail} is added to prevent the need for scanner * backup when the {real} rule fails to match completely. */ decdigit [0-9] hexdigit [0-9A-Fa-f] octdigit [0-7] bindigit [0-1] decinteger {decdigit}(_?{decdigit})* hexinteger 0[xX](_?{hexdigit})+ octinteger 0[oO](_?{octdigit})+ bininteger 0[bB](_?{bindigit})+ hexfail 0[xX]_? octfail 0[oO]_? binfail 0[bB]_? numeric (({decinteger}\.{decinteger}?)|(\.{decinteger})) numericfail {decdigit}+\.\. real ({decinteger}|{numeric})[Ee][-+]?{decinteger} realfail ({decinteger}|{numeric})[Ee][-+] decinteger_junk {decinteger}{ident_start} hexinteger_junk {hexinteger}{ident_start} octinteger_junk {octinteger}{ident_start} bininteger_junk {bininteger}{ident_start} numeric_junk {numeric}{ident_start} real_junk {real}{ident_start} param \${decinteger} param_junk \${decinteger}{ident_start} /* psql-specific: characters allowed in variable names */ variable_char [A-Za-z\200-\377_0-9] other . /* * Dollar quoted strings are totally opaque, and no escaping is done on them. * Other quoted strings must allow some special characters such as single-quote * and newline. * Embedded single-quotes are implemented both in the SQL standard * style of two adjacent single quotes "''" and in the Postgres/Java style * of escaped-quote "\'". * Other embedded escaped characters are matched explicitly and the leading * backslash is dropped from the string. * Note that xcstart must appear before operator, as explained above! * Also whitespace (comment) must appear before operator. */ %% %{ /* Declare some local variables inside yylex(), for convenience */ PsqlScanState cur_state = yyextra; PQExpBuffer output_buf = cur_state->output_buf; /* * Force flex into the state indicated by start_state. This has a * couple of purposes: it lets some of the functions below set a new * starting state without ugly direct access to flex variables, and it * allows us to transition from one flex lexer to another so that we * can lex different parts of the source string using separate lexers. */ BEGIN(cur_state->start_state); %} {whitespace} { /* * Note that the whitespace rule includes both true * whitespace and single-line ("--" style) comments. * We suppress whitespace until we have collected some * non-whitespace data. (This interacts with some * decisions in MainLoop(); see there for details.) */ if (output_buf->len > 0) ECHO; } {xcstart} { cur_state->xcdepth = 0; BEGIN(xc); /* Put back any characters past slash-star; see above */ yyless(2); ECHO; } { {xcstart} { cur_state->xcdepth++; /* Put back any characters past slash-star; see above */ yyless(2); ECHO; } {xcstop} { if (cur_state->xcdepth <= 0) BEGIN(INITIAL); else cur_state->xcdepth--; ECHO; } {xcinside} { ECHO; } {op_chars} { ECHO; } \*+ { ECHO; } } /* */ {xbstart} { BEGIN(xb); ECHO; } {xhinside} | {xbinside} { ECHO; } {xhstart} { /* Hexadecimal bit type. * At some point we should simply pass the string * forward to the parser and label it there. * In the meantime, place a leading "x" on the string * to mark it for the input routine as a hex string. */ BEGIN(xh); ECHO; } {xnstart} { yyless(1); /* eat only 'n' this time */ ECHO; } {xqstart} { if (cur_state->std_strings) BEGIN(xq); else BEGIN(xe); ECHO; } {xestart} { BEGIN(xe); ECHO; } {xusstart} { BEGIN(xus); ECHO; } {quote} { /* * When we are scanning a quoted string and see an end * quote, we must look ahead for a possible continuation. * If we don't see one, we know the end quote was in fact * the end of the string. To reduce the lexer table size, * we use a single "xqs" state to do the lookahead for all * types of strings. */ cur_state->state_before_str_stop = YYSTATE; BEGIN(xqs); ECHO; } {quotecontinue} { /* * Found a quote continuation, so return to the in-quote * state and continue scanning the literal. Nothing is * added to the literal's contents. */ BEGIN(cur_state->state_before_str_stop); ECHO; } {quotecontinuefail} | {other} { /* * Failed to see a quote continuation. Throw back * everything after the end quote, and handle the string * according to the state we were in previously. */ yyless(0); BEGIN(INITIAL); /* There's nothing to echo ... */ } {xqdouble} { ECHO; } {xqinside} { ECHO; } {xeinside} { ECHO; } {xeunicode} { ECHO; } {xeunicodefail} { ECHO; } {xeescape} { ECHO; } {xeoctesc} { ECHO; } {xehexesc} { ECHO; } . { /* This is only needed for \ just before EOF */ ECHO; } {dolqdelim} { cur_state->dolqstart = pg_strdup(yytext); BEGIN(xdolq); ECHO; } {dolqfailed} { /* throw back all but the initial "$" */ yyless(1); ECHO; } {dolqdelim} { if (strcmp(yytext, cur_state->dolqstart) == 0) { pfree(cur_state->dolqstart); cur_state->dolqstart = NULL; BEGIN(INITIAL); } else { /* * When we fail to match $...$ to dolqstart, transfer * the $... part to the output, but put back the final * $ for rescanning. Consider $delim$...$junk$delim$ */ yyless(yyleng - 1); } ECHO; } {dolqinside} { ECHO; } {dolqfailed} { ECHO; } . { /* This is only needed for $ inside the quoted text */ ECHO; } {xdstart} { BEGIN(xd); ECHO; } {xuistart} { BEGIN(xui); ECHO; } {xdstop} { BEGIN(INITIAL); ECHO; } {dquote} { BEGIN(INITIAL); ECHO; } {xddouble} { ECHO; } {xdinside} { ECHO; } {xufailed} { /* throw back all but the initial u/U */ yyless(1); ECHO; } {typecast} { ECHO; } {dot_dot} { ECHO; } {colon_equals} { ECHO; } {equals_greater} { ECHO; } {less_equals} { ECHO; } {greater_equals} { ECHO; } {less_greater} { ECHO; } {not_equals} { ECHO; } /* * These rules are specific to psql --- they implement parenthesis * counting and detection of command-ending semicolon. These must * appear before the {self} rule so that they take precedence over it. */ "(" { cur_state->paren_depth++; ECHO; } ")" { if (cur_state->paren_depth > 0) cur_state->paren_depth--; ECHO; } ";" { ECHO; if (cur_state->paren_depth == 0 && cur_state->begin_depth == 0) { /* Terminate lexing temporarily */ cur_state->start_state = YY_START; cur_state->identifier_count = 0; return LEXRES_SEMI; } } /* * psql-specific rules to handle backslash commands and variable * substitution. We want these before {self}, also. */ "\\"[;:] { /* Force a semi-colon or colon into the query buffer */ psqlscan_emit(cur_state, yytext + 1, 1); if (yytext[1] == ';') cur_state->identifier_count = 0; } "\\" { /* Terminate lexing temporarily */ cur_state->start_state = YY_START; return LEXRES_BACKSLASH; } :{variable_char}+ { /* Possible psql variable substitution */ char *varname; char *value; varname = psqlscan_extract_substring(cur_state, yytext + 1, yyleng - 1); if (cur_state->callbacks->get_variable) value = cur_state->callbacks->get_variable(varname, PQUOTE_PLAIN, cur_state->cb_passthrough); else value = NULL; if (value) { /* It is a variable, check for recursion */ if (psqlscan_var_is_current_source(cur_state, varname)) { /* Recursive expansion --- don't go there */ pg_log_warning("skipping recursive expansion of variable \"%s\"", varname); /* Instead copy the string as is */ ECHO; } else { /* OK, perform substitution */ psqlscan_push_new_buffer(cur_state, value, varname); /* yy_scan_string already made buffer active */ } pfree(value); } else { /* * if the variable doesn't exist we'll copy the string * as is */ ECHO; } pfree(varname); } :'{variable_char}+' { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_LITERAL); } :\"{variable_char}+\" { psqlscan_escape_variable(cur_state, yytext, yyleng, PQUOTE_SQL_IDENT); } :\{\?{variable_char}+\} { psqlscan_test_variable(cur_state, yytext, yyleng); } /* * These rules just avoid the need for scanner backup if one of the * three rules above fails to match completely. */ :'{variable_char}* { /* Throw back everything but the colon */ yyless(1); ECHO; } :\"{variable_char}* { /* Throw back everything but the colon */ yyless(1); ECHO; } :\{\?{variable_char}* { /* Throw back everything but the colon */ yyless(1); ECHO; } :\{ { /* Throw back everything but the colon */ yyless(1); ECHO; } /* * Back to backend-compatible rules. */ {self} { ECHO; } {operator} { /* * Check for embedded slash-star or dash-dash; those * are comment starts, so operator must stop there. * Note that slash-star or dash-dash at the first * character will match a prior rule, not this one. */ int nchars = yyleng; char *slashstar = strstr(yytext, "/*"); char *dashdash = strstr(yytext, "--"); if (slashstar && dashdash) { /* if both appear, take the first one */ if (slashstar > dashdash) slashstar = dashdash; } else if (!slashstar) slashstar = dashdash; if (slashstar) nchars = slashstar - yytext; /* * For SQL compatibility, '+' and '-' cannot be the * last char of a multi-char operator unless the operator * contains chars that are not in SQL operators. * The idea is to lex '=-' as two operators, but not * to forbid operator names like '?-' that could not be * sequences of SQL operators. */ if (nchars > 1 && (yytext[nchars - 1] == '+' || yytext[nchars - 1] == '-')) { int ic; for (ic = nchars - 2; ic >= 0; ic--) { char c = yytext[ic]; if (c == '~' || c == '!' || c == '@' || c == '#' || c == '^' || c == '&' || c == '|' || c == '`' || c == '?' || c == '%') break; } if (ic < 0) { /* * didn't find a qualifying character, so remove * all trailing [+-] */ do { nchars--; } while (nchars > 1 && (yytext[nchars - 1] == '+' || yytext[nchars - 1] == '-')); } } if (nchars < yyleng) { /* Strip the unwanted chars from the token */ yyless(nchars); } ECHO; } {param} { ECHO; } {param_junk} { ECHO; } {decinteger} { ECHO; } {hexinteger} { ECHO; } {octinteger} { ECHO; } {bininteger} { ECHO; } {hexfail} { ECHO; } {octfail} { ECHO; } {binfail} { ECHO; } {numeric} { ECHO; } {numericfail} { /* throw back the .., and treat as integer */ yyless(yyleng - 2); ECHO; } {real} { ECHO; } {realfail} { ECHO; } {decinteger_junk} { ECHO; } {hexinteger_junk} { ECHO; } {octinteger_junk} { ECHO; } {bininteger_junk} { ECHO; } {numeric_junk} { ECHO; } {real_junk} { ECHO; } {identifier} { /* * We need to track if we are inside a BEGIN .. END block * in a function definition, so that semicolons contained * therein don't terminate the whole statement. Short of * writing a full parser here, the following heuristic * should work. First, we track whether the beginning of * the statement matches CREATE [OR REPLACE] * {FUNCTION|PROCEDURE} */ if (cur_state->identifier_count == 0) memset(cur_state->identifiers, 0, sizeof(cur_state->identifiers)); if (pg_strcasecmp(yytext, "create") == 0 || pg_strcasecmp(yytext, "function") == 0 || pg_strcasecmp(yytext, "procedure") == 0 || pg_strcasecmp(yytext, "or") == 0 || pg_strcasecmp(yytext, "replace") == 0) { if (cur_state->identifier_count < sizeof(cur_state->identifiers)) cur_state->identifiers[cur_state->identifier_count] = pg_tolower((unsigned char) yytext[0]); } cur_state->identifier_count++; if (cur_state->identifiers[0] == 'c' && (cur_state->identifiers[1] == 'f' || cur_state->identifiers[1] == 'p' || (cur_state->identifiers[1] == 'o' && cur_state->identifiers[2] == 'r' && (cur_state->identifiers[3] == 'f' || cur_state->identifiers[3] == 'p'))) && cur_state->paren_depth == 0) { if (pg_strcasecmp(yytext, "begin") == 0) cur_state->begin_depth++; else if (pg_strcasecmp(yytext, "case") == 0) { /* * CASE also ends with END. We only need to track * this if we are already inside a BEGIN. */ if (cur_state->begin_depth >= 1) cur_state->begin_depth++; } else if (pg_strcasecmp(yytext, "end") == 0) { if (cur_state->begin_depth > 0) cur_state->begin_depth--; } } ECHO; } {other} { ECHO; } <> { if (cur_state->buffer_stack == NULL) { cur_state->start_state = YY_START; return LEXRES_EOL; /* end of input reached */ } /* * We were expanding a variable, so pop the inclusion * stack and keep lexing */ psqlscan_pop_buffer_stack(cur_state); psqlscan_select_top_buffer(cur_state); } %% /* LCOV_EXCL_STOP */ /* * Create a lexer working state struct. * * callbacks is a struct of function pointers that encapsulate some * behavior we need from the surrounding program. This struct must * remain valid for the lifespan of the PsqlScanState. */ PsqlScanState psql_scan_create(const PsqlScanCallbacks *callbacks) { PsqlScanState state; state = (PsqlScanStateData *) pg_malloc0(sizeof(PsqlScanStateData)); state->callbacks = callbacks; yylex_init(&state->scanner); yyset_extra(state, state->scanner); psql_scan_reset(state); return state; } /* * Destroy a lexer working state struct, releasing all resources. */ void psql_scan_destroy(PsqlScanState state) { psql_scan_finish(state); psql_scan_reset(state); yylex_destroy(state->scanner); pfree(state); } /* * Set the callback passthrough pointer for the lexer. * * This could have been integrated into psql_scan_create, but keeping it * separate allows the application to change the pointer later, which might * be useful. */ void psql_scan_set_passthrough(PsqlScanState state, void *passthrough) { state->cb_passthrough = passthrough; } /* * Set up to perform lexing of the given input line. * * The text at *line, extending for line_len bytes, will be scanned by * subsequent calls to the psql_scan routines. psql_scan_finish should * be called when scanning is complete. Note that the lexer retains * a pointer to the storage at *line --- this string must not be altered * or freed until after psql_scan_finish is called. * * encoding is the libpq identifier for the character encoding in use, * and std_strings says whether standard_conforming_strings is on. */ void psql_scan_setup(PsqlScanState state, const char *line, int line_len, int encoding, bool std_strings) { /* Mustn't be scanning already */ Assert(state->scanbufhandle == NULL); Assert(state->buffer_stack == NULL); /* Do we need to hack the character set encoding? */ state->encoding = encoding; state->safe_encoding = pg_valid_server_encoding_id(encoding); /* Save standard-strings flag as well */ state->std_strings = std_strings; /* Set up flex input buffer with appropriate translation and padding */ state->scanbufhandle = psqlscan_prepare_buffer(state, line, line_len, &state->scanbuf); state->scanline = line; /* Set lookaside data in case we have to map unsafe encoding */ state->curline = state->scanbuf; state->refline = state->scanline; } /* * Do lexical analysis of SQL command text. * * The text previously passed to psql_scan_setup is scanned, and appended * (possibly with transformation) to query_buf. * * The return value indicates the condition that stopped scanning: * * PSCAN_SEMICOLON: found a command-ending semicolon. (The semicolon is * transferred to query_buf.) The command accumulated in query_buf should * be executed, then clear query_buf and call again to scan the remainder * of the line. * * PSCAN_BACKSLASH: found a backslash that starts a special command. * Any previous data on the line has been transferred to query_buf. * The caller will typically next apply a separate flex lexer to scan * the special command. * * PSCAN_INCOMPLETE: the end of the line was reached, but we have an * incomplete SQL command. *prompt is set to the appropriate prompt type. * * PSCAN_EOL: the end of the line was reached, and there is no lexical * reason to consider the command incomplete. The caller may or may not * choose to send it. *prompt is set to the appropriate prompt type if * the caller chooses to collect more input. * * In the PSCAN_INCOMPLETE and PSCAN_EOL cases, psql_scan_finish() should * be called next, then the cycle may be repeated with a fresh input line. * * In all cases, *prompt is set to an appropriate prompt type code for the * next line-input operation. */ PsqlScanResult psql_scan(PsqlScanState state, PQExpBuffer query_buf, promptStatus_t *prompt) { PsqlScanResult result; int lexresult; /* Must be scanning already */ Assert(state->scanbufhandle != NULL); /* Set current output target */ state->output_buf = query_buf; /* Set input source */ if (state->buffer_stack != NULL) yy_switch_to_buffer(state->buffer_stack->buf, state->scanner); else yy_switch_to_buffer(state->scanbufhandle, state->scanner); /* And lex. */ lexresult = yylex(NULL, state->scanner); /* * Check termination state and return appropriate result info. */ switch (lexresult) { case LEXRES_EOL: /* end of input */ switch (state->start_state) { case INITIAL: case xqs: /* we treat this like INITIAL */ if (state->paren_depth > 0) { result = PSCAN_INCOMPLETE; *prompt = PROMPT_PAREN; } else if (state->begin_depth > 0) { result = PSCAN_INCOMPLETE; *prompt = PROMPT_CONTINUE; } else if (query_buf->len > 0) { result = PSCAN_EOL; *prompt = PROMPT_CONTINUE; } else { /* never bother to send an empty buffer */ result = PSCAN_INCOMPLETE; *prompt = PROMPT_READY; } break; case xb: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xc: result = PSCAN_INCOMPLETE; *prompt = PROMPT_COMMENT; break; case xd: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOUBLEQUOTE; break; case xh: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xe: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xq: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; case xdolq: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOLLARQUOTE; break; case xui: result = PSCAN_INCOMPLETE; *prompt = PROMPT_DOUBLEQUOTE; break; case xus: result = PSCAN_INCOMPLETE; *prompt = PROMPT_SINGLEQUOTE; break; default: /* can't get here */ fprintf(stderr, "invalid YY_START\n"); exit(1); } break; case LEXRES_SEMI: /* semicolon */ result = PSCAN_SEMICOLON; *prompt = PROMPT_READY; break; case LEXRES_BACKSLASH: /* backslash */ result = PSCAN_BACKSLASH; *prompt = PROMPT_READY; break; default: /* can't get here */ fprintf(stderr, "invalid yylex result\n"); exit(1); } return result; } /* * Clean up after scanning a string. This flushes any unread input and * releases resources (but not the PsqlScanState itself). Note however * that this does not reset the lexer scan state; that can be done by * psql_scan_reset(), which is an orthogonal operation. * * It is legal to call this when not scanning anything (makes it easier * to deal with error recovery). */ void psql_scan_finish(PsqlScanState state) { /* Drop any incomplete variable expansions. */ while (state->buffer_stack != NULL) psqlscan_pop_buffer_stack(state); /* Done with the outer scan buffer, too */ if (state->scanbufhandle) yy_delete_buffer(state->scanbufhandle, state->scanner); state->scanbufhandle = NULL; if (state->scanbuf) pfree(state->scanbuf); state->scanbuf = NULL; } /* * Reset lexer scanning state to start conditions. This is appropriate * for executing \r psql commands (or any other time that we discard the * prior contents of query_buf). It is not, however, necessary to do this * when we execute and clear the buffer after getting a PSCAN_SEMICOLON or * PSCAN_EOL scan result, because the scan state must be INITIAL when those * conditions are returned. * * Note that this is unrelated to flushing unread input; that task is * done by psql_scan_finish(). */ void psql_scan_reset(PsqlScanState state) { state->start_state = INITIAL; state->paren_depth = 0; state->xcdepth = 0; /* not really necessary */ if (state->dolqstart) pfree(state->dolqstart); state->dolqstart = NULL; state->identifier_count = 0; state->begin_depth = 0; } /* * Reselect this lexer (psqlscan.l) after using another one. * * Currently and for foreseeable uses, it's sufficient to reset to INITIAL * state, because we'd never switch to another lexer in a different state. * However, we don't want to reset e.g. paren_depth, so this can't be * the same as psql_scan_reset(). * * Note: psql setjmp error recovery just calls psql_scan_reset(), so that * must be a superset of this. * * Note: it seems likely that other lexers could just assign INITIAL for * themselves, since that probably has the value zero in every flex-generated * lexer. But let's not assume that. */ void psql_scan_reselect_sql_lexer(PsqlScanState state) { state->start_state = INITIAL; } /* * Return true if lexer is currently in an "inside quotes" state. * * This is pretty grotty but is needed to preserve the old behavior * that mainloop.c drops blank lines not inside quotes without even * echoing them. */ bool psql_scan_in_quote(PsqlScanState state) { return state->start_state != INITIAL && state->start_state != xqs; } /* * Push the given string onto the stack of stuff to scan. * * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer. */ void psqlscan_push_new_buffer(PsqlScanState state, const char *newstr, const char *varname) { StackElem *stackelem; stackelem = (StackElem *) pg_malloc(sizeof(StackElem)); /* * In current usage, the passed varname points at the current flex input * buffer; we must copy it before calling psqlscan_prepare_buffer() * because that will change the buffer state. */ stackelem->varname = varname ? pg_strdup(varname) : NULL; stackelem->buf = psqlscan_prepare_buffer(state, newstr, strlen(newstr), &stackelem->bufstring); state->curline = stackelem->bufstring; if (state->safe_encoding) { stackelem->origstring = NULL; state->refline = stackelem->bufstring; } else { stackelem->origstring = pg_strdup(newstr); state->refline = stackelem->origstring; } stackelem->next = state->buffer_stack; state->buffer_stack = stackelem; } /* * Pop the topmost buffer stack item (there must be one!) * * NB: after this, the flex input state is unspecified; caller must * switch to an appropriate buffer to continue lexing. * See psqlscan_select_top_buffer(). */ void psqlscan_pop_buffer_stack(PsqlScanState state) { StackElem *stackelem = state->buffer_stack; state->buffer_stack = stackelem->next; yy_delete_buffer(stackelem->buf, state->scanner); pfree(stackelem->bufstring); if (stackelem->origstring) pfree(stackelem->origstring); if (stackelem->varname) pfree(stackelem->varname); pfree(stackelem); } /* * Select the topmost surviving buffer as the active input. */ void psqlscan_select_top_buffer(PsqlScanState state) { StackElem *stackelem = state->buffer_stack; if (stackelem != NULL) { yy_switch_to_buffer(stackelem->buf, state->scanner); state->curline = stackelem->bufstring; state->refline = stackelem->origstring ? stackelem->origstring : stackelem->bufstring; } else { yy_switch_to_buffer(state->scanbufhandle, state->scanner); state->curline = state->scanbuf; state->refline = state->scanline; } } /* * Check if specified variable name is the source for any string * currently being scanned */ bool psqlscan_var_is_current_source(PsqlScanState state, const char *varname) { StackElem *stackelem; for (stackelem = state->buffer_stack; stackelem != NULL; stackelem = stackelem->next) { if (stackelem->varname && strcmp(stackelem->varname, varname) == 0) return true; } return false; } /* * Set up a flex input buffer to scan the given data. We always make a * copy of the data. If working in an unsafe encoding, the copy has * multibyte sequences replaced by FFs to avoid fooling the lexer rules. * * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer. */ YY_BUFFER_STATE psqlscan_prepare_buffer(PsqlScanState state, const char *txt, int len, char **txtcopy) { char *newtxt; /* Flex wants two \0 characters after the actual data */ newtxt = pg_malloc(len + 2); *txtcopy = newtxt; newtxt[len] = newtxt[len + 1] = YY_END_OF_BUFFER_CHAR; if (state->safe_encoding) memcpy(newtxt, txt, len); else { /* Gotta do it the hard way */ int i = 0; while (i < len) { int thislen = PQmblen(txt + i, state->encoding); /* first byte should always be okay... */ newtxt[i] = txt[i]; i++; while (--thislen > 0 && i < len) newtxt[i++] = (char) 0xFF; } } return yy_scan_buffer(newtxt, len + 2, state->scanner); } /* * psqlscan_emit() --- body for ECHO macro * * NB: this must be used for ALL and ONLY the text copied from the flex * input data. If you pass it something that is not part of the yytext * string, you are making a mistake. Internally generated text can be * appended directly to state->output_buf. */ void psqlscan_emit(PsqlScanState state, const char *txt, int len) { PQExpBuffer output_buf = state->output_buf; if (state->safe_encoding) appendBinaryPQExpBuffer(output_buf, txt, len); else { /* Gotta do it the hard way */ const char *reference = state->refline; int i; reference += (txt - state->curline); for (i = 0; i < len; i++) { char ch = txt[i]; if (ch == (char) 0xFF) ch = reference[i]; appendPQExpBufferChar(output_buf, ch); } } } /* * psqlscan_extract_substring --- fetch value of (part of) the current token * * This is like psqlscan_emit(), except that the data is returned as a * malloc'd string rather than being pushed directly to state->output_buf. */ char * psqlscan_extract_substring(PsqlScanState state, const char *txt, int len) { char *result = (char *) pg_malloc(len + 1); if (state->safe_encoding) memcpy(result, txt, len); else { /* Gotta do it the hard way */ const char *reference = state->refline; int i; reference += (txt - state->curline); for (i = 0; i < len; i++) { char ch = txt[i]; if (ch == (char) 0xFF) ch = reference[i]; result[i] = ch; } } result[len] = '\0'; return result; } /* * psqlscan_escape_variable --- process :'VARIABLE' or :"VARIABLE" * * If the variable name is found, escape its value using the appropriate * quoting method and emit the value to output_buf. (Since the result is * surely quoted, there is never any reason to rescan it.) If we don't * find the variable or escaping fails, emit the token as-is. */ void psqlscan_escape_variable(PsqlScanState state, const char *txt, int len, PsqlScanQuoteType quote) { char *varname; char *value; /* Variable lookup. */ varname = psqlscan_extract_substring(state, txt + 2, len - 3); if (state->callbacks->get_variable) value = state->callbacks->get_variable(varname, quote, state->cb_passthrough); else value = NULL; pfree(varname); if (value) { /* Emit the suitably-escaped value */ appendPQExpBufferStr(state->output_buf, value); pfree(value); } else { /* Emit original token as-is */ psqlscan_emit(state, txt, len); } } void psqlscan_test_variable(PsqlScanState state, const char *txt, int len) { char *varname; char *value; varname = psqlscan_extract_substring(state, txt + 3, len - 4); if (state->callbacks->get_variable) value = state->callbacks->get_variable(varname, PQUOTE_PLAIN, state->cb_passthrough); else value = NULL; pfree(varname); if (value != NULL) { psqlscan_emit(state, "TRUE", 4); pfree(value); } else { psqlscan_emit(state, "FALSE", 5); } } /* * "Safe" wrapper around strdup() using palloc(). * For pgpool backend. */ static char * pg_strdup(const char *in) { char *tmp; if (!in) { ereport(ERROR, (errmsg("cannot duplicate null pointer (internal error)"))); } tmp = pstrdup(in); if (!tmp) { ereport(ERROR, (errmsg("out of memory"))); } return tmp; } #undef pg_log_warning #undef pg_malloc #undef pg_malloc0 pgpool-II-4.6.0/src/utils/pgstrcasecmp.c0000664000175000017500000000710314760007565015044 00000000000000/*------------------------------------------------------------------------- * * pgstrcasecmp.c * Portable SQL-like case-independent comparisons and conversions. * * SQL99 specifies Unicode-aware case normalization, which we don't yet * have the infrastructure for. Instead we use tolower() to provide a * locale-aware translation. However, there are some locales where this * is not right either (eg, Turkish may do strange things with 'i' and * 'I'). Our current compromise is to use tolower() for characters with * the high bit set, and use an ASCII-only downcasing for 7-bit * characters. * * NB: this code should match downcase_truncate_identifier() in scansup.c. * * We also provide strict ASCII-only case conversion functions, which can * be used to implement C/POSIX case folding semantics no matter what the * C library thinks the locale is. * * * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * * src/port/pgstrcasecmp.c * *------------------------------------------------------------------------- */ #include #include #include "pool.h" #include "utils/pgstrcasecmp.h" /* * Case-independent comparison of two null-terminated strings. */ int pg_strcasecmp(const char *s1, const char *s2) { for (;;) { unsigned char ch1 = (unsigned char) *s1++; unsigned char ch2 = (unsigned char) *s2++; if (ch1 != ch2) { if (ch1 >= 'A' && ch1 <= 'Z') ch1 += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch1) && isupper(ch1)) ch1 = tolower(ch1); if (ch2 >= 'A' && ch2 <= 'Z') ch2 += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch2) && isupper(ch2)) ch2 = tolower(ch2); if (ch1 != ch2) return (int) ch1 - (int) ch2; } if (ch1 == 0) break; } return 0; } /* * Case-independent comparison of two not-necessarily-null-terminated strings. * At most n bytes will be examined from each string. */ int pg_strncasecmp(const char *s1, const char *s2, size_t n) { while (n-- > 0) { unsigned char ch1 = (unsigned char) *s1++; unsigned char ch2 = (unsigned char) *s2++; if (ch1 != ch2) { if (ch1 >= 'A' && ch1 <= 'Z') ch1 += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch1) && isupper(ch1)) ch1 = tolower(ch1); if (ch2 >= 'A' && ch2 <= 'Z') ch2 += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch2) && isupper(ch2)) ch2 = tolower(ch2); if (ch1 != ch2) return (int) ch1 - (int) ch2; } if (ch1 == 0) break; } return 0; } /* * Fold a character to upper case. * * Unlike some versions of toupper(), this is safe to apply to characters * that aren't lower case letters. Note however that the whole thing is * a bit bogus for multibyte character sets. */ unsigned char pg_toupper(unsigned char ch) { if (ch >= 'a' && ch <= 'z') ch += 'A' - 'a'; else if (IS_HIGHBIT_SET(ch) && islower(ch)) ch = toupper(ch); return ch; } /* * Fold a character to lower case. * * Unlike some versions of tolower(), this is safe to apply to characters * that aren't upper case letters. Note however that the whole thing is * a bit bogus for multibyte character sets. */ unsigned char pg_tolower(unsigned char ch) { if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; else if (IS_HIGHBIT_SET(ch) && isupper(ch)) ch = tolower(ch); return ch; } /* * Fold a character to upper case, following C/POSIX locale rules. */ unsigned char pg_ascii_toupper(unsigned char ch) { if (ch >= 'a' && ch <= 'z') ch += 'A' - 'a'; return ch; } /* * Fold a character to lower case, following C/POSIX locale rules. */ unsigned char pg_ascii_tolower(unsigned char ch) { if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; return ch; } pgpool-II-4.6.0/src/utils/sprompt.c0000664000175000017500000001127014760001620014037 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.6.0/src/Makefile.in0000664000175000017500000012332714760010050013100 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 \ config/pool_config.c utils/psqlscan.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 = $(install_sh) -d 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) \ main/pool_internal_comms.$(OBJEXT) \ main/pgpool_logger.$(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_pg_utils.$(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/socket_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) \ utils/pool_health_check_stats.$(OBJEXT) \ utils/psqlscan.$(OBJEXT) utils/pgstrcasecmp.$(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@ AR_FLAGS = @AR_FLAGS@ 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)\" \ -DPGSQL_BIN_DIR=\"$(PGSQL_BIN_DIR)\" 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 \ main/pool_internal_comms.c \ main/pgpool_logger.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_pg_utils.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/socket_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 \ utils/pool_health_check_stats.c \ utils/psqlscan.l \ utils/pgstrcasecmp.c sysconf_DATA = sample/pgpool.conf.sample \ sample/pcp.conf.sample \ sample/pool_hba.conf.sample \ sample/scripts/failover.sh.sample \ sample/scripts/follow_primary.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_2nd_stage.sample \ sample/scripts/escalation.sh.sample \ sample/scripts/aws_eip_if_cmd.sh.sample \ sample/scripts/aws_rtb_if_cmd.sh.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_primary.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_2nd_stage.sample \ sample/scripts/escalation.sh.sample \ sample/scripts/aws_eip_if_cmd.sh.sample \ sample/scripts/aws_rtb_if_cmd.sh.sample \ sample/pgpool.conf.sample sample/pool_hba.conf.sample \ 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.4.sql \ sql/pgpool-recovery/pgpool_recovery--1.3--1.4.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/pgpool_adm--1.3.sql \ sql/pgpool_adm/pgpool_adm--1.2--1.3.sql \ sql/pgpool_adm/pgpool_adm--1.4.sql \ sql/pgpool_adm/pgpool_adm--1.3--1.4.sql \ sql/pgpool_adm/pgpool_adm--1.5.sql \ sql/pgpool_adm/pgpool_adm--1.4--1.5.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/pcp_unix_domain_path.patch \ redhat/pgpool_log.patch \ redhat/pgpool.service \ redhat/pgpool_socket_dir.patch \ redhat/pgpool_sudoers.d \ redhat/pgpool_tmpfiles.d \ 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) main/pool_internal_comms.$(OBJEXT): main/$(am__dirstamp) main/pgpool_logger.$(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_pg_utils.$(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/socket_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) utils/pool_health_check_stats.$(OBJEXT): utils/$(am__dirstamp) utils/psqlscan.$(OBJEXT): utils/$(am__dirstamp) utils/pgstrcasecmp.$(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 -rm -f utils/psqlscan.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 utils/psqlscan.c: utils/psqlscan.l $(LEX) -o'utils/psqlscan.c' $< config/pool_config.c: config/pool_config.l $(LEX) -o'config/pool_config.c' $< %: %.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.6.0/src/Makefile.am0000664000175000017500000001613714760007565013110 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 \ main/pool_internal_comms.c \ main/pgpool_logger.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_pg_utils.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/socket_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 \ utils/pool_health_check_stats.c \ utils/psqlscan.l \ utils/pgstrcasecmp.c utils/psqlscan.c: utils/psqlscan.l $(LEX) -o'utils/psqlscan.c' $< config/pool_config.c: config/pool_config.l $(LEX) -o'config/pool_config.c' $< DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" \ -DPGSQL_BIN_DIR=\"$(PGSQL_BIN_DIR)\" sysconf_DATA = sample/pgpool.conf.sample \ sample/pcp.conf.sample \ sample/pool_hba.conf.sample \ sample/scripts/failover.sh.sample \ sample/scripts/follow_primary.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_2nd_stage.sample \ sample/scripts/escalation.sh.sample \ sample/scripts/aws_eip_if_cmd.sh.sample \ sample/scripts/aws_rtb_if_cmd.sh.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_primary.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_1st_stage.sample \ sample/scripts/replication_mode_recovery_2nd_stage.sample \ sample/scripts/escalation.sh.sample \ sample/scripts/aws_eip_if_cmd.sh.sample \ sample/scripts/aws_rtb_if_cmd.sh.sample \ sample/pgpool.conf.sample sample/pool_hba.conf.sample \ 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.4.sql \ sql/pgpool-recovery/pgpool_recovery--1.3--1.4.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/pgpool_adm--1.3.sql \ sql/pgpool_adm/pgpool_adm--1.2--1.3.sql \ sql/pgpool_adm/pgpool_adm--1.4.sql \ sql/pgpool_adm/pgpool_adm--1.3--1.4.sql \ sql/pgpool_adm/pgpool_adm--1.5.sql \ sql/pgpool_adm/pgpool_adm--1.4--1.5.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/pcp_unix_domain_path.patch \ redhat/pgpool_log.patch \ redhat/pgpool.service \ redhat/pgpool_socket_dir.patch \ redhat/pgpool_sudoers.d \ redhat/pgpool_tmpfiles.d \ 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.6.0/src/pgpool.spec0000664000175000017500000004620614760007565013230 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 .rhel7" --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 .rhel7" --define="pgsql_ver 110" # # RPM names 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 %global _varlogdir %{_localstatedir}/log/pgpool_log 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.pgpool.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 Source5: pgpool_tmpfiles.d Source6: pgpool_sudoers.d %if %{pgsql_ver} >=94 && %{rhel} >= 7 Patch1: pgpool_socket_dir.patch Patch2: pcp_unix_domain_path.patch %endif Patch3: pgpool_log.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: postgresql%{pg_version}-devel pam-devel openssl-devel jade libxslt docbook-dtds docbook-style-xsl docbook-style-dsssl openldap-devel %if %{rhel} >= 9 BuildRequires: libmemcached-awesome-devel %else BuildRequires: libmemcached-devel %endif %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: PostgreSQL extensions for pgpool-II Group: Applications/Databases %description extensions PostgreSQL extensions libraries and sql files for pgpool-II. %prep %setup -q -n %{archive_name} %if %{pgsql_ver} >=94 && %{rhel} >= 7 %patch1 -p0 %patch2 -p0 %endif %patch3 -p0 %build %configure --with-pgsql=%{pghome} \ --disable-static \ --with-pam \ --with-openssl \ --with-ldap \ --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} install -d %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts mv %{buildroot}%{_sysconfdir}/%{short_name}/failover.sh.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/failover.sh.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/follow_primary.sh.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/follow_primary.sh.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/pgpool_remote_start.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/pgpool_remote_start.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/recovery_1st_stage.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/recovery_1st_stage.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/replication_mode_recovery_1st_stage.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_1st_stage.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/replication_mode_recovery_2nd_stage.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_2nd_stage.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/escalation.sh.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/escalation.sh.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/aws_eip_if_cmd.sh.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/aws_eip_if_cmd.sh.sample mv %{buildroot}%{_sysconfdir}/%{short_name}/aws_rtb_if_cmd.sh.sample \ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/aws_rtb_if_cmd.sh.sample 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 touch %{buildroot}%{_sysconfdir}/%{short_name}/pgpool_node_id %if %{systemd_enabled} install -d %{buildroot}%{_unitdir} install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/pgpool.service install -d -m 755 %{buildroot}%{_varrundir} mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf %else install -d %{buildroot}%{_initrddir} install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/pgpool %endif mkdir -p %{buildroot}%{_varlogdir} install -d %{buildroot}%{_sysconfdir}/sysconfig %if 0%{rhel} && 0%{rhel} <= 6 install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool %else install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/pgpool %endif # install sudoers.d to allow postgres user to run ip and arping with root privileges without a password install -d %{buildroot}%{_sysconfdir}/sudoers.d install -m 0440 %{SOURCE6} %{buildroot}%{_sysconfdir}/sudoers.d/pgpool # nuke libtool archive and static lib rm -f %{buildroot}%{_libdir}/libpcp.{a,la} mkdir html mv doc/src/sgml/html html/en mv doc.ja/src/sgml/html html/ja install -d %{buildroot}%{_mandir}/man1 install doc/src/sgml/man1/*.1 %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man8 install doc/src/sgml/man8/*.8 %{buildroot}%{_mandir}/man8 %clean rm -rf %{buildroot} %pre groupadd -g 26 -o -r postgres >/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 %if %{systemd_enabled} %systemd_post pgpool.service %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}/pcp_reload_config %{_bindir}/pcp_health_check_stats %{_bindir}/pcp_log_rotate %{_bindir}/pcp_invalidate_query_cache %{_bindir}/pg_md5 %{_bindir}/pg_enc %{_bindir}/pgpool_setup %{_bindir}/watchdog_setup %{_bindir}/pgproto %{_bindir}/wd_cli %{_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} %attr(755,postgres,postgres) %dir %{_varrundir} %{_tmpfilesdir}/%{name}.conf %{_sysconfdir}/sudoers.d/pgpool %{_unitdir}/pgpool.service %else %{_initrddir}/pgpool %endif %attr(0755,postgres,postgres) %dir %{_varlogdir} %defattr(600,postgres,postgres,-) %{_sysconfdir}/%{short_name}/pgpool.conf.sample %{_sysconfdir}/%{short_name}/pcp.conf.sample %{_sysconfdir}/%{short_name}/pool_hba.conf.sample %defattr(755,postgres,postgres,-) %{_sysconfdir}/%{short_name}/sample_scripts/failover.sh.sample %{_sysconfdir}/%{short_name}/sample_scripts/follow_primary.sh.sample %{_sysconfdir}/%{short_name}/sample_scripts/pgpool_remote_start.sample %{_sysconfdir}/%{short_name}/sample_scripts/recovery_1st_stage.sample %{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_1st_stage.sample %{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_2nd_stage.sample %{_sysconfdir}/%{short_name}/sample_scripts/escalation.sh.sample %{_sysconfdir}/%{short_name}/sample_scripts/aws_eip_if_cmd.sh.sample %{_sysconfdir}/%{short_name}/sample_scripts/aws_rtb_if_cmd.sh.sample %attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf %attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/pool_passwd %attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/pgpool_node_id %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--1.4.sql %{pghome}/share/extension/pgpool_recovery--1.3--1.4.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--1.3.sql %{pghome}/share/extension/pgpool_adm--1.2--1.3.sql %{pghome}/share/extension/pgpool_adm--1.4.sql %{pghome}/share/extension/pgpool_adm--1.3--1.4.sql %{pghome}/share/extension/pgpool_adm--1.5.sql %{pghome}/share/extension/pgpool_adm--1.4--1.5.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 PostgreSQL 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 * Wed Nov 2 2022 Bo Peng 4.4.0 - Change /lib/tmpfiles.d/ file from /var/run to /run - Install /etc/sudoers.d/pgpool - Add scripts aws_eip_if_cmd.sh.sample and aws_rtb_if_cmd.sh.sample * Thu Sep 10 2020 Bo Peng 4.2.0 - Update to 4.2 * 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 extension 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 pgpool-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.6.0/src/parser/0000775000175000017500000000000014760010077012410 500000000000000pgpool-II-4.6.0/src/parser/Makefile.in0000664000175000017500000004764314760010051014403 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 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 = $(install_sh) -d 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 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) 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@ AR_FLAGS = @AR_FLAGS@ 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 \ 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.l ARFLAGS = cr AM_YFLAGS = -d -Wno-yacc 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.6.0/src/parser/Makefile.am0000664000175000017500000000164514760007565014402 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 \ 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.l ARFLAGS = cr AM_YFLAGS = -d -Wno-yacc 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.6.0/src/parser/gram.h0000664000175000017500000005673514760010074013444 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, UIDENT = 259, FCONST = 260, SCONST = 261, USCONST = 262, BCONST = 263, XCONST = 264, Op = 265, ICONST = 266, PARAM = 267, TYPECAST = 268, DOT_DOT = 269, COLON_EQUALS = 270, EQUALS_GREATER = 271, LESS_EQUALS = 272, GREATER_EQUALS = 273, NOT_EQUALS = 274, ABORT_P = 275, ABSENT = 276, ABSOLUTE_P = 277, ACCESS = 278, ACTION = 279, ADD_P = 280, ADMIN = 281, AFTER = 282, AGGREGATE = 283, ALL = 284, ALSO = 285, ALTER = 286, ALWAYS = 287, ANALYSE = 288, ANALYZE = 289, AND = 290, ANY = 291, ARRAY = 292, AS = 293, ASC = 294, ASENSITIVE = 295, ASSERTION = 296, ASSIGNMENT = 297, ASYMMETRIC = 298, ATOMIC = 299, AT = 300, ATTACH = 301, ATTRIBUTE = 302, AUTHORIZATION = 303, BACKWARD = 304, BEFORE = 305, BEGIN_P = 306, BETWEEN = 307, BIGINT = 308, BINARY = 309, BIT = 310, BOOLEAN_P = 311, BOTH = 312, BREADTH = 313, BY = 314, CACHE = 315, CALL = 316, CALLED = 317, CASCADE = 318, CASCADED = 319, CASE = 320, CAST = 321, CATALOG_P = 322, CHAIN = 323, CHAR_P = 324, CHARACTER = 325, CHARACTERISTICS = 326, CHECK = 327, CHECKPOINT = 328, CLASS = 329, CLOSE = 330, CLUSTER = 331, COALESCE = 332, COLLATE = 333, COLLATION = 334, COLUMN = 335, COLUMNS = 336, COMMENT = 337, COMMENTS = 338, COMMIT = 339, COMMITTED = 340, COMPRESSION = 341, CONCURRENTLY = 342, CONDITIONAL = 343, CONFIGURATION = 344, CONFLICT = 345, CONNECTION = 346, CONSTRAINT = 347, CONSTRAINTS = 348, CONTENT_P = 349, CONTINUE_P = 350, CONVERSION_P = 351, COPY = 352, COST = 353, CREATE = 354, CROSS = 355, CSV = 356, CUBE = 357, CURRENT_P = 358, CURRENT_CATALOG = 359, CURRENT_DATE = 360, CURRENT_ROLE = 361, CURRENT_SCHEMA = 362, CURRENT_TIME = 363, CURRENT_TIMESTAMP = 364, CURRENT_USER = 365, CURSOR = 366, CYCLE = 367, DATA_P = 368, DATABASE = 369, DAY_P = 370, DEALLOCATE = 371, DEC = 372, DECIMAL_P = 373, DECLARE = 374, DEFAULT = 375, DEFAULTS = 376, DEFERRABLE = 377, DEFERRED = 378, DEFINER = 379, DELETE_P = 380, DELIMITER = 381, DELIMITERS = 382, DEPENDS = 383, DEPTH = 384, DESC = 385, DETACH = 386, DICTIONARY = 387, DISABLE_P = 388, DISCARD = 389, DISTINCT = 390, DO = 391, DOCUMENT_P = 392, DOMAIN_P = 393, DOUBLE_P = 394, DROP = 395, EACH = 396, ELSE = 397, EMPTY_P = 398, ENABLE_P = 399, ENCODING = 400, ENCRYPTED = 401, END_P = 402, ENUM_P = 403, ERROR_P = 404, ESCAPE = 405, EVENT = 406, EXCEPT = 407, EXCLUDE = 408, EXCLUDING = 409, EXCLUSIVE = 410, EXECUTE = 411, EXISTS = 412, EXPLAIN = 413, EXPRESSION = 414, EXTENSION = 415, EXTERNAL = 416, EXTRACT = 417, FALSE_P = 418, FAMILY = 419, FETCH = 420, FILTER = 421, FINALIZE = 422, FIRST_P = 423, FLOAT_P = 424, FOLLOWING = 425, FOR = 426, FORCE = 427, FOREIGN = 428, FORMAT = 429, FORWARD = 430, FREEZE = 431, FROM = 432, FULL = 433, FUNCTION = 434, FUNCTIONS = 435, GENERATED = 436, GLOBAL = 437, GRANT = 438, GRANTED = 439, GREATEST = 440, GROUP_P = 441, GROUPING = 442, GROUPS = 443, HANDLER = 444, HAVING = 445, HEADER_P = 446, HOLD = 447, HOUR_P = 448, IDENTITY_P = 449, IF_P = 450, ILIKE = 451, IMMEDIATE = 452, IMMUTABLE = 453, IMPLICIT_P = 454, IMPORT_P = 455, IN_P = 456, INCLUDE = 457, INCLUDING = 458, INCREMENT = 459, INDENT = 460, INDEX = 461, INDEXES = 462, INHERIT = 463, INHERITS = 464, INITIALLY = 465, INLINE_P = 466, INNER_P = 467, INOUT = 468, INPUT_P = 469, INSENSITIVE = 470, INSERT = 471, INSTEAD = 472, INT_P = 473, INTEGER = 474, INTERSECT = 475, INTERVAL = 476, INTO = 477, INVOKER = 478, IS = 479, ISNULL = 480, ISOLATION = 481, JOIN = 482, JSON = 483, JSON_ARRAY = 484, JSON_ARRAYAGG = 485, JSON_EXISTS = 486, JSON_OBJECT = 487, JSON_OBJECTAGG = 488, JSON_QUERY = 489, JSON_SCALAR = 490, JSON_SERIALIZE = 491, JSON_TABLE = 492, JSON_VALUE = 493, KEEP = 494, KEY = 495, KEYS = 496, LABEL = 497, LANGUAGE = 498, LARGE_P = 499, LAST_P = 500, LATERAL_P = 501, LEADING = 502, LEAKPROOF = 503, LEAST = 504, LEFT = 505, LEVEL = 506, LIKE = 507, LIMIT = 508, LISTEN = 509, LOAD = 510, LOCAL = 511, LOCALTIME = 512, LOCALTIMESTAMP = 513, LOCATION = 514, LOCK_P = 515, LOCKED = 516, LOGGED = 517, MAPPING = 518, MATCH = 519, MATCHED = 520, MATERIALIZED = 521, MAXVALUE = 522, MERGE = 523, MERGE_ACTION = 524, METHOD = 525, MINUTE_P = 526, MINVALUE = 527, MODE = 528, MONTH_P = 529, MOVE = 530, NAME_P = 531, NAMES = 532, NATIONAL = 533, NATURAL = 534, NCHAR = 535, NESTED = 536, NEW = 537, NEXT = 538, NFC = 539, NFD = 540, NFKC = 541, NFKD = 542, NO = 543, NONE = 544, NORMALIZE = 545, NORMALIZED = 546, NOT = 547, NOTHING = 548, NOTIFY = 549, NOTNULL = 550, NOWAIT = 551, NULL_P = 552, NULLIF = 553, NULLS_P = 554, NUMERIC = 555, OBJECT_P = 556, OF = 557, OFF = 558, OFFSET = 559, OIDS = 560, OLD = 561, OMIT = 562, ON = 563, ONLY = 564, OPERATOR = 565, OPTION = 566, OPTIONS = 567, OR = 568, ORDER = 569, ORDINALITY = 570, OTHERS = 571, OUT_P = 572, OUTER_P = 573, OVER = 574, OVERLAPS = 575, OVERLAY = 576, OVERRIDING = 577, OWNED = 578, OWNER = 579, PARALLEL = 580, PARAMETER = 581, PARSER = 582, PARTIAL = 583, PARTITION = 584, PASSING = 585, PASSWORD = 586, PATH = 587, PGPOOL = 588, PLACING = 589, PLAN = 590, PLANS = 591, POLICY = 592, POSITION = 593, PRECEDING = 594, PRECISION = 595, PRESERVE = 596, PREPARE = 597, PREPARED = 598, PRIMARY = 599, PRIOR = 600, PRIVILEGES = 601, PROCEDURAL = 602, PROCEDURE = 603, PROCEDURES = 604, PROGRAM = 605, PUBLICATION = 606, QUOTE = 607, QUOTES = 608, RANGE = 609, READ = 610, REAL = 611, REASSIGN = 612, RECHECK = 613, RECURSIVE = 614, REF_P = 615, REFERENCES = 616, REFERENCING = 617, REFRESH = 618, REINDEX = 619, RELATIVE_P = 620, RELEASE = 621, RENAME = 622, REPEATABLE = 623, REPLACE = 624, REPLICA = 625, RESET = 626, RESTART = 627, RESTRICT = 628, RETURN = 629, RETURNING = 630, RETURNS = 631, REVOKE = 632, RIGHT = 633, ROLE = 634, ROLLBACK = 635, ROLLUP = 636, ROUTINE = 637, ROUTINES = 638, ROW = 639, ROWS = 640, RULE = 641, SAVEPOINT = 642, SCALAR = 643, SCHEMA = 644, SCHEMAS = 645, SCROLL = 646, SEARCH = 647, SECOND_P = 648, SECURITY = 649, SELECT = 650, SEQUENCE = 651, SEQUENCES = 652, SERIALIZABLE = 653, SERVER = 654, SESSION = 655, SESSION_USER = 656, SET = 657, SETS = 658, SETOF = 659, SHARE = 660, SHOW = 661, SIMILAR = 662, SIMPLE = 663, SKIP = 664, SMALLINT = 665, SNAPSHOT = 666, SOME = 667, SOURCE = 668, SQL_P = 669, STABLE = 670, STANDALONE_P = 671, START = 672, STATEMENT = 673, STATISTICS = 674, STDIN = 675, STDOUT = 676, STORAGE = 677, STORED = 678, STRICT_P = 679, STRING_P = 680, STRIP_P = 681, SUBSCRIPTION = 682, SUBSTRING = 683, SUPPORT = 684, SYMMETRIC = 685, SYSID = 686, SYSTEM_P = 687, SYSTEM_USER = 688, TABLE = 689, TABLES = 690, TABLESAMPLE = 691, TABLESPACE = 692, TARGET = 693, TEMP = 694, TEMPLATE = 695, TEMPORARY = 696, TEXT_P = 697, THEN = 698, TIES = 699, TIME = 700, TIMESTAMP = 701, TO = 702, TRAILING = 703, TRANSACTION = 704, TRANSFORM = 705, TREAT = 706, TRIGGER = 707, TRIM = 708, TRUE_P = 709, TRUNCATE = 710, TRUSTED = 711, TYPE_P = 712, TYPES_P = 713, UESCAPE = 714, UNBOUNDED = 715, UNCONDITIONAL = 716, UNCOMMITTED = 717, UNENCRYPTED = 718, UNION = 719, UNIQUE = 720, UNKNOWN = 721, UNLISTEN = 722, UNLOGGED = 723, UNTIL = 724, UPDATE = 725, USER = 726, USING = 727, VACUUM = 728, VALID = 729, VALIDATE = 730, VALIDATOR = 731, VALUE_P = 732, VALUES = 733, VARCHAR = 734, VARIADIC = 735, VARYING = 736, VERBOSE = 737, VERSION_P = 738, VIEW = 739, VIEWS = 740, VOLATILE = 741, WHEN = 742, WHERE = 743, WHITESPACE_P = 744, WINDOW = 745, WITH = 746, WITHIN = 747, WITHOUT = 748, WORK = 749, WRAPPER = 750, WRITE = 751, XML_P = 752, XMLATTRIBUTES = 753, XMLCONCAT = 754, XMLELEMENT = 755, XMLEXISTS = 756, XMLFOREST = 757, XMLNAMESPACES = 758, XMLPARSE = 759, XMLPI = 760, XMLROOT = 761, XMLSERIALIZE = 762, XMLTABLE = 763, YEAR_P = 764, YES_P = 765, ZONE = 766, FORMAT_LA = 767, NOT_LA = 768, NULLS_LA = 769, WITH_LA = 770, WITHOUT_LA = 771, MODE_TYPE_NAME = 772, MODE_PLPGSQL_EXPR = 773, MODE_PLPGSQL_ASSIGN1 = 774, MODE_PLPGSQL_ASSIGN2 = 775, MODE_PLPGSQL_ASSIGN3 = 776, UMINUS = 777 }; #endif /* Tokens. */ #define IDENT 258 #define UIDENT 259 #define FCONST 260 #define SCONST 261 #define USCONST 262 #define BCONST 263 #define XCONST 264 #define Op 265 #define ICONST 266 #define PARAM 267 #define TYPECAST 268 #define DOT_DOT 269 #define COLON_EQUALS 270 #define EQUALS_GREATER 271 #define LESS_EQUALS 272 #define GREATER_EQUALS 273 #define NOT_EQUALS 274 #define ABORT_P 275 #define ABSENT 276 #define ABSOLUTE_P 277 #define ACCESS 278 #define ACTION 279 #define ADD_P 280 #define ADMIN 281 #define AFTER 282 #define AGGREGATE 283 #define ALL 284 #define ALSO 285 #define ALTER 286 #define ALWAYS 287 #define ANALYSE 288 #define ANALYZE 289 #define AND 290 #define ANY 291 #define ARRAY 292 #define AS 293 #define ASC 294 #define ASENSITIVE 295 #define ASSERTION 296 #define ASSIGNMENT 297 #define ASYMMETRIC 298 #define ATOMIC 299 #define AT 300 #define ATTACH 301 #define ATTRIBUTE 302 #define AUTHORIZATION 303 #define BACKWARD 304 #define BEFORE 305 #define BEGIN_P 306 #define BETWEEN 307 #define BIGINT 308 #define BINARY 309 #define BIT 310 #define BOOLEAN_P 311 #define BOTH 312 #define BREADTH 313 #define BY 314 #define CACHE 315 #define CALL 316 #define CALLED 317 #define CASCADE 318 #define CASCADED 319 #define CASE 320 #define CAST 321 #define CATALOG_P 322 #define CHAIN 323 #define CHAR_P 324 #define CHARACTER 325 #define CHARACTERISTICS 326 #define CHECK 327 #define CHECKPOINT 328 #define CLASS 329 #define CLOSE 330 #define CLUSTER 331 #define COALESCE 332 #define COLLATE 333 #define COLLATION 334 #define COLUMN 335 #define COLUMNS 336 #define COMMENT 337 #define COMMENTS 338 #define COMMIT 339 #define COMMITTED 340 #define COMPRESSION 341 #define CONCURRENTLY 342 #define CONDITIONAL 343 #define CONFIGURATION 344 #define CONFLICT 345 #define CONNECTION 346 #define CONSTRAINT 347 #define CONSTRAINTS 348 #define CONTENT_P 349 #define CONTINUE_P 350 #define CONVERSION_P 351 #define COPY 352 #define COST 353 #define CREATE 354 #define CROSS 355 #define CSV 356 #define CUBE 357 #define CURRENT_P 358 #define CURRENT_CATALOG 359 #define CURRENT_DATE 360 #define CURRENT_ROLE 361 #define CURRENT_SCHEMA 362 #define CURRENT_TIME 363 #define CURRENT_TIMESTAMP 364 #define CURRENT_USER 365 #define CURSOR 366 #define CYCLE 367 #define DATA_P 368 #define DATABASE 369 #define DAY_P 370 #define DEALLOCATE 371 #define DEC 372 #define DECIMAL_P 373 #define DECLARE 374 #define DEFAULT 375 #define DEFAULTS 376 #define DEFERRABLE 377 #define DEFERRED 378 #define DEFINER 379 #define DELETE_P 380 #define DELIMITER 381 #define DELIMITERS 382 #define DEPENDS 383 #define DEPTH 384 #define DESC 385 #define DETACH 386 #define DICTIONARY 387 #define DISABLE_P 388 #define DISCARD 389 #define DISTINCT 390 #define DO 391 #define DOCUMENT_P 392 #define DOMAIN_P 393 #define DOUBLE_P 394 #define DROP 395 #define EACH 396 #define ELSE 397 #define EMPTY_P 398 #define ENABLE_P 399 #define ENCODING 400 #define ENCRYPTED 401 #define END_P 402 #define ENUM_P 403 #define ERROR_P 404 #define ESCAPE 405 #define EVENT 406 #define EXCEPT 407 #define EXCLUDE 408 #define EXCLUDING 409 #define EXCLUSIVE 410 #define EXECUTE 411 #define EXISTS 412 #define EXPLAIN 413 #define EXPRESSION 414 #define EXTENSION 415 #define EXTERNAL 416 #define EXTRACT 417 #define FALSE_P 418 #define FAMILY 419 #define FETCH 420 #define FILTER 421 #define FINALIZE 422 #define FIRST_P 423 #define FLOAT_P 424 #define FOLLOWING 425 #define FOR 426 #define FORCE 427 #define FOREIGN 428 #define FORMAT 429 #define FORWARD 430 #define FREEZE 431 #define FROM 432 #define FULL 433 #define FUNCTION 434 #define FUNCTIONS 435 #define GENERATED 436 #define GLOBAL 437 #define GRANT 438 #define GRANTED 439 #define GREATEST 440 #define GROUP_P 441 #define GROUPING 442 #define GROUPS 443 #define HANDLER 444 #define HAVING 445 #define HEADER_P 446 #define HOLD 447 #define HOUR_P 448 #define IDENTITY_P 449 #define IF_P 450 #define ILIKE 451 #define IMMEDIATE 452 #define IMMUTABLE 453 #define IMPLICIT_P 454 #define IMPORT_P 455 #define IN_P 456 #define INCLUDE 457 #define INCLUDING 458 #define INCREMENT 459 #define INDENT 460 #define INDEX 461 #define INDEXES 462 #define INHERIT 463 #define INHERITS 464 #define INITIALLY 465 #define INLINE_P 466 #define INNER_P 467 #define INOUT 468 #define INPUT_P 469 #define INSENSITIVE 470 #define INSERT 471 #define INSTEAD 472 #define INT_P 473 #define INTEGER 474 #define INTERSECT 475 #define INTERVAL 476 #define INTO 477 #define INVOKER 478 #define IS 479 #define ISNULL 480 #define ISOLATION 481 #define JOIN 482 #define JSON 483 #define JSON_ARRAY 484 #define JSON_ARRAYAGG 485 #define JSON_EXISTS 486 #define JSON_OBJECT 487 #define JSON_OBJECTAGG 488 #define JSON_QUERY 489 #define JSON_SCALAR 490 #define JSON_SERIALIZE 491 #define JSON_TABLE 492 #define JSON_VALUE 493 #define KEEP 494 #define KEY 495 #define KEYS 496 #define LABEL 497 #define LANGUAGE 498 #define LARGE_P 499 #define LAST_P 500 #define LATERAL_P 501 #define LEADING 502 #define LEAKPROOF 503 #define LEAST 504 #define LEFT 505 #define LEVEL 506 #define LIKE 507 #define LIMIT 508 #define LISTEN 509 #define LOAD 510 #define LOCAL 511 #define LOCALTIME 512 #define LOCALTIMESTAMP 513 #define LOCATION 514 #define LOCK_P 515 #define LOCKED 516 #define LOGGED 517 #define MAPPING 518 #define MATCH 519 #define MATCHED 520 #define MATERIALIZED 521 #define MAXVALUE 522 #define MERGE 523 #define MERGE_ACTION 524 #define METHOD 525 #define MINUTE_P 526 #define MINVALUE 527 #define MODE 528 #define MONTH_P 529 #define MOVE 530 #define NAME_P 531 #define NAMES 532 #define NATIONAL 533 #define NATURAL 534 #define NCHAR 535 #define NESTED 536 #define NEW 537 #define NEXT 538 #define NFC 539 #define NFD 540 #define NFKC 541 #define NFKD 542 #define NO 543 #define NONE 544 #define NORMALIZE 545 #define NORMALIZED 546 #define NOT 547 #define NOTHING 548 #define NOTIFY 549 #define NOTNULL 550 #define NOWAIT 551 #define NULL_P 552 #define NULLIF 553 #define NULLS_P 554 #define NUMERIC 555 #define OBJECT_P 556 #define OF 557 #define OFF 558 #define OFFSET 559 #define OIDS 560 #define OLD 561 #define OMIT 562 #define ON 563 #define ONLY 564 #define OPERATOR 565 #define OPTION 566 #define OPTIONS 567 #define OR 568 #define ORDER 569 #define ORDINALITY 570 #define OTHERS 571 #define OUT_P 572 #define OUTER_P 573 #define OVER 574 #define OVERLAPS 575 #define OVERLAY 576 #define OVERRIDING 577 #define OWNED 578 #define OWNER 579 #define PARALLEL 580 #define PARAMETER 581 #define PARSER 582 #define PARTIAL 583 #define PARTITION 584 #define PASSING 585 #define PASSWORD 586 #define PATH 587 #define PGPOOL 588 #define PLACING 589 #define PLAN 590 #define PLANS 591 #define POLICY 592 #define POSITION 593 #define PRECEDING 594 #define PRECISION 595 #define PRESERVE 596 #define PREPARE 597 #define PREPARED 598 #define PRIMARY 599 #define PRIOR 600 #define PRIVILEGES 601 #define PROCEDURAL 602 #define PROCEDURE 603 #define PROCEDURES 604 #define PROGRAM 605 #define PUBLICATION 606 #define QUOTE 607 #define QUOTES 608 #define RANGE 609 #define READ 610 #define REAL 611 #define REASSIGN 612 #define RECHECK 613 #define RECURSIVE 614 #define REF_P 615 #define REFERENCES 616 #define REFERENCING 617 #define REFRESH 618 #define REINDEX 619 #define RELATIVE_P 620 #define RELEASE 621 #define RENAME 622 #define REPEATABLE 623 #define REPLACE 624 #define REPLICA 625 #define RESET 626 #define RESTART 627 #define RESTRICT 628 #define RETURN 629 #define RETURNING 630 #define RETURNS 631 #define REVOKE 632 #define RIGHT 633 #define ROLE 634 #define ROLLBACK 635 #define ROLLUP 636 #define ROUTINE 637 #define ROUTINES 638 #define ROW 639 #define ROWS 640 #define RULE 641 #define SAVEPOINT 642 #define SCALAR 643 #define SCHEMA 644 #define SCHEMAS 645 #define SCROLL 646 #define SEARCH 647 #define SECOND_P 648 #define SECURITY 649 #define SELECT 650 #define SEQUENCE 651 #define SEQUENCES 652 #define SERIALIZABLE 653 #define SERVER 654 #define SESSION 655 #define SESSION_USER 656 #define SET 657 #define SETS 658 #define SETOF 659 #define SHARE 660 #define SHOW 661 #define SIMILAR 662 #define SIMPLE 663 #define SKIP 664 #define SMALLINT 665 #define SNAPSHOT 666 #define SOME 667 #define SOURCE 668 #define SQL_P 669 #define STABLE 670 #define STANDALONE_P 671 #define START 672 #define STATEMENT 673 #define STATISTICS 674 #define STDIN 675 #define STDOUT 676 #define STORAGE 677 #define STORED 678 #define STRICT_P 679 #define STRING_P 680 #define STRIP_P 681 #define SUBSCRIPTION 682 #define SUBSTRING 683 #define SUPPORT 684 #define SYMMETRIC 685 #define SYSID 686 #define SYSTEM_P 687 #define SYSTEM_USER 688 #define TABLE 689 #define TABLES 690 #define TABLESAMPLE 691 #define TABLESPACE 692 #define TARGET 693 #define TEMP 694 #define TEMPLATE 695 #define TEMPORARY 696 #define TEXT_P 697 #define THEN 698 #define TIES 699 #define TIME 700 #define TIMESTAMP 701 #define TO 702 #define TRAILING 703 #define TRANSACTION 704 #define TRANSFORM 705 #define TREAT 706 #define TRIGGER 707 #define TRIM 708 #define TRUE_P 709 #define TRUNCATE 710 #define TRUSTED 711 #define TYPE_P 712 #define TYPES_P 713 #define UESCAPE 714 #define UNBOUNDED 715 #define UNCONDITIONAL 716 #define UNCOMMITTED 717 #define UNENCRYPTED 718 #define UNION 719 #define UNIQUE 720 #define UNKNOWN 721 #define UNLISTEN 722 #define UNLOGGED 723 #define UNTIL 724 #define UPDATE 725 #define USER 726 #define USING 727 #define VACUUM 728 #define VALID 729 #define VALIDATE 730 #define VALIDATOR 731 #define VALUE_P 732 #define VALUES 733 #define VARCHAR 734 #define VARIADIC 735 #define VARYING 736 #define VERBOSE 737 #define VERSION_P 738 #define VIEW 739 #define VIEWS 740 #define VOLATILE 741 #define WHEN 742 #define WHERE 743 #define WHITESPACE_P 744 #define WINDOW 745 #define WITH 746 #define WITHIN 747 #define WITHOUT 748 #define WORK 749 #define WRAPPER 750 #define WRITE 751 #define XML_P 752 #define XMLATTRIBUTES 753 #define XMLCONCAT 754 #define XMLELEMENT 755 #define XMLEXISTS 756 #define XMLFOREST 757 #define XMLNAMESPACES 758 #define XMLPARSE 759 #define XMLPI 760 #define XMLROOT 761 #define XMLSERIALIZE 762 #define XMLTABLE 763 #define YEAR_P 764 #define YES_P 765 #define ZONE 766 #define FORMAT_LA 767 #define NOT_LA 768 #define NULLS_LA 769 #define WITH_LA 770 #define WITHOUT_LA 771 #define MODE_TYPE_NAME 772 #define MODE_PLPGSQL_EXPR 773 #define MODE_PLPGSQL_ASSIGN1 774 #define MODE_PLPGSQL_ASSIGN2 775 #define MODE_PLPGSQL_ASSIGN3 776 #define UMINUS 777 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 263 "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; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; StatsElem *selem; 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; PublicationObjSpec *publicationobjectspec; struct SelectLimit *selectlimit; SetQuantifier setquantifier; struct GroupClause *groupclause; MergeMatchKind mergematch; MergeWhenClause *mergewhen; struct KeyActions *keyactions; struct KeyAction *keyaction; #line 1150 "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.6.0/src/parser/gram.c0000664000175000017500001235004314760010074013427 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-2024, PgPool Global Development Group * Portions Copyright (c) 1996-2024, 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 "utils/pgstrcasecmp.h" #include #include #include #include #include #include "nodes.h" #include "keywords.h" #include "gramparse.h" #include "makefuncs.h" #include "parser.h" #include "pg_class.h" #include "pg_trigger.h" /* * Definition taken from * postgreSQL source code file: src/include/commands/trigger.h */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' /* * Definition taken from * postgreSQL source code file: src/include/catalog/pg_class.h */ #define REPLICA_IDENTITY_DEFAULT 'd' #define REPLICA_IDENTITY_NOTHING 'n' #define REPLICA_IDENTITY_FULL 'f' #define REPLICA_IDENTITY_INDEX 'i' /* * Definition taken from * postgreSQL source code file: src/include/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. */ #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; /* Private struct for the result of opt_select_limit production */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; } SelectLimit; /* Private struct for the result of group_clause production */ typedef struct GroupClause { bool distinct; List *list; } GroupClause; /* Private structs for the result of key_actions and key_action productions */ typedef struct KeyAction { char action; List *cols; } KeyAction; typedef struct KeyActions { KeyAction *updateAction; KeyAction *deleteAction; } KeyActions; /* 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 *makeFloatConst(char *str, int location); static Node *makeBoolAConst(bool state, int location); static Node *makeBitStringConst(char *str, int location); static Node *makeNullAConst(int location); static Node *makeAConst(Node *v, 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, SelectLimit *limitClause, 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(Float *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 RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location, 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 PartitionStrategy parsePartitionStrategy(char *strategy); static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); #line 325 "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_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, UIDENT = 259, FCONST = 260, SCONST = 261, USCONST = 262, BCONST = 263, XCONST = 264, Op = 265, ICONST = 266, PARAM = 267, TYPECAST = 268, DOT_DOT = 269, COLON_EQUALS = 270, EQUALS_GREATER = 271, LESS_EQUALS = 272, GREATER_EQUALS = 273, NOT_EQUALS = 274, ABORT_P = 275, ABSENT = 276, ABSOLUTE_P = 277, ACCESS = 278, ACTION = 279, ADD_P = 280, ADMIN = 281, AFTER = 282, AGGREGATE = 283, ALL = 284, ALSO = 285, ALTER = 286, ALWAYS = 287, ANALYSE = 288, ANALYZE = 289, AND = 290, ANY = 291, ARRAY = 292, AS = 293, ASC = 294, ASENSITIVE = 295, ASSERTION = 296, ASSIGNMENT = 297, ASYMMETRIC = 298, ATOMIC = 299, AT = 300, ATTACH = 301, ATTRIBUTE = 302, AUTHORIZATION = 303, BACKWARD = 304, BEFORE = 305, BEGIN_P = 306, BETWEEN = 307, BIGINT = 308, BINARY = 309, BIT = 310, BOOLEAN_P = 311, BOTH = 312, BREADTH = 313, BY = 314, CACHE = 315, CALL = 316, CALLED = 317, CASCADE = 318, CASCADED = 319, CASE = 320, CAST = 321, CATALOG_P = 322, CHAIN = 323, CHAR_P = 324, CHARACTER = 325, CHARACTERISTICS = 326, CHECK = 327, CHECKPOINT = 328, CLASS = 329, CLOSE = 330, CLUSTER = 331, COALESCE = 332, COLLATE = 333, COLLATION = 334, COLUMN = 335, COLUMNS = 336, COMMENT = 337, COMMENTS = 338, COMMIT = 339, COMMITTED = 340, COMPRESSION = 341, CONCURRENTLY = 342, CONDITIONAL = 343, CONFIGURATION = 344, CONFLICT = 345, CONNECTION = 346, CONSTRAINT = 347, CONSTRAINTS = 348, CONTENT_P = 349, CONTINUE_P = 350, CONVERSION_P = 351, COPY = 352, COST = 353, CREATE = 354, CROSS = 355, CSV = 356, CUBE = 357, CURRENT_P = 358, CURRENT_CATALOG = 359, CURRENT_DATE = 360, CURRENT_ROLE = 361, CURRENT_SCHEMA = 362, CURRENT_TIME = 363, CURRENT_TIMESTAMP = 364, CURRENT_USER = 365, CURSOR = 366, CYCLE = 367, DATA_P = 368, DATABASE = 369, DAY_P = 370, DEALLOCATE = 371, DEC = 372, DECIMAL_P = 373, DECLARE = 374, DEFAULT = 375, DEFAULTS = 376, DEFERRABLE = 377, DEFERRED = 378, DEFINER = 379, DELETE_P = 380, DELIMITER = 381, DELIMITERS = 382, DEPENDS = 383, DEPTH = 384, DESC = 385, DETACH = 386, DICTIONARY = 387, DISABLE_P = 388, DISCARD = 389, DISTINCT = 390, DO = 391, DOCUMENT_P = 392, DOMAIN_P = 393, DOUBLE_P = 394, DROP = 395, EACH = 396, ELSE = 397, EMPTY_P = 398, ENABLE_P = 399, ENCODING = 400, ENCRYPTED = 401, END_P = 402, ENUM_P = 403, ERROR_P = 404, ESCAPE = 405, EVENT = 406, EXCEPT = 407, EXCLUDE = 408, EXCLUDING = 409, EXCLUSIVE = 410, EXECUTE = 411, EXISTS = 412, EXPLAIN = 413, EXPRESSION = 414, EXTENSION = 415, EXTERNAL = 416, EXTRACT = 417, FALSE_P = 418, FAMILY = 419, FETCH = 420, FILTER = 421, FINALIZE = 422, FIRST_P = 423, FLOAT_P = 424, FOLLOWING = 425, FOR = 426, FORCE = 427, FOREIGN = 428, FORMAT = 429, FORWARD = 430, FREEZE = 431, FROM = 432, FULL = 433, FUNCTION = 434, FUNCTIONS = 435, GENERATED = 436, GLOBAL = 437, GRANT = 438, GRANTED = 439, GREATEST = 440, GROUP_P = 441, GROUPING = 442, GROUPS = 443, HANDLER = 444, HAVING = 445, HEADER_P = 446, HOLD = 447, HOUR_P = 448, IDENTITY_P = 449, IF_P = 450, ILIKE = 451, IMMEDIATE = 452, IMMUTABLE = 453, IMPLICIT_P = 454, IMPORT_P = 455, IN_P = 456, INCLUDE = 457, INCLUDING = 458, INCREMENT = 459, INDENT = 460, INDEX = 461, INDEXES = 462, INHERIT = 463, INHERITS = 464, INITIALLY = 465, INLINE_P = 466, INNER_P = 467, INOUT = 468, INPUT_P = 469, INSENSITIVE = 470, INSERT = 471, INSTEAD = 472, INT_P = 473, INTEGER = 474, INTERSECT = 475, INTERVAL = 476, INTO = 477, INVOKER = 478, IS = 479, ISNULL = 480, ISOLATION = 481, JOIN = 482, JSON = 483, JSON_ARRAY = 484, JSON_ARRAYAGG = 485, JSON_EXISTS = 486, JSON_OBJECT = 487, JSON_OBJECTAGG = 488, JSON_QUERY = 489, JSON_SCALAR = 490, JSON_SERIALIZE = 491, JSON_TABLE = 492, JSON_VALUE = 493, KEEP = 494, KEY = 495, KEYS = 496, LABEL = 497, LANGUAGE = 498, LARGE_P = 499, LAST_P = 500, LATERAL_P = 501, LEADING = 502, LEAKPROOF = 503, LEAST = 504, LEFT = 505, LEVEL = 506, LIKE = 507, LIMIT = 508, LISTEN = 509, LOAD = 510, LOCAL = 511, LOCALTIME = 512, LOCALTIMESTAMP = 513, LOCATION = 514, LOCK_P = 515, LOCKED = 516, LOGGED = 517, MAPPING = 518, MATCH = 519, MATCHED = 520, MATERIALIZED = 521, MAXVALUE = 522, MERGE = 523, MERGE_ACTION = 524, METHOD = 525, MINUTE_P = 526, MINVALUE = 527, MODE = 528, MONTH_P = 529, MOVE = 530, NAME_P = 531, NAMES = 532, NATIONAL = 533, NATURAL = 534, NCHAR = 535, NESTED = 536, NEW = 537, NEXT = 538, NFC = 539, NFD = 540, NFKC = 541, NFKD = 542, NO = 543, NONE = 544, NORMALIZE = 545, NORMALIZED = 546, NOT = 547, NOTHING = 548, NOTIFY = 549, NOTNULL = 550, NOWAIT = 551, NULL_P = 552, NULLIF = 553, NULLS_P = 554, NUMERIC = 555, OBJECT_P = 556, OF = 557, OFF = 558, OFFSET = 559, OIDS = 560, OLD = 561, OMIT = 562, ON = 563, ONLY = 564, OPERATOR = 565, OPTION = 566, OPTIONS = 567, OR = 568, ORDER = 569, ORDINALITY = 570, OTHERS = 571, OUT_P = 572, OUTER_P = 573, OVER = 574, OVERLAPS = 575, OVERLAY = 576, OVERRIDING = 577, OWNED = 578, OWNER = 579, PARALLEL = 580, PARAMETER = 581, PARSER = 582, PARTIAL = 583, PARTITION = 584, PASSING = 585, PASSWORD = 586, PATH = 587, PGPOOL = 588, PLACING = 589, PLAN = 590, PLANS = 591, POLICY = 592, POSITION = 593, PRECEDING = 594, PRECISION = 595, PRESERVE = 596, PREPARE = 597, PREPARED = 598, PRIMARY = 599, PRIOR = 600, PRIVILEGES = 601, PROCEDURAL = 602, PROCEDURE = 603, PROCEDURES = 604, PROGRAM = 605, PUBLICATION = 606, QUOTE = 607, QUOTES = 608, RANGE = 609, READ = 610, REAL = 611, REASSIGN = 612, RECHECK = 613, RECURSIVE = 614, REF_P = 615, REFERENCES = 616, REFERENCING = 617, REFRESH = 618, REINDEX = 619, RELATIVE_P = 620, RELEASE = 621, RENAME = 622, REPEATABLE = 623, REPLACE = 624, REPLICA = 625, RESET = 626, RESTART = 627, RESTRICT = 628, RETURN = 629, RETURNING = 630, RETURNS = 631, REVOKE = 632, RIGHT = 633, ROLE = 634, ROLLBACK = 635, ROLLUP = 636, ROUTINE = 637, ROUTINES = 638, ROW = 639, ROWS = 640, RULE = 641, SAVEPOINT = 642, SCALAR = 643, SCHEMA = 644, SCHEMAS = 645, SCROLL = 646, SEARCH = 647, SECOND_P = 648, SECURITY = 649, SELECT = 650, SEQUENCE = 651, SEQUENCES = 652, SERIALIZABLE = 653, SERVER = 654, SESSION = 655, SESSION_USER = 656, SET = 657, SETS = 658, SETOF = 659, SHARE = 660, SHOW = 661, SIMILAR = 662, SIMPLE = 663, SKIP = 664, SMALLINT = 665, SNAPSHOT = 666, SOME = 667, SOURCE = 668, SQL_P = 669, STABLE = 670, STANDALONE_P = 671, START = 672, STATEMENT = 673, STATISTICS = 674, STDIN = 675, STDOUT = 676, STORAGE = 677, STORED = 678, STRICT_P = 679, STRING_P = 680, STRIP_P = 681, SUBSCRIPTION = 682, SUBSTRING = 683, SUPPORT = 684, SYMMETRIC = 685, SYSID = 686, SYSTEM_P = 687, SYSTEM_USER = 688, TABLE = 689, TABLES = 690, TABLESAMPLE = 691, TABLESPACE = 692, TARGET = 693, TEMP = 694, TEMPLATE = 695, TEMPORARY = 696, TEXT_P = 697, THEN = 698, TIES = 699, TIME = 700, TIMESTAMP = 701, TO = 702, TRAILING = 703, TRANSACTION = 704, TRANSFORM = 705, TREAT = 706, TRIGGER = 707, TRIM = 708, TRUE_P = 709, TRUNCATE = 710, TRUSTED = 711, TYPE_P = 712, TYPES_P = 713, UESCAPE = 714, UNBOUNDED = 715, UNCONDITIONAL = 716, UNCOMMITTED = 717, UNENCRYPTED = 718, UNION = 719, UNIQUE = 720, UNKNOWN = 721, UNLISTEN = 722, UNLOGGED = 723, UNTIL = 724, UPDATE = 725, USER = 726, USING = 727, VACUUM = 728, VALID = 729, VALIDATE = 730, VALIDATOR = 731, VALUE_P = 732, VALUES = 733, VARCHAR = 734, VARIADIC = 735, VARYING = 736, VERBOSE = 737, VERSION_P = 738, VIEW = 739, VIEWS = 740, VOLATILE = 741, WHEN = 742, WHERE = 743, WHITESPACE_P = 744, WINDOW = 745, WITH = 746, WITHIN = 747, WITHOUT = 748, WORK = 749, WRAPPER = 750, WRITE = 751, XML_P = 752, XMLATTRIBUTES = 753, XMLCONCAT = 754, XMLELEMENT = 755, XMLEXISTS = 756, XMLFOREST = 757, XMLNAMESPACES = 758, XMLPARSE = 759, XMLPI = 760, XMLROOT = 761, XMLSERIALIZE = 762, XMLTABLE = 763, YEAR_P = 764, YES_P = 765, ZONE = 766, FORMAT_LA = 767, NOT_LA = 768, NULLS_LA = 769, WITH_LA = 770, WITHOUT_LA = 771, MODE_TYPE_NAME = 772, MODE_PLPGSQL_EXPR = 773, MODE_PLPGSQL_ASSIGN1 = 774, MODE_PLPGSQL_ASSIGN2 = 775, MODE_PLPGSQL_ASSIGN3 = 776, UMINUS = 777 }; #endif /* Tokens. */ #define IDENT 258 #define UIDENT 259 #define FCONST 260 #define SCONST 261 #define USCONST 262 #define BCONST 263 #define XCONST 264 #define Op 265 #define ICONST 266 #define PARAM 267 #define TYPECAST 268 #define DOT_DOT 269 #define COLON_EQUALS 270 #define EQUALS_GREATER 271 #define LESS_EQUALS 272 #define GREATER_EQUALS 273 #define NOT_EQUALS 274 #define ABORT_P 275 #define ABSENT 276 #define ABSOLUTE_P 277 #define ACCESS 278 #define ACTION 279 #define ADD_P 280 #define ADMIN 281 #define AFTER 282 #define AGGREGATE 283 #define ALL 284 #define ALSO 285 #define ALTER 286 #define ALWAYS 287 #define ANALYSE 288 #define ANALYZE 289 #define AND 290 #define ANY 291 #define ARRAY 292 #define AS 293 #define ASC 294 #define ASENSITIVE 295 #define ASSERTION 296 #define ASSIGNMENT 297 #define ASYMMETRIC 298 #define ATOMIC 299 #define AT 300 #define ATTACH 301 #define ATTRIBUTE 302 #define AUTHORIZATION 303 #define BACKWARD 304 #define BEFORE 305 #define BEGIN_P 306 #define BETWEEN 307 #define BIGINT 308 #define BINARY 309 #define BIT 310 #define BOOLEAN_P 311 #define BOTH 312 #define BREADTH 313 #define BY 314 #define CACHE 315 #define CALL 316 #define CALLED 317 #define CASCADE 318 #define CASCADED 319 #define CASE 320 #define CAST 321 #define CATALOG_P 322 #define CHAIN 323 #define CHAR_P 324 #define CHARACTER 325 #define CHARACTERISTICS 326 #define CHECK 327 #define CHECKPOINT 328 #define CLASS 329 #define CLOSE 330 #define CLUSTER 331 #define COALESCE 332 #define COLLATE 333 #define COLLATION 334 #define COLUMN 335 #define COLUMNS 336 #define COMMENT 337 #define COMMENTS 338 #define COMMIT 339 #define COMMITTED 340 #define COMPRESSION 341 #define CONCURRENTLY 342 #define CONDITIONAL 343 #define CONFIGURATION 344 #define CONFLICT 345 #define CONNECTION 346 #define CONSTRAINT 347 #define CONSTRAINTS 348 #define CONTENT_P 349 #define CONTINUE_P 350 #define CONVERSION_P 351 #define COPY 352 #define COST 353 #define CREATE 354 #define CROSS 355 #define CSV 356 #define CUBE 357 #define CURRENT_P 358 #define CURRENT_CATALOG 359 #define CURRENT_DATE 360 #define CURRENT_ROLE 361 #define CURRENT_SCHEMA 362 #define CURRENT_TIME 363 #define CURRENT_TIMESTAMP 364 #define CURRENT_USER 365 #define CURSOR 366 #define CYCLE 367 #define DATA_P 368 #define DATABASE 369 #define DAY_P 370 #define DEALLOCATE 371 #define DEC 372 #define DECIMAL_P 373 #define DECLARE 374 #define DEFAULT 375 #define DEFAULTS 376 #define DEFERRABLE 377 #define DEFERRED 378 #define DEFINER 379 #define DELETE_P 380 #define DELIMITER 381 #define DELIMITERS 382 #define DEPENDS 383 #define DEPTH 384 #define DESC 385 #define DETACH 386 #define DICTIONARY 387 #define DISABLE_P 388 #define DISCARD 389 #define DISTINCT 390 #define DO 391 #define DOCUMENT_P 392 #define DOMAIN_P 393 #define DOUBLE_P 394 #define DROP 395 #define EACH 396 #define ELSE 397 #define EMPTY_P 398 #define ENABLE_P 399 #define ENCODING 400 #define ENCRYPTED 401 #define END_P 402 #define ENUM_P 403 #define ERROR_P 404 #define ESCAPE 405 #define EVENT 406 #define EXCEPT 407 #define EXCLUDE 408 #define EXCLUDING 409 #define EXCLUSIVE 410 #define EXECUTE 411 #define EXISTS 412 #define EXPLAIN 413 #define EXPRESSION 414 #define EXTENSION 415 #define EXTERNAL 416 #define EXTRACT 417 #define FALSE_P 418 #define FAMILY 419 #define FETCH 420 #define FILTER 421 #define FINALIZE 422 #define FIRST_P 423 #define FLOAT_P 424 #define FOLLOWING 425 #define FOR 426 #define FORCE 427 #define FOREIGN 428 #define FORMAT 429 #define FORWARD 430 #define FREEZE 431 #define FROM 432 #define FULL 433 #define FUNCTION 434 #define FUNCTIONS 435 #define GENERATED 436 #define GLOBAL 437 #define GRANT 438 #define GRANTED 439 #define GREATEST 440 #define GROUP_P 441 #define GROUPING 442 #define GROUPS 443 #define HANDLER 444 #define HAVING 445 #define HEADER_P 446 #define HOLD 447 #define HOUR_P 448 #define IDENTITY_P 449 #define IF_P 450 #define ILIKE 451 #define IMMEDIATE 452 #define IMMUTABLE 453 #define IMPLICIT_P 454 #define IMPORT_P 455 #define IN_P 456 #define INCLUDE 457 #define INCLUDING 458 #define INCREMENT 459 #define INDENT 460 #define INDEX 461 #define INDEXES 462 #define INHERIT 463 #define INHERITS 464 #define INITIALLY 465 #define INLINE_P 466 #define INNER_P 467 #define INOUT 468 #define INPUT_P 469 #define INSENSITIVE 470 #define INSERT 471 #define INSTEAD 472 #define INT_P 473 #define INTEGER 474 #define INTERSECT 475 #define INTERVAL 476 #define INTO 477 #define INVOKER 478 #define IS 479 #define ISNULL 480 #define ISOLATION 481 #define JOIN 482 #define JSON 483 #define JSON_ARRAY 484 #define JSON_ARRAYAGG 485 #define JSON_EXISTS 486 #define JSON_OBJECT 487 #define JSON_OBJECTAGG 488 #define JSON_QUERY 489 #define JSON_SCALAR 490 #define JSON_SERIALIZE 491 #define JSON_TABLE 492 #define JSON_VALUE 493 #define KEEP 494 #define KEY 495 #define KEYS 496 #define LABEL 497 #define LANGUAGE 498 #define LARGE_P 499 #define LAST_P 500 #define LATERAL_P 501 #define LEADING 502 #define LEAKPROOF 503 #define LEAST 504 #define LEFT 505 #define LEVEL 506 #define LIKE 507 #define LIMIT 508 #define LISTEN 509 #define LOAD 510 #define LOCAL 511 #define LOCALTIME 512 #define LOCALTIMESTAMP 513 #define LOCATION 514 #define LOCK_P 515 #define LOCKED 516 #define LOGGED 517 #define MAPPING 518 #define MATCH 519 #define MATCHED 520 #define MATERIALIZED 521 #define MAXVALUE 522 #define MERGE 523 #define MERGE_ACTION 524 #define METHOD 525 #define MINUTE_P 526 #define MINVALUE 527 #define MODE 528 #define MONTH_P 529 #define MOVE 530 #define NAME_P 531 #define NAMES 532 #define NATIONAL 533 #define NATURAL 534 #define NCHAR 535 #define NESTED 536 #define NEW 537 #define NEXT 538 #define NFC 539 #define NFD 540 #define NFKC 541 #define NFKD 542 #define NO 543 #define NONE 544 #define NORMALIZE 545 #define NORMALIZED 546 #define NOT 547 #define NOTHING 548 #define NOTIFY 549 #define NOTNULL 550 #define NOWAIT 551 #define NULL_P 552 #define NULLIF 553 #define NULLS_P 554 #define NUMERIC 555 #define OBJECT_P 556 #define OF 557 #define OFF 558 #define OFFSET 559 #define OIDS 560 #define OLD 561 #define OMIT 562 #define ON 563 #define ONLY 564 #define OPERATOR 565 #define OPTION 566 #define OPTIONS 567 #define OR 568 #define ORDER 569 #define ORDINALITY 570 #define OTHERS 571 #define OUT_P 572 #define OUTER_P 573 #define OVER 574 #define OVERLAPS 575 #define OVERLAY 576 #define OVERRIDING 577 #define OWNED 578 #define OWNER 579 #define PARALLEL 580 #define PARAMETER 581 #define PARSER 582 #define PARTIAL 583 #define PARTITION 584 #define PASSING 585 #define PASSWORD 586 #define PATH 587 #define PGPOOL 588 #define PLACING 589 #define PLAN 590 #define PLANS 591 #define POLICY 592 #define POSITION 593 #define PRECEDING 594 #define PRECISION 595 #define PRESERVE 596 #define PREPARE 597 #define PREPARED 598 #define PRIMARY 599 #define PRIOR 600 #define PRIVILEGES 601 #define PROCEDURAL 602 #define PROCEDURE 603 #define PROCEDURES 604 #define PROGRAM 605 #define PUBLICATION 606 #define QUOTE 607 #define QUOTES 608 #define RANGE 609 #define READ 610 #define REAL 611 #define REASSIGN 612 #define RECHECK 613 #define RECURSIVE 614 #define REF_P 615 #define REFERENCES 616 #define REFERENCING 617 #define REFRESH 618 #define REINDEX 619 #define RELATIVE_P 620 #define RELEASE 621 #define RENAME 622 #define REPEATABLE 623 #define REPLACE 624 #define REPLICA 625 #define RESET 626 #define RESTART 627 #define RESTRICT 628 #define RETURN 629 #define RETURNING 630 #define RETURNS 631 #define REVOKE 632 #define RIGHT 633 #define ROLE 634 #define ROLLBACK 635 #define ROLLUP 636 #define ROUTINE 637 #define ROUTINES 638 #define ROW 639 #define ROWS 640 #define RULE 641 #define SAVEPOINT 642 #define SCALAR 643 #define SCHEMA 644 #define SCHEMAS 645 #define SCROLL 646 #define SEARCH 647 #define SECOND_P 648 #define SECURITY 649 #define SELECT 650 #define SEQUENCE 651 #define SEQUENCES 652 #define SERIALIZABLE 653 #define SERVER 654 #define SESSION 655 #define SESSION_USER 656 #define SET 657 #define SETS 658 #define SETOF 659 #define SHARE 660 #define SHOW 661 #define SIMILAR 662 #define SIMPLE 663 #define SKIP 664 #define SMALLINT 665 #define SNAPSHOT 666 #define SOME 667 #define SOURCE 668 #define SQL_P 669 #define STABLE 670 #define STANDALONE_P 671 #define START 672 #define STATEMENT 673 #define STATISTICS 674 #define STDIN 675 #define STDOUT 676 #define STORAGE 677 #define STORED 678 #define STRICT_P 679 #define STRING_P 680 #define STRIP_P 681 #define SUBSCRIPTION 682 #define SUBSTRING 683 #define SUPPORT 684 #define SYMMETRIC 685 #define SYSID 686 #define SYSTEM_P 687 #define SYSTEM_USER 688 #define TABLE 689 #define TABLES 690 #define TABLESAMPLE 691 #define TABLESPACE 692 #define TARGET 693 #define TEMP 694 #define TEMPLATE 695 #define TEMPORARY 696 #define TEXT_P 697 #define THEN 698 #define TIES 699 #define TIME 700 #define TIMESTAMP 701 #define TO 702 #define TRAILING 703 #define TRANSACTION 704 #define TRANSFORM 705 #define TREAT 706 #define TRIGGER 707 #define TRIM 708 #define TRUE_P 709 #define TRUNCATE 710 #define TRUSTED 711 #define TYPE_P 712 #define TYPES_P 713 #define UESCAPE 714 #define UNBOUNDED 715 #define UNCONDITIONAL 716 #define UNCOMMITTED 717 #define UNENCRYPTED 718 #define UNION 719 #define UNIQUE 720 #define UNKNOWN 721 #define UNLISTEN 722 #define UNLOGGED 723 #define UNTIL 724 #define UPDATE 725 #define USER 726 #define USING 727 #define VACUUM 728 #define VALID 729 #define VALIDATE 730 #define VALIDATOR 731 #define VALUE_P 732 #define VALUES 733 #define VARCHAR 734 #define VARIADIC 735 #define VARYING 736 #define VERBOSE 737 #define VERSION_P 738 #define VIEW 739 #define VIEWS 740 #define VOLATILE 741 #define WHEN 742 #define WHERE 743 #define WHITESPACE_P 744 #define WINDOW 745 #define WITH 746 #define WITHIN 747 #define WITHOUT 748 #define WORK 749 #define WRAPPER 750 #define WRITE 751 #define XML_P 752 #define XMLATTRIBUTES 753 #define XMLCONCAT 754 #define XMLELEMENT 755 #define XMLEXISTS 756 #define XMLFOREST 757 #define XMLNAMESPACES 758 #define XMLPARSE 759 #define XMLPI 760 #define XMLROOT 761 #define XMLSERIALIZE 762 #define XMLTABLE 763 #define YEAR_P 764 #define YES_P 765 #define ZONE 766 #define FORMAT_LA 767 #define NOT_LA 768 #define NULLS_LA 769 #define WITH_LA 770 #define WITHOUT_LA 771 #define MODE_TYPE_NAME 772 #define MODE_PLPGSQL_EXPR 773 #define MODE_PLPGSQL_ASSIGN1 774 #define MODE_PLPGSQL_ASSIGN2 775 #define MODE_PLPGSQL_ASSIGN3 776 #define UMINUS 777 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 263 "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; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; StatsElem *selem; 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; PublicationObjSpec *publicationobjectspec; struct SelectLimit *selectlimit; SetQuantifier setquantifier; struct GroupClause *groupclause; MergeMatchKind mergematch; MergeWhenClause *mergewhen; struct KeyActions *keyactions; struct KeyAction *keyaction; #line 1461 "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_GRAM_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 1491 "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 936 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 123730 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 540 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 728 /* YYNRULES -- Number of rules. */ #define YYNRULES 3412 /* YYNSTATES -- Number of states. */ #define YYNSTATES 6472 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 777 #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, 529, 2, 2, 534, 535, 527, 525, 538, 526, 536, 528, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 539, 537, 522, 524, 523, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 532, 2, 533, 530, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 531 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 953, 953, 958, 962, 967, 975, 983, 1003, 1015, 1029, 1030, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1159, 1166, 1167, 1171, 1172, 1176, 1177, 1181, 1182, 1183, 1192, 1208, 1220, 1221, 1222, 1231, 1232, 1236, 1237, 1241, 1246, 1250, 1260, 1268, 1272, 1276, 1281, 1285, 1333, 1335, 1339, 1343, 1347, 1351, 1365, 1384, 1393, 1405, 1406, 1410, 1419, 1428, 1437, 1459, 1467, 1475, 1483, 1491, 1499, 1517, 1536, 1548, 1549, 1560, 1571, 1582, 1598, 1617, 1624, 1632, 1633, 1634, 1635, 1636, 1637, 1651, 1658, 1665, 1672, 1679, 1689, 1698, 1707, 1711, 1720, 1729, 1737, 1748, 1749, 1758, 1770, 1778, 1787, 1799, 1808, 1817, 1825, 1835, 1845, 1853, 1854, 1858, 1859, 1862, 1864, 1868, 1869, 1870, 1871, 1875, 1876, 1877, 1883, 1895, 1899, 1903, 1920, 1928, 1929, 1930, 1934, 1935, 1936, 1940, 1941, 1945, 1946, 1955, 1956, 1964, 1972, 1983, 1991, 2002, 2003, 2008, 2009, 2015, 2021, 2027, 2034, 2041, 2048, 2055, 2066, 2077, 2078, 2082, 2083, 2091, 2107, 2114, 2121, 2128, 2135, 2155, 2165, 2175, 2185, 2195, 2207, 2219, 2229, 2239, 2249, 2261, 2273, 2283, 2293, 2303, 2313, 2323, 2333, 2345, 2357, 2367, 2380, 2381, 2386, 2400, 2413, 2429, 2446, 2456, 2466, 2476, 2486, 2496, 2505, 2514, 2524, 2533, 2543, 2553, 2569, 2579, 2589, 2599, 2609, 2626, 2636, 2646, 2656, 2667, 2681, 2697, 2706, 2715, 2730, 2739, 2750, 2761, 2769, 2778, 2787, 2795, 2803, 2812, 2821, 2830, 2838, 2846, 2855, 2863, 2871, 2880, 2889, 2898, 2907, 2916, 2925, 2936, 2944, 2953, 2962, 2971, 2980, 2989, 2998, 3006, 3014, 3022, 3029, 3040, 3041, 3045, 3054, 3058, 3059, 3063, 3071, 3079, 3087, 3098, 3101, 3102, 3106, 3107, 3112, 3116, 3120, 3125, 3132, 3134, 3139, 3143, 3147, 3158, 3165, 3166, 3170, 3171, 3176, 3229, 3242, 3256, 3268, 3275, 3279, 3293, 3306, 3307, 3312, 3322, 3333, 3344, 3371, 3378, 3412, 3448, 3471, 3472, 3476, 3477, 3486, 3487, 3488, 3491, 3492, 3497, 3498, 3502, 3506, 3510, 3514, 3518, 3522, 3526, 3530, 3534, 3538, 3542, 3546, 3550, 3554, 3558, 3567, 3571, 3575, 3579, 3583, 3584, 3589, 3593, 3600, 3607, 3608, 3609, 3610, 3611, 3612, 3616, 3620, 3628, 3639, 3659, 3679, 3700, 3721, 3742, 3776, 3777, 3778, 3779, 3780, 3787, 3794, 3795, 3799, 3800, 3804, 3805, 3809, 3813, 3820, 3824, 3831, 3832, 3833, 3837, 3838, 3841, 3865, 3884, 3906, 3907, 3911, 3912, 3916, 3917, 3921, 3922, 3926, 3927, 3931, 3939, 3940, 3941, 3973, 3981, 3989, 4002, 4014, 4027, 4039, 4049, 4073, 4093, 4094, 4095, 4099, 4100, 4119, 4127, 4135, 4143, 4155, 4167, 4168, 4169, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4191, 4199, 4203, 4217, 4235, 4251, 4268, 4284, 4304, 4339, 4347, 4351, 4365, 4381, 4382, 4386, 4387, 4391, 4392, 4395, 4401, 4402, 4405, 4409, 4417, 4422, 4428, 4429, 4433, 4438, 4445, 4446, 4450, 4460, 4470, 4478, 4487, 4500, 4512, 4519, 4527, 4535, 4543, 4551, 4561, 4562, 4566, 4567, 4570, 4582, 4583, 4586, 4597, 4608, 4622, 4623, 4628, 4629, 4630, 4633, 4634, 4635, 4636, 4639, 4640, 4643, 4644, 4647, 4667, 4680, 4702, 4703, 4706, 4712, 4718, 4735, 4744, 4766, 4780, 4797, 4813, 4814, 4815, 4827, 4841, 4858, 4872, 4873, 4885, 4906, 4917, 4931, 4940, 4952, 4953, 4956, 4957, 4960, 4961, 4964, 4968, 4972, 4976, 4980, 4984, 4988, 4992, 4996, 5000, 5004, 5009, 5013, 5017, 5023, 5024, 5028, 5029, 5030, 5037, 5040, 5041, 5053, 5069, 5085, 5086, 5094, 5095, 5099, 5100, 5104, 5105, 5109, 5110, 5114, 5115, 5125, 5137, 5138, 5151, 5159, 5177, 5186, 5198, 5201, 5205, 5209, 5213, 5220, 5232, 5243, 5246, 5250, 5263, 5273, 5283, 5293, 5303, 5313, 5323, 5333, 5343, 5353, 5363, 5373, 5383, 5402, 5414, 5415, 5416, 5417, 5421, 5422, 5426, 5427, 5437, 5446, 5459, 5460, 5464, 5468, 5476, 5480, 5484, 5491, 5495, 5500, 5505, 5512, 5519, 5524, 5534, 5547, 5563, 5564, 5569, 5570, 5574, 5575, 5585, 5595, 5604, 5622, 5643, 5664, 5686, 5720, 5736, 5737, 5741, 5750, 5765, 5775, 5788, 5789, 5801, 5810, 5828, 5853, 5871, 5886, 5887, 5891, 5892, 5896, 5897, 5901, 5902, 5906, 5920, 5924, 5925, 5929, 5930, 5931, 5932, 5933, 5943, 5955, 5956, 5967, 5990, 6022, 6023, 6024, 6028, 6030, 6052, 6054, 6056, 6058, 6060, 6065, 6066, 6070, 6071, 6075, 6087, 6088, 6092, 6101, 6105, 6109, 6114, 6124, 6125, 6129, 6130, 6134, 6135, 6139, 6140, 6144, 6145, 6146, 6150, 6154, 6155, 6156, 6160, 6161, 6166, 6167, 6194, 6195, 6196, 6197, 6198, 6199, 6212, 6223, 6238, 6240, 6245, 6250, 6252, 6257, 6268, 6269, 6270, 6271, 6282, 6301, 6313, 6326, 6337, 6348, 6360, 6369, 6377, 6385, 6395, 6405, 6415, 6425, 6435, 6446, 6456, 6469, 6472, 6473, 6476, 6480, 6487, 6488, 6489, 6490, 6491, 6492, 6495, 6498, 6499, 6507, 6514, 6515, 6518, 6520, 6531, 6543, 6555, 6567, 6579, 6608, 6609, 6625, 6641, 6642, 6646, 6659, 6670, 6679, 6689, 6699, 6700, 6703, 6704, 6707, 6708, 6709, 6712, 6726, 6731, 6742, 6752, 6765, 6766, 6770, 6779, 6792, 6803, 6817, 6828, 6851, 6862, 6881, 6892, 6903, 6914, 6925, 6936, 6947, 6958, 6969, 6980, 6991, 7002, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7039, 7040, 7041, 7042, 7043, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7059, 7060, 7061, 7065, 7066, 7069, 7070, 7073, 7075, 7080, 7081, 7092, 7104, 7105, 7106, 7116, 7125, 7134, 7143, 7152, 7161, 7170, 7179, 7188, 7197, 7211, 7220, 7229, 7238, 7247, 7256, 7265, 7274, 7286, 7287, 7301, 7312, 7323, 7334, 7345, 7356, 7367, 7378, 7389, 7400, 7413, 7414, 7417, 7418, 7428, 7435, 7444, 7453, 7462, 7471, 7480, 7489, 7498, 7507, 7516, 7525, 7534, 7543, 7552, 7561, 7570, 7579, 7590, 7591, 7594, 7595, 7605, 7623, 7639, 7667, 7669, 7671, 7673, 7681, 7691, 7692, 7695, 7703, 7711, 7719, 7726, 7737, 7741, 7748, 7752, 7763, 7772, 7781, 7790, 7799, 7808, 7817, 7826, 7835, 7844, 7853, 7862, 7871, 7879, 7888, 7897, 7906, 7915, 7924, 7933, 7942, 7955, 7956, 7960, 7961, 7966, 7967, 7977, 7988, 8002, 8014, 8032, 8033, 8037, 8044, 8045, 8046, 8049, 8050, 8060, 8071, 8072, 8076, 8080, 8084, 8095, 8109, 8124, 8142, 8143, 8144, 8145, 8146, 8147, 8159, 8191, 8226, 8227, 8231, 8232, 8235, 8236, 8241, 8253, 8272, 8277, 8282, 8289, 8290, 8293, 8294, 8297, 8298, 8302, 8303, 8304, 8307, 8308, 8309, 8325, 8339, 8354, 8368, 8385, 8386, 8389, 8390, 8394, 8395, 8399, 8400, 8405, 8419, 8427, 8435, 8451, 8452, 8456, 8457, 8472, 8482, 8492, 8502, 8512, 8525, 8526, 8527, 8528, 8529, 8535, 8539, 8554, 8555, 8561, 8571, 8575, 8580, 8588, 8630, 8634, 8638, 8642, 8650, 8651, 8655, 8667, 8668, 8673, 8674, 8679, 8680, 8687, 8691, 8695, 8699, 8703, 8707, 8711, 8715, 8719, 8723, 8727, 8731, 8735, 8739, 8743, 8747, 8752, 8759, 8763, 8767, 8771, 8775, 8781, 8782, 8788, 8798, 8802, 8813, 8819, 8828, 8834, 8835, 8839, 8840, 8844, 8845, 8848, 8861, 8865, 8880, 8889, 8898, 8911, 8912, 8917, 8918, 8935, 8946, 8957, 8968, 8979, 8990, 9004, 9015, 9029, 9040, 9054, 9062, 9064, 9066, 9071, 9073, 9078, 9079, 9084, 9103, 9113, 9114, 9118, 9122, 9134, 9146, 9158, 9172, 9173, 9174, 9178, 9191, 9192, 9202, 9215, 9219, 9223, 9227, 9234, 9256, 9269, 9282, 9297, 9298, 9301, 9302, 9305, 9306, 9316, 9326, 9344, 9354, 9364, 9374, 9384, 9394, 9404, 9414, 9424, 9434, 9444, 9454, 9464, 9475, 9486, 9496, 9506, 9516, 9526, 9536, 9546, 9557, 9568, 9579, 9590, 9601, 9612, 9623, 9634, 9645, 9656, 9667, 9678, 9690, 9702, 9714, 9726, 9738, 9750, 9761, 9772, 9784, 9796, 9807, 9818, 9827, 9837, 9847, 9857, 9867, 9877, 9887, 9897, 9907, 9917, 9932, 9933, 9936, 9937, 9947, 9957, 9967, 9977, 9988, 9998, 10010, 10011, 10021, 10031, 10041, 10051, 10061, 10071, 10081, 10091, 10101, 10111, 10121, 10131, 10141, 10151, 10161, 10171, 10181, 10191, 10201, 10211, 10221, 10231, 10241, 10251, 10261, 10271, 10281, 10300, 10310, 10311, 10314, 10316, 10318, 10324, 10325, 10326, 10327, 10328, 10340, 10356, 10365, 10374, 10383, 10392, 10401, 10410, 10419, 10428, 10437, 10446, 10455, 10464, 10473, 10482, 10491, 10500, 10509, 10518, 10527, 10536, 10545, 10554, 10563, 10591, 10599, 10608, 10634, 10643, 10650, 10656, 10683, 10694, 10703, 10711, 10713, 10735, 10743, 10753, 10763, 10782, 10801, 10811, 10821, 10831, 10842, 10853, 10864, 10875, 10886, 10904, 10913, 10930, 10948, 10949, 10950, 10955, 10961, 10970, 10971, 10972, 10973, 10974, 10978, 10979, 10982, 10983, 10984, 10985, 10989, 10990, 10991, 11003, 11014, 11015, 11018, 11028, 11035, 11055, 11065, 11074, 11084, 11094, 11103, 11112, 11121, 11130, 11139, 11148, 11157, 11169, 11178, 11190, 11191, 11192, 11196, 11199, 11202, 11205, 11208, 11215, 11217, 11219, 11224, 11226, 11230, 11231, 11232, 11244, 11258, 11272, 11291, 11313, 11314, 11315, 11316, 11326, 11343, 11354, 11355, 11359, 11360, 11364, 11368, 11372, 11390, 11391, 11392, 11393, 11394, 11395, 11396, 11403, 11404, 11415, 11423, 11431, 11440, 11450, 11468, 11477, 11486, 11495, 11507, 11511, 11522, 11534, 11552, 11559, 11576, 11590, 11600, 11609, 11618, 11628, 11640, 11652, 11663, 11664, 11675, 11686, 11698, 11710, 11722, 11734, 11744, 11757, 11758, 11772, 11796, 11805, 11815, 11827, 11839, 11853, 11854, 11866, 11887, 11898, 11910, 11922, 11926, 11933, 11934, 11938, 11945, 11946, 11947, 11951, 11952, 11953, 11957, 11958, 11962, 11963, 11966, 11967, 11970, 11971, 11975, 11976, 11980, 11987, 11989, 11994, 11995, 12008, 12016, 12027, 12035, 12046, 12047, 12048, 12049, 12050, 12051, 12052, 12053, 12054, 12055, 12065, 12076, 12077, 12081, 12082, 12083, 12084, 12085, 12095, 12103, 12121, 12141, 12142, 12152, 12161, 12170, 12179, 12198, 12216, 12220, 12228, 12234, 12241, 12247, 12254, 12263, 12264, 12268, 12270, 12275, 12286, 12296, 12306, 12312, 12321, 12330, 12336, 12337, 12348, 12363, 12364, 12375, 12386, 12387, 12390, 12391, 12392, 12393, 12394, 12395, 12396, 12397, 12400, 12401, 12405, 12406, 12407, 12418, 12436, 12437, 12441, 12446, 12470, 12481, 12482, 12494, 12514, 12515, 12525, 12532, 12539, 12546, 12556, 12569, 12570, 12574, 12575, 12579, 12580, 12584, 12597, 12610, 12619, 12628, 12637, 12646, 12658, 12670, 12682, 12685, 12686, 12687, 12688, 12689, 12690, 12693, 12694, 12695, 12743, 12744, 12748, 12749, 12764, 12765, 12772, 12780, 12788, 12796, 12804, 12812, 12823, 12824, 12856, 12872, 12889, 12890, 12909, 12913, 12917, 12932, 12939, 12946, 12956, 12957, 12960, 12976, 12977, 12978, 12982, 12992, 13003, 13009, 13021, 13034, 13040, 13041, 13045, 13057, 13065, 13070, 13075, 13080, 13085, 13093, 13101, 13106, 13111, 13118, 13119, 13123, 13124, 13125, 13132, 13133, 13137, 13138, 13142, 13143, 13147, 13148, 13152, 13156, 13157, 13160, 13169, 13182, 13187, 13192, 13196, 13208, 13209, 13213, 13222, 13238, 13247, 13256, 13265, 13277, 13280, 13285, 13286, 13294, 13314, 13315, 13317, 13322, 13323, 13327, 13328, 13331, 13332, 13357, 13366, 13376, 13377, 13381, 13382, 13383, 13384, 13385, 13389, 13402, 13409, 13416, 13423, 13424, 13428, 13429, 13433, 13434, 13438, 13439, 13443, 13455, 13456, 13457, 13458, 13462, 13463, 13473, 13480, 13499, 13500, 13504, 13505, 13511, 13516, 13525, 13533, 13542, 13549, 13557, 13566, 13575, 13579, 13584, 13591, 13620, 13624, 13638, 13659, 13681, 13694, 13711, 13717, 13722, 13728, 13735, 13736, 13746, 13752, 13760, 13764, 13768, 13775, 13783, 13788, 13789, 13790, 13791, 13795, 13796, 13811, 13815, 13823, 13830, 13837, 13844, 13851, 13862, 13863, 13876, 13880, 13888, 13902, 13916, 13917, 13932, 13943, 13956, 13961, 13962, 13965, 13966, 13969, 13970, 13975, 13976, 13981, 13982, 13991, 13996, 13997, 14001, 14005, 14011, 14036, 14047, 14061, 14062, 14066, 14080, 14137, 14151, 14153, 14158, 14160, 14162, 14164, 14166, 14171, 14173, 14178, 14186, 14197, 14225, 14226, 14230, 14232, 14237, 14246, 14266, 14286, 14304, 14316, 14331, 14332, 14336, 14339, 14352, 14357, 14364, 14369, 14375, 14380, 14389, 14391, 14394, 14398, 14399, 14400, 14401, 14402, 14403, 14408, 14414, 14429, 14430, 14431, 14432, 14433, 14444, 14450, 14458, 14459, 14465, 14470, 14475, 14480, 14485, 14490, 14495, 14500, 14506, 14512, 14518, 14525, 14547, 14556, 14560, 14568, 14572, 14580, 14592, 14613, 14617, 14623, 14627, 14640, 14648, 14658, 14660, 14662, 14664, 14666, 14668, 14673, 14674, 14681, 14690, 14698, 14707, 14718, 14726, 14727, 14728, 14732, 14734, 14736, 14738, 14740, 14742, 14744, 14749, 14754, 14760, 14768, 14773, 14780, 14787, 14791, 14795, 14803, 14838, 14839, 14841, 14850, 14857, 14873, 14875, 14877, 14879, 14881, 14883, 14885, 14887, 14889, 14891, 14893, 14895, 14897, 14899, 14902, 14904, 14907, 14909, 14911, 14913, 14916, 14921, 14930, 14935, 14944, 14949, 14958, 14963, 14973, 14982, 14991, 15000, 15019, 15028, 15037, 15046, 15055, 15072, 15081, 15090, 15099, 15108, 15117, 15126, 15130, 15134, 15142, 15150, 15158, 15166, 15187, 15210, 15222, 15229, 15245, 15250, 15256, 15263, 15270, 15278, 15286, 15303, 15322, 15348, 15350, 15352, 15354, 15356, 15358, 15360, 15362, 15364, 15366, 15368, 15370, 15372, 15374, 15376, 15378, 15380, 15382, 15384, 15388, 15392, 15397, 15413, 15414, 15415, 15432, 15445, 15447, 15449, 15461, 15486, 15498, 15510, 15518, 15529, 15540, 15550, 15556, 15565, 15575, 15585, 15598, 15608, 15639, 15675, 15685, 15696, 15697, 15698, 15705, 15712, 15716, 15720, 15724, 15728, 15732, 15736, 15740, 15744, 15748, 15752, 15756, 15760, 15767, 15771, 15775, 15779, 15781, 15788, 15795, 15802, 15809, 15820, 15834, 15844, 15855, 15871, 15881, 15888, 15895, 15902, 15906, 15914, 15923, 15932, 15936, 15940, 15944, 15948, 15952, 15961, 15965, 15975, 15979, 15983, 15988, 15999, 16005, 16019, 16030, 16044, 16060, 16072, 16082, 16091, 16100, 16108, 16130, 16146, 16170, 16172, 16176, 16178, 16180, 16183, 16186, 16189, 16190, 16193, 16201, 16211, 16212, 16215, 16216, 16217, 16220, 16221, 16222, 16227, 16231, 16235, 16239, 16246, 16247, 16255, 16256, 16260, 16261, 16269, 16270, 16274, 16275, 16280, 16289, 16291, 16306, 16309, 16337, 16338, 16341, 16342, 16350, 16358, 16366, 16375, 16385, 16403, 16449, 16458, 16467, 16476, 16485, 16497, 16498, 16499, 16500, 16501, 16515, 16516, 16517, 16520, 16521, 16524, 16527, 16528, 16529, 16532, 16533, 16536, 16537, 16538, 16539, 16540, 16541, 16542, 16543, 16544, 16545, 16546, 16547, 16550, 16552, 16557, 16559, 16564, 16566, 16568, 16570, 16572, 16574, 16586, 16590, 16597, 16601, 16607, 16611, 16621, 16633, 16634, 16637, 16638, 16641, 16645, 16649, 16655, 16656, 16661, 16671, 16672, 16673, 16674, 16675, 16676, 16677, 16678, 16682, 16683, 16684, 16685, 16690, 16695, 16704, 16725, 16729, 16734, 16745, 16762, 16768, 16769, 16770, 16773, 16781, 16791, 16806, 16807, 16811, 16823, 16824, 16827, 16828, 16831, 16835, 16842, 16846, 16850, 16859, 16871, 16872, 16876, 16877, 16881, 16882, 16885, 16886, 16891, 16892, 16896, 16897, 16901, 16913, 16914, 16915, 16916, 16917, 16918, 16919, 16920, 16921, 16925, 16927, 16932, 16933, 16934, 16935, 16936, 16937, 16938, 16940, 16944, 16946, 16948, 16951, 16955, 16958, 16962, 16971, 16988, 16995, 17000, 17006, 17007, 17008, 17009, 17010, 17014, 17023, 17037, 17038, 17039, 17040, 17041, 17050, 17051, 17052, 17053, 17054, 17058, 17060, 17070, 17073, 17079, 17080, 17081, 17085, 17086, 17087, 17091, 17092, 17096, 17114, 17134, 17135, 17144, 17145, 17149, 17150, 17153, 17161, 17169, 17177, 17200, 17201, 17212, 17216, 17222, 17224, 17229, 17231, 17233, 17243, 17245, 17256, 17260, 17264, 17268, 17272, 17281, 17289, 17321, 17325, 17332, 17340, 17344, 17348, 17354, 17355, 17357, 17358, 17359, 17363, 17404, 17432, 17436, 17440, 17446, 17448, 17462, 17498, 17511, 17512, 17515, 17516, 17533, 17534, 17535, 17540, 17541, 17542, 17547, 17548, 17549, 17550, 17556, 17557, 17558, 17559, 17560, 17566, 17567, 17587, 17588, 17589, 17590, 17591, 17592, 17593, 17594, 17595, 17596, 17597, 17598, 17599, 17600, 17601, 17602, 17603, 17604, 17605, 17606, 17607, 17608, 17609, 17610, 17611, 17612, 17613, 17614, 17615, 17616, 17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630, 17631, 17632, 17633, 17634, 17635, 17636, 17637, 17638, 17639, 17640, 17641, 17642, 17643, 17644, 17645, 17646, 17647, 17648, 17649, 17650, 17651, 17652, 17653, 17654, 17655, 17656, 17657, 17658, 17659, 17660, 17661, 17662, 17663, 17664, 17665, 17666, 17667, 17668, 17669, 17670, 17671, 17672, 17673, 17674, 17675, 17676, 17677, 17678, 17679, 17680, 17681, 17682, 17683, 17684, 17685, 17686, 17687, 17688, 17689, 17690, 17691, 17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17701, 17702, 17703, 17704, 17705, 17706, 17707, 17708, 17709, 17710, 17711, 17712, 17713, 17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 17722, 17723, 17724, 17725, 17726, 17727, 17728, 17729, 17730, 17731, 17732, 17733, 17734, 17735, 17736, 17737, 17738, 17739, 17740, 17741, 17742, 17743, 17744, 17745, 17746, 17747, 17748, 17749, 17750, 17751, 17752, 17753, 17754, 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770, 17771, 17772, 17773, 17774, 17775, 17776, 17777, 17778, 17779, 17780, 17781, 17782, 17783, 17784, 17785, 17786, 17787, 17788, 17789, 17790, 17791, 17792, 17793, 17794, 17795, 17796, 17797, 17798, 17799, 17800, 17801, 17802, 17803, 17804, 17805, 17806, 17807, 17808, 17809, 17810, 17811, 17812, 17813, 17814, 17815, 17816, 17817, 17818, 17819, 17820, 17821, 17822, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830, 17831, 17832, 17833, 17834, 17835, 17836, 17837, 17838, 17839, 17840, 17841, 17842, 17843, 17844, 17845, 17846, 17847, 17848, 17849, 17850, 17851, 17852, 17853, 17854, 17855, 17856, 17857, 17858, 17859, 17860, 17861, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880, 17881, 17882, 17883, 17884, 17885, 17886, 17887, 17888, 17889, 17890, 17891, 17892, 17893, 17894, 17895, 17896, 17897, 17898, 17899, 17900, 17901, 17902, 17903, 17904, 17905, 17906, 17907, 17908, 17909, 17910, 17911, 17912, 17913, 17927, 17928, 17929, 17930, 17931, 17932, 17933, 17934, 17935, 17936, 17937, 17938, 17939, 17940, 17941, 17942, 17943, 17944, 17945, 17946, 17947, 17948, 17949, 17950, 17951, 17952, 17953, 17954, 17955, 17956, 17957, 17958, 17959, 17960, 17961, 17962, 17963, 17964, 17965, 17966, 17967, 17968, 17969, 17970, 17971, 17972, 17973, 17974, 17975, 17976, 17977, 17978, 17979, 17980, 17981, 17982, 17983, 17984, 17985, 17986, 17987, 17988, 17989, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18035, 18036, 18037, 18038, 18039, 18040, 18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 18111, 18112, 18125, 18126, 18127, 18128, 18129, 18130, 18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18140, 18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 18311, 18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320, 18321, 18322, 18323, 18324, 18325, 18326, 18327, 18328, 18329, 18330, 18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 18340, 18341, 18342, 18343, 18344, 18345, 18346, 18347, 18348, 18349, 18350, 18351, 18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361, 18362, 18363, 18364, 18365, 18366, 18367, 18368, 18369, 18370, 18371, 18372, 18373, 18374, 18375, 18376, 18377, 18378, 18379, 18380, 18381, 18382, 18383, 18384, 18385, 18386, 18387, 18388, 18389, 18390, 18391, 18392, 18393, 18394, 18395, 18396, 18397, 18398, 18399, 18400, 18401, 18402, 18403, 18404, 18405, 18406, 18407, 18408, 18409, 18410, 18411, 18412, 18413, 18414, 18415, 18416, 18417, 18418, 18419, 18420, 18421, 18422, 18423, 18424, 18425, 18426, 18427, 18428, 18429, 18430, 18431, 18432, 18433, 18434, 18435, 18436, 18437, 18438, 18439, 18440, 18441, 18442, 18443, 18444, 18445, 18446, 18447, 18448, 18449, 18450, 18451, 18452, 18453, 18454, 18455, 18456, 18457, 18458, 18459, 18460, 18461, 18462, 18463, 18464, 18465, 18466, 18467, 18468, 18469, 18470, 18471, 18472, 18473, 18474, 18475, 18476, 18477, 18478, 18479, 18480, 18481, 18482, 18483, 18484, 18485, 18486, 18487, 18488, 18489, 18490, 18491, 18492, 18493, 18494, 18495, 18496, 18497, 18498, 18499, 18500, 18501, 18502, 18503, 18504, 18505, 18506, 18507, 18508, 18509, 18510, 18511, 18512, 18513, 18514, 18515, 18516, 18517, 18518, 18519, 18520, 18521, 18522, 18523, 18524, 18525, 18526, 18527, 18528, 18529, 18530, 18531, 18532, 18533, 18534, 18535, 18536, 18537, 18538, 18539, 18540, 18541, 18542, 18543, 18544, 18545, 18546, 18547, 18548, 18549, 18550, 18551, 18552, 18553, 18554, 18555, 18556, 18557, 18558, 18559, 18560, 18561, 18562, 18563, 18564, 18565, 18566, 18567, 18568, 18569, 18570, 18571, 18572, 18573, 18574, 18575, 18576 }; #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", "UIDENT", "FCONST", "SCONST", "USCONST", "BCONST", "XCONST", "Op", "ICONST", "PARAM", "TYPECAST", "DOT_DOT", "COLON_EQUALS", "EQUALS_GREATER", "LESS_EQUALS", "GREATER_EQUALS", "NOT_EQUALS", "ABORT_P", "ABSENT", "ABSOLUTE_P", "ACCESS", "ACTION", "ADD_P", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANY", "ARRAY", "AS", "ASC", "ASENSITIVE", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "ATOMIC", "AT", "ATTACH", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BREADTH", "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", "COMPRESSION", "CONCURRENTLY", "CONDITIONAL", "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", "DEPTH", "DESC", "DETACH", "DICTIONARY", "DISABLE_P", "DISCARD", "DISTINCT", "DO", "DOCUMENT_P", "DOMAIN_P", "DOUBLE_P", "DROP", "EACH", "ELSE", "EMPTY_P", "ENABLE_P", "ENCODING", "ENCRYPTED", "END_P", "ENUM_P", "ERROR_P", "ESCAPE", "EVENT", "EXCEPT", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXECUTE", "EXISTS", "EXPLAIN", "EXPRESSION", "EXTENSION", "EXTERNAL", "EXTRACT", "FALSE_P", "FAMILY", "FETCH", "FILTER", "FINALIZE", "FIRST_P", "FLOAT_P", "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORMAT", "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", "INDENT", "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", "JSON", "JSON_ARRAY", "JSON_ARRAYAGG", "JSON_EXISTS", "JSON_OBJECT", "JSON_OBJECTAGG", "JSON_QUERY", "JSON_SCALAR", "JSON_SERIALIZE", "JSON_TABLE", "JSON_VALUE", "KEEP", "KEY", "KEYS", "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", "MATCHED", "MATERIALIZED", "MAXVALUE", "MERGE", "MERGE_ACTION", "METHOD", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NESTED", "NEW", "NEXT", "NFC", "NFD", "NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NORMALIZED", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", "OMIT", "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OTHERS", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNED", "OWNER", "PARALLEL", "PARAMETER", "PARSER", "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PATH", "PGPOOL", "PLACING", "PLAN", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "QUOTES", "RANGE", "READ", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF_P", "REFERENCES", "REFERENCING", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESTART", "RESTRICT", "RETURN", "RETURNING", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINES", "ROW", "ROWS", "RULE", "SAVEPOINT", "SCALAR", "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", "SOURCE", "SQL_P", "STABLE", "STANDALONE_P", "START", "STATEMENT", "STATISTICS", "STDIN", "STDOUT", "STORAGE", "STORED", "STRICT_P", "STRING_P", "STRIP_P", "SUBSCRIPTION", "SUBSTRING", "SUPPORT", "SYMMETRIC", "SYSID", "SYSTEM_P", "SYSTEM_USER", "TABLE", "TABLES", "TABLESAMPLE", "TABLESPACE", "TARGET", "TEMP", "TEMPLATE", "TEMPORARY", "TEXT_P", "THEN", "TIES", "TIME", "TIMESTAMP", "TO", "TRAILING", "TRANSACTION", "TRANSFORM", "TREAT", "TRIGGER", "TRIM", "TRUE_P", "TRUNCATE", "TRUSTED", "TYPE_P", "TYPES_P", "UESCAPE", "UNBOUNDED", "UNCONDITIONAL", "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", "FORMAT_LA", "NOT_LA", "NULLS_LA", "WITH_LA", "WITHOUT_LA", "MODE_TYPE_NAME", "MODE_PLPGSQL_EXPR", "MODE_PLPGSQL_ASSIGN1", "MODE_PLPGSQL_ASSIGN2", "MODE_PLPGSQL_ASSIGN3", "'<'", "'>'", "'='", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "':'", "$accept", "parse_toplevel", "stmtmulti", "toplevel_stmt", "stmt", "opt_single_name", "opt_qualified_name", "opt_concurrently", "opt_drop_behavior", "CallStmt", "CreateRoleStmt", "opt_with", "OptRoleList", "AlterOptRoleList", "AlterOptRoleElem", "CreateOptRoleElem", "CreateUserStmt", "AlterRoleStmt", "opt_in_database", "AlterRoleSetStmt", "DropRoleStmt", "CreateGroupStmt", "AlterGroupStmt", "add_drop", "CreateSchemaStmt", "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_collate_clause", "alter_using", "replica_identity", "reloptions", "opt_reloptions", "reloption_list", "reloption_elem", "alter_identity_column_option_list", "alter_identity_column_option", "set_statistics_value", "set_access_method_name", "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", "column_compression", "opt_column_compression", "column_storage", "opt_column_storage", "ColQualList", "ColConstraint", "ColConstraintElem", "opt_unique_null_treatment", "generated_when", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "DomainConstraint", "DomainConstraintElem", "opt_no_inherit", "opt_column_list", "columnList", "columnElem", "opt_c_include", "key_match", "ExclusionConstraintList", "ExclusionConstraintElem", "OptWhereClause", "key_actions", "key_update", "key_delete", "key_action", "OptInherit", "OptPartitionSpec", "PartitionSpec", "part_params", "part_elem", "table_access_method_clause", "OptWith", "OnCommitOption", "OptTableSpace", "OptConsTableSpace", "ExistingIndex", "CreateStatsStmt", "stats_params", "stats_param", "AlterStatsStmt", "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", "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", "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", "object_type_any_name", "object_type_name", "drop_type_name", "object_type_name_on_any_name", "any_name_list", "any_name", "attrs", "type_name_list", "TruncateStmt", "opt_restart_seqs", "CommentStmt", "comment_text", "SecLabelStmt", "opt_provider", "security_label", "FetchStmt", "fetch_args", "from_in", "opt_from_in", "GrantStmt", "RevokeStmt", "privileges", "privilege_list", "privilege", "parameter_name_list", "parameter_name", "privilege_target", "grantee_list", "grantee", "opt_grant_grant_option", "GrantRoleStmt", "RevokeRoleStmt", "grant_role_opt_list", "grant_role_opt", "grant_role_opt_value", "opt_granted_by", "AlterDefaultPrivilegesStmt", "DefACLOptionList", "DefACLOption", "DefACLAction", "defacl_privilege_target", "IndexStmt", "opt_unique", "access_method_clause", "index_params", "index_elem_options", "index_elem", "opt_include", "index_including_params", "opt_collate", "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", "opt_createfunc_opt_list", "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", "func_as", "ReturnStmt", "opt_routine_body", "routine_body_stmt_list", "routine_body_stmt", "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_relation", "reindex_target_all", "opt_reindex_option_list", "AlterTblSpcStmt", "RenameStmt", "opt_column", "opt_set_data", "AlterObjectDependsStmt", "opt_no", "AlterObjectSchemaStmt", "AlterOperatorStmt", "operator_def_list", "operator_def_elem", "operator_def_arg", "AlterTypeStmt", "AlterOwnerStmt", "CreatePublicationStmt", "PublicationObjSpec", "pub_obj_list", "AlterPublicationStmt", "CreateSubscriptionStmt", "AlterSubscriptionStmt", "DropSubscriptionStmt", "RuleStmt", "RuleActionList", "RuleActionMulti", "RuleActionStmt", "RuleActionStmtOrEmpty", "event", "opt_instead", "NotifyStmt", "notify_payload", "ListenStmt", "UnlistenStmt", "TransactionStmt", "TransactionStmtLegacy", "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", "drop_option_list", "drop_option", "AlterCollationStmt", "AlterSystemStmt", "CreateDomainStmt", "AlterDomainStmt", "opt_as", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "any_with", "CreateConversionStmt", "ClusterStmt", "cluster_index_specification", "VacuumStmt", "AnalyzeStmt", "utility_option_list", "analyze_keyword", "utility_option_elem", "utility_option_name", "utility_option_arg", "opt_analyze", "opt_verbose", "opt_full", "opt_freeze", "opt_name_list", "vacuum_relation", "vacuum_relation_list", "opt_vacuum_relation_list", "ExplainStmt", "ExplainableStmt", "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", "MergeStmt", "merge_when_list", "merge_when_clause", "merge_when_tgt_matched", "merge_when_tgt_not_matched", "opt_merge_when_condition", "merge_update", "merge_delete", "merge_insert", "merge_values_clause", "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_search_clause", "opt_cycle_clause", "opt_with_clause", "into_clause", "OptTempTableName", "opt_table", "set_quantifier", "distinct_clause", "opt_all_clause", "opt_distinct_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", "opt_alias_clause_for_join_using", "func_alias_clause", "join_type", "opt_outer", "join_qual", "relation_expr", "extended_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", "json_table", "json_table_path_name_opt", "json_table_column_definition_list", "json_table_column_definition", "path_opt", "json_table_column_path_clause_opt", "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", "JsonType", "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_indent_option", "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", "func_arg_list_opt", "type_list", "array_expr", "array_expr_list", "extract_list", "extract_arg", "unicode_normal_form", "overlay_list", "position_list", "substr_list", "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", "json_passing_clause_opt", "json_arguments", "json_argument", "json_wrapper_behavior", "json_behavior", "json_behavior_type", "json_behavior_clause_opt", "json_on_error_clause_opt", "json_value_expr", "json_format_clause", "json_format_clause_opt", "json_quotes_clause_opt", "json_returning_clause_opt", "json_predicate_type_constraint", "json_key_uniqueness_constraint_opt", "json_name_and_value_list", "json_name_and_value", "json_object_constructor_null_clause_opt", "json_array_constructor_null_clause_opt", "json_value_expr_list", "json_aggregate_func", "json_array_aggregate_order_by_clause_opt", "opt_target_list", "target_list", "target_el", "qualified_name_list", "qualified_name", "name_list", "name", "attr_name", "file_name", "func_name", "AexprConst", "Iconst", "Sconst", "SignedIconst", "RoleId", "RoleSpec", "role_list", "PLpgSQL_Expr", "PLAssignStmt", "plassign_target", "plassign_equals", "ColId", "type_function_name", "NonReservedWord", "ColLabel", "BareColLabel", "unreserved_keyword", "col_name_keyword", "type_func_name_keyword", "reserved_keyword", "bare_label_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, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 60, 62, 61, 43, 45, 42, 47, 37, 94, 777, 91, 93, 40, 41, 46, 59, 44, 58 }; # endif #define YYPACT_NINF -5863 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-5863))) #define YYTABLE_NINF -2992 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-2992))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 11769, 1936, 11261, -5863, -5863, 1936, 71964, -5863, 81635, 33, 901, 1413, 222, 21122, 82144, 93342, 1008, 397, 21011, 1936, 93342, 2232, 62292, 77563, 373, 93342, 1576, 1177, 62292, 93342, 93851, 94360, 1432, 1581, 1421, 94869, 82653, 76036, 1885, 93342, 1612, 1839, 95378, 83162, 1586, 83671, 1177, 57213, 470, 1509, 95887, 93342,120744, 1839, 84180, 84180, 84180, 2383, 2164, 1717, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 1530, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2218, -5863, 1278, 2402, 63, 986, 1726, -5863, -5863, 2277, 71964, 93342, 93342, 93342, 2008, 93342, 1920, 93342, 980, 71964, 68401, 84689, 2123, 1907, 53025, 96396, -5863, 71964, 93342, 65856, 71964, 93342, 93342, 96905, 93342, 97414, 93342, 1990, 80108, 93342, 2069, 93342, 93342, 66365, 97923, 2287, 1461, 282, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2026, 2010, -5863, 307, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 62801, 93342, 10760, 1576, 2277, -5863, 2383, 93342, 2301, 93342, 2046, 98432, 93342, -5863, 93342, 2018, 98941, 1014, 1943, 68401, 2170, 53553, 2270, 93342, 93342, 68401, 99450, 99959,100468, 93342, 93342, -5863, -5863, 2221, 93342, -5863, 2377, 68910, 1823, 2393, 2569, 2463, 1334, -5863, 85198, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 71455, 397, -5863, -5863, 2403, 72473, 2485, -5863, -5863,100977,121239, 2235, -5863, 1040, 72982, 69419, 2614, 2231, 54081, 2652, -5863, 73491, -5863, 69928, 74000, -5863, -5863, -5863, -5863, -5863,101486, -5863,101995, 2329, 2485, -5863,121734, 70437, -5863, 2505,102504,103013,103522, 2277, 2222, 1543, 1281, 47318, -5863, -5863, -5863, 2290, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 383, 1501, 270, 273, 308, -5863, -5863, 274, 291, 295, 383, 2756, 2756, -5863, 93342, -5863, -5863, 1501, 90, 2349, 2251, 2251, 2251, 2484, 37, -5863, 2251, 2423, -5863, -5863, -5863, -5863, 83671, -5863, 2265, 1576, 257, 85707, 71455, 1576, 2775,104031, 86216, 2366, 2429, 2552, -5863, -5863, 999, -5863, 1576, 2339, 2850, 2450, 62801, 964, 93342, -5863, -5863, 2865, 2409, 2700, 2437, -5863, -5863, 2627, 2642, 187, 998, 1576, 285, -5863, 2795, -5863, 2675, 32161, 32161, 86725,104540, 87234, 2949, 1568, -5863, -5863, -5863, 2992, 2549, 2821, 2437, 1461, 49378, -5863, -5863, 2539, 2010, 83671, -5863, -5863, -5863, 62801, 2895, 35323, 93342, 2558, -5863, 2553, 2558, -5863, -5863, 2636, -5863, 2636, 2636, 2598, 2598, 2785, 2656, -5863, -5863, -5863, -5863, 2103, 2636, 2598, -5863,122724, -5863, 2041, 2054, -5863, -5863, 3116, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2661, -5863, 1019, -5863, 2145, -5863, -5863, -5863, 32161, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2665, 2678, 63, -5863, 12510, 62801, 93342, 1889, 1889, 3106, 1889, 1617, 2021, -5863, 2644, -5863, 3047, 3007, 3013, 83671, 2730, 1569, -5863, 1477, 2738, 177, 2745, 1951, 2825, -5863, 1001, 93342, 503, 2748, 87743, 4017, 2758, 2010, 2773, -5863, -5863, -5863, -5863, 2941, 454, -5863, -5863, -5863, -5863, 3108, 3153, 6456, 351, 88252, -5863, -5863, -5863, -5863, 93342, 93342, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2777, 1884, -5863, -5863, 2776, 3156, 3010, 4231, 1416, 3121, 2956, 1799, 9432, 3022, 1718, 3175, 8506, 1863, 3176, 1976, 2188, 85707, 93342, 3140, 3189, 5558, 1838, 289, 3039, 1120, 3121, 3179, 2988, 1799, 3200, 6980, 93342, -5863, 3110, 3237, 131, -5863, 230, -5863, 24838, 35323, 56704, -5863, 2010, -5863, 1268, -5863, -5863, 61783, -5863, 2893, 3059, 96, 71964, 2838, 93342, 93342, -5863,120744, 71964, -5863, 3072, 54609, 71964, -5863, 71964, -5863, -5863, 3205,120744, 93342, 93342, -5863, 93342, -5863, -5863, 2842, -5863, -5863, -5863, -5863, -5863, 2251, 93342, 3306,120744, 3089, 196, 1740, 3345, 93342, 3092, 1740, 2892,105049, -5863, -5863, 1740, -5863, -5863, -5863, 93342, 93342, 2855, 2285, 3082, 942, 1740, 3100, 3346, 3354, 3109, 2947, 3114, 2553, -5863, 3316, 3086, 1135, 233, 2302, 1740, 2927, 105558,106067, 93342, 2929, 93342, 3329, 71964, 2968, 71964, 71964, 93342, 3251, 93342, -5863, 3080, -5863, -5863, 1264, -5863, -5863, -5863, -5863, -5863, 3271, -5863, 237, 3272, 2901, 3281, 1861, 3282, 302, -5863, -5863, 2945, -5863, 3290, 333, -5863, 3292, -5863, 2910,106576, -5863,107085,107594, 3295, 335, -5863, 68401, 3296, 333, 3297, 2910, 3298, 333, 3299, 1043, 3300, -5863, 1382, 3287, 3303, 302, 3307, 2340, 2910, -5863, 3308, 375, -5863, 3310, 386, -5863, 3315, 3155, -5863, 35323, -5863, 3034, -5863, 1509, 2153, 1281, 1501, -5863, 93342, 1501, 93342, 1501, 93342, 1501, 93342, 1501, 93342, 93342, 93342, 1501, -5863, -5863, -5863, 93342, 2946, 93342, -5863, 93342, -5863, -5863, -5863, 78581, 68401, 79090, -5863, 93342, -5863, 881, 1576, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 70946, 3360, -5863, 1749, -5863, 2437, 369, 1576, 2332, 3376, 60256, 60765, 93342, -5863,120744, 3455, 68401, 3329, 2154, -5863, -5863, 3329, -5863, -5863, 3329, 3329, -5863, -5863, -5863, 3243, 3327, 78581, 68401, 3328, -5863, 108103, -5863, 71455, 3188, 2966, -5863, -5863, -5863, -5863, -5863, 2161, 3496, 263, 3498, 35323, 2971, 263, 263, 2974, 3340, -5863, -5863, -5863, 309, 2978, 2981, -5863, 280, 280, -5863, 2983, 2989, -5863, 283, 2993, 2996, 3527, 3529, 284, 304, 3011, 3014, 3016, 3017, 3018, 3019, 3023, 3024, 3025, 3027, 3028, 3031, 3033, 2103, 263, 3035, 35323, -5863, 3038, 280, 3042, 3048, 3050, 3541, 3052, -5863, 3550, 3055, -5863, 347, 353, 3056, 3058, -5863, 3294, -5863, 323, 3060, 3061, 3063, 3064, 3069, 3073, 3074, 3075, 35323, 35323, 35323, -5863, 29521, 2010, 1576, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 324, -5863, 51441, -5863, 3118, -5863, -5863, 3261, -5863, -5863, 35323, -5863, -5863, 3446, 139, -5863, 326, -5863, -5863, -5863, 2010, 3392, 3078, -5863, 2070, 3079, -5863, 2143, -5863, 3581, -5863, 3360, 230, -5863, -5863, 3370, -5863, 93342, -5863, -5863, 2010, 216, 2174, -5863, 2290, 20763, 2195, 2558, 93342, 93342, 3585, -5863, 3091, -5863, -5863, 35323, -5863, -5863, -5863, 2756, -5863, 2636, 2636, -5863, -5863, 3589, 3182, 3183, 2756, -5863, 2756, -5863, 3097, 3099, 2756, 3185, 3186, 3187, -5863, 3103, 3191, 2756, -5863, -5863, 63820, 2186, -5863, 3464, 366, -5863, -5863, -5863, 2199, -5863, 3104, -5863, 2553, -5863, -5863, 63, 63, 35323, 63, 293, 1588, 32688, 35850, 3472, 3341, 1012, 1890, 3473, -5863, 3347, 1617, 2021, 83671, 93342, 83671,108612, 3245, 35323, -5863, 3580, 3203, 3204, 3265, 59249, -5863, 3208, 3173, 3211, 3275, 3124, 3214, 3220, 3277, -5863, 3415, -5863, -5863, 3225, 3302, 3590, 3228,109121, -5863, -5863, 1134, -5863, -5863, -5863, 1134, -5863, 3157, 1528, 1636, 343, 3232, 336, 1456, 3588, -5863, 1510, -5863, -5863, 3301, -5863, 21649, 93342, 3528, 8008, 3378, 351, 3309, -5863, -5863, -5863, 3436, 3241, 93342, 3242, 3394, 351, 364,109630, -5863, -5863, 93342, -5863, -5863, -5863, -5863, 7073, 3565, 28002, -5863, 2060, 3247, 3226, 3259, 93342, 75018, 1874, 3371, 3393, 1655, 2216, 990, 3320, 93342, 355, 3403, 93342, 3172, 3260, 3262, 3516, 3180, 751, 3623, 3184, -5863, -5863, -5863, 3592, -5863, 540, 550, 3397, -5863, 3517, 3560, 8236, 3252, 3253,118764, -5863, 3276, 790, 55137, 93342, 93342, 3283, 3284,110139, 7073, 3600, 79599, 79599, 3285, 3286, 48863, 3615, 2031, 3288, -5863, -5863, -5863, 2031, 3289, 3293,110648, 7073, 3606, 93342, 3314, 3318, 93342,122724, 351, -5863, 3678, 351, 351, 2191, 3679, 3319, 395, 3463, 663, 1740, 3184, 2979, -5863, 3330, 3334, 1158, -5863, 3430, 93342, 3335, 3336, 143, 3396, 1576, -5863, 3398, -5863, 3337, 3399, 3342, 92, 2855, -5863, -5863, 3338, 83671, 3414, 3416, 355, 290, 747, 3184, -5863, 3343, 3344, 3180, 3180, 93342, 93342, 93342, 93342, 93342, 310, 3697, 311, 3348, 262, 1215, 3210, -5863, 2031, 66874, 3351, -5863, 2031, 93342, 275, 754, 3184, 2158, 2098, -5863, -5863, -5863, 1461, -5863, 35323, 35323, 35323, 3221, -5863, 1929, 20763, 1067, -5863, 344, 11513, 3216, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 93342, 62801, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 93342, -5863, 93342, 3552, 120744, 3563, 3480, 3569, 3570, 351, 93342, 93342, 3575, 3576, 3577,120744, 3579, 3582, 3583, 3497, 3361, 206, 3352, 3278, 3776, 3665, 93342, 63820, -5863, 1134, -5863,120744, 3515, 3667, -5863, 93342, 3533, 786, -5863, 3706, 3355, -5863, -5863, 124, 93342, 78072, 2855, -5863, -5863, 3671, 68401, 412, 3672, 1576, 3349, 3673, 3523, 1576, 68401, 3574, 93342, 93342, 93342, 93342, 158, -5863, 66874, 3542, -5863, 93342, 3544, 2979, 3545, 3800, 1266, 2251,111157, 3668, -5863,111666, 3312, 93342, 3313, 3313, 3802,120744, 1173, 3599, -5863, -5863, 2451, -5863, 3452, -5863, 71964, -5863, -5863, 71964, -5863, -5863,120744, 93342, 3317,120744, 120744, -5863, -5863, 71964, 71964, -5863, 68401, 68401, 3687, 375, 3688, 3377, 3691, 3381, 55137, 55137, -5863, 392, 71964, -5863, 68401, 71964, -5863, 93342, -5863, 93342, -5863, -5863, -5863, -5863, 120744,120744, -5863, 68401, 66874, 3693, 93342, 93342, -5863, 93342, 93342, -5863, 93342, 93342, 2200,112175, 1281, -5863, 93342, -5863, 93342, -5863, 93342, -5863, 93342, -5863, 93342, -5863, -5863, -5863, 93342, -5863, 93342, 2205, -5863, -5863, 2207, 1634, 93342, 93342, 250, 71964, 93342, 3553, 93342, 71964, 71964, 93342, 93342, 93342, 93342, 93342, 3408, 3079, 163, -5863, 367, 318, 83671, 3562, -5863, -5863, -5863, 1576, -5863, -5863, -5863, -5863, -5863, 345, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3321, -5863, -5863, -5863, -5863, 3321, -5863, -5863, 2211, 2383, 53, 93342, -5863, 93342, 93342, 93342, -5863, 77563, 3680, 200, 79090, 93342, -5863, -5863, 6625, 35323, 2010, 31629, -5863, -5863, 20763, 3373, 35323, 35323, 3331, 2756, 2756, -5863, 365, 35323, 35323, 35323, 28994, 35323, 35323, 33215, 35323, 35323, 35323, 35323, 35323, 35323, 2756, 2756, 3326, 35323, 3561, 35323, 55137, 35323, 41120, 25904, 35323, 35323, 30048, 313, 2983, 35323, 3586, 42168, 35323, 2332, 3591, 35323, 2332, 3561, 3851, 3851, 2898, 7500, 3332, 2010, -5863, 2756, 252, -5863, 430,120744, 35323, 35323, 35323, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 35323, -5863, 63820, -5863, -5863, -5863, -5863, -5863, -5863, 883, -5863, -5863, -5863, -5863, -5863, -5863, 2924, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 93342, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 30575, -5863, -5863, -5863, -5863, 3358, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3467, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 31102, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3359, -5863, -5863, 35323, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3422, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 1201, 35323, 35323, 35323, 35323, 35323, 35323, 35323, 35323, 35323, -5863, 35323, 575, -5863, -5863, 3686, 3446, 69, 465, 3362, 3555, 88761, 32161, 3464, 24838, -5863, 258, 3464, -5863, -5863, -5863, 93342, 3581, 3426, -5863, 3368, 3682, 3683, 1043, 93342, 2455, 35323, 883, 296, 93342, 35323, 3358, 3467, 35323, 3359, 35323, 3422, -5863, 35323, -5863, 2217, 907, 35323, 2225, 3369, -5863, -5863, 3356, 3099, 3375, 3383, 3374, 3379, 2756, 269, 3380, 1470, 1443, 3494, 2756, 3621, 3382, -5863, 63820, -5863, 44228, 3417, -5863, -5863, -5863, 1839, 93342, 93342, -5863, 3690, -5863, 3385, -5863, 17973, 3690, -5863, -5863, 41644, 3502, 3676, 3602, -5863, -5863, -5863, 3387, 20763, 36377, 36377, -5863, 2125, 20763, 2240, -5863, -5863, -5863, -5863, -5863, -5863, 1711, -5863, 93342, 869, 3472, 1890, 3440, 1940, 3870, 3441, 93342, -5863, 49893, 2236, -5863, 68401, 93342, 93342, 3601, -5863, 3860, -5863,122724, -5863, 3395, -5863,122229,117774, -5863, -5863, 1032, -5863, 541, 68401, -5863, 93342, 93342, 68401, 93342, 93342, -5863, 68401, 85707, 3444, 93342, 93342, -5863, -5863, -5863, -5863, -5863, 61274, 775, 77563, 3539, 76545, -5863, -5863, 3400, 93342, 3632, -5863, -5863,112684, -5863, 3634, 68401, 93342, 93342, 35323, 3635, 93342, 93342, -5863, 988, 3489, 3495, -5863, 93342, 3499, 71964, 3407,120744, 71964, 55665, 71964, 71964, 3772,120744, 93342, 93342, 1372, 83671, 338, 1024, 3184, 3648, -5863, 379, -5863, 68401, -5863, 93342, 3640, -5863, -5863, -5863, 89270, -5863, -5863, -5863,113193, -5863, -5863, 3642, -5863, 2238, -5863, 68401, 68401, 93342, 8707, 3419,113702, 93342, 34, 3711, 3663, 3717, 1211, -5863, -5863, -5863,120744, -5863, 93342, 89779, 93342, 93342, 3708, 93342, 80617,114211,114720, 118, 803, 3709, 93342, 81126, 3710, -5863, 3578, 93342, -5863, -5863, 64329, 68401, 93342, 1054, 63820, -5863, 3694, -5863, 93342, -5863, 1430, -5863, 93342, 7336, 3655, -5863, -5863, 3518, 3532, 93342, 436, 1094, 3184, 3838, 93342, 93342, 3433, 2244, 68401, 93342, 63820, -5863, 3664, 826, 68401, 93342, 89270, -5863, 3669, -5863, 83671, 3774, -5863, 3435, 2251, 2539, 2047, 3435, 68401, 93342, -5863, 3435, 93342,104540, -5863, 68401, 1349, -5863, 68401, 93342, 89270, -5863, 3675, 3613, 68401, 93342, 14139, -5863, -5863, -5863, 351, -5863, -5863, -5863, -5863, -5863, 93342, 93342, 351, 93342, 93342, 351, 342, -5863, 68401, 93342, -5863, -5863, -5863, 3603, 68401, 93342, 93342, 378, 93342, -5863, 93342, 68401, 3490, 93342, 93342, -5863, -5863, 93342, 5665, 93342, 93342, 93342, 93342, 93342, 93342, 68401, 93342, -5863, -5863, 1393, 103, 2001, 2020, 892, 93342, 3790, 93342,115229, 1576, 68401, 93342, 93342, 1576, 93342, 63820, 2187, -5863, -5863, 3593, -5863, 68401, 1349, -5863, 8726, 93342, 93342, 93342, 3546, 3547, 241, 3646, -5863, -5863, -5863, 1207, 1207, 3689, -5863, 35323, 35323, 33742, 3469, -5863, -5863, 35323, 2893, -5863, -5863, -5863, 1184, 3968, 1184,115738, 1184, 1184, 3784, 3538, 3543, 1184, 1184, 1184, 3768, 1184, 1184, 1184, 93342, 3666, -5863, -5863, 3666, 218, 35323,120744, 93342, -5863, 2255, -5863, 3493, -5863, -5863, 63820, 93342, 880, 1062, 3856, 3712, 75527, 1493, 3847, 93342, 3535, 93342, 3983, 3595, 1803, -5863, 1493, 93342, -5863, 2580, 77563, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 93342, -5863, -5863, 3855, 93342, 44743, 3685, -5863, 1576, 2855, 2855, 2855, 2855, 3500, 2855, 93342, 3639, 3874, 1493, 3505, 3876, -5863, 2979, 3885, 1341, 93342, 3741, 75527, 3572, 3554, 3754, 4011, 2251, 1576, 3758, 3744, -5863, 59747, -5863, 2855, 4027, 28498, 7241, 7996, 3748, 3814, -5863, -5863, 3757, 1096, 93342, 3868, 3869, 3891, -5863, 237, -5863, 4025, 1861, 3895, 302, -5863, 333, -5863, 2910, -5863, 93342, -5863, 93342, 93342, 93342, 93342, 335, -5863, -5863, 333, 2910, 333, 1043, -5863, 3825, 302, 2910, 3670, 3900, 375, -5863, 386, -5863, 3765, 1043, -5863, 3783, 2251, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2259, -5863, 93342, -5863, 3877, 3879, 3881, 3892, 3893, 3558, 3559, 3597, 93342, 3564, 3558, 351, 3566, 3567, -5863, 3564, 3564, 3558, 3079, 3079, 3558, 3559, 67383, 4018, 63820, -5863, -5863, 3658, 3587, 3933, 961, -5863, 1083, 110, 3840, -5863, -5863, -5863, -5863, 2756, 252, 61783, -5863,120744, -5863, 68401, 3620, -5863, -5863, -5863, 3806, 3584, 67383, 1043, 228, -5863, 71964, 93342,120744, 71964, 3816, 71964, 71964,120744, 93342, 93342, 2267, -5863, 2005, -5863, 2030, 35323, 542, -5863, 18286, 2276, 35323, 3598, 3609, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3610, 3942, -5863, 2278, 2283, 18379, 2536,120744, 1606, 3614, -5863, 3611, 251, 3811, 3594, 6507, 3650, 2292, 3616, 286, -5863, 6507, 370, 3612, 7779, 3777, 3617, 2322, 3619, 3624, -5863, 6732, 6867, 3625, 18471, 3618, 3626, 3628, 3630, 41120, 41120, 29521, 1017, -5863, 41120, 3633, 3850, 2327, 14658, 3636, 3637, 18693, 34269, 35323, 34269, 34269, 19070, 3629, 3638, -5863, 4040, -5863, 2334, 63820, 3846, 19117, 2344, -5863, 35323, 63820, 7405, 35323, -5863, 35323, 3645, -5863, -5863, 4848, 4848, 4848, 3561, -5863, -5863, 3674, -5863, 41120, 41120, -5863, 3291, 29521, -5863, -5863, 4004, -5863, -5863, 622, -5863, -5863, -5863, -5863, -5863, 3483, -5863, -5863, -5863, 3896, 2536, 3372, 55137, 8956, 35323, 297, 35323, 3358, 35323, 3735, 4848, 4848, 4848, 469, 469, 321, 321, 321, 2194, 465, -5863, -5863, -5863, 3649, 3652, 3555, 3656, 35323, -5863, 3696, 50408, -5863, 2400, 2414, 93342, 3488, 5848, 6318, -5863, -5863, -5863, 3417, 1067, 3417, -5863, 1461, -5863, -5863, -5863, -5863, -5863, -5863, 93342, 20763, -5863, -5863, 3926, 3659, 2346, -5863, -5863, 2756, -5863, -5863, 2472, 2472, 3661, -5863, 3681, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3662, -5863, -5863, -5863, 3684, 3692, 45258, 4023, 3695, 43713, 90288, 3713, 2245, -5863, 90288, 90797, 90288, 90288, -5863, 3698, -5863, -5863, 2010, 35323, 4015, -5863, -5863, -5863, 35323, -5863, -5863, 1142, 3714, 121, 863, 2571, 2571, 2125, 1279, -5863, -5863, 3732, -5863, 35323, 2763, -5863, 2824, -5863, -5863, -5863, -5863, 3079, -5863, 3944, -5863, -5863, -5863, 44228, 3718, 3729, 1939, 48348, 3914, -5863, 93342, 44228, -5863, 93342, 314, -5863, 3700, -5863, -5863, -5863, -5863, -5863, -5863, 117774, 2145, -5863,122229, -5863,122229, -5863, 2145, 4168, -5863, 117774, 2055, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 68401, 68401, 3923, 93342, 3937, 3936, 35323, 1575, -5863, 4092, 1043, -5863, -5863, 3805, -5863, 20763, -5863, -5863, -5863, -5863, -5863, 68401, 93342, -5863, 71455, -5863, -5863,120744, -5863, -5863, 93342, 93342, -5863, -5863, -5863, 120744, -5863, -5863, -5863, 93342, 978, 3810, 3812, 93342, -5863, 1462, 3430, 9379, 93342, 93342, 93342, 4044, -5863, -5863, -5863, -5863, 3964, -5863, 4102, -5863,117774, -5863, 2910, 1469, 3817, 3184, 35323, 3971, -5863, 249, 93342, 3734, 3736, 4109, 1672, 4063, 3737, -5863, 3853, -5863, 3878, 904, -5863, -5863, 3882, -5863, -5863, -5863, -5863, 4121, 1043, 4122, 1043, 93342, 93342, 93342, 93342, 3887, -5863, -5863, -5863, -5863, 3890, 4034, -5863, 63820, 63820, 63820, 2350, -5863, -5863, 1576, -5863, -5863, -5863, -5863, -5863, -5863, 4080, -5863, 2352, -5863, 1527, 91306, -5863, -5863, -5863, -5863, -5863, 4128, 68401, 93342, 9753, 93342, 93342, 93342, 3981, 1998, 1721,120744, -5863,119259, -5863, -5863, 2367, -5863, 3766, 93342, 3844, 68401, 3820, -5863, -5863, -5863, 4134, 2251, 3906, 79599, 3808, 3808, 2080, -5863, -5863, -5863, -5863, -5863, 4045, 3966, -5863, 1257, 3969, 68401, 3830, -5863, -5863, -5863, -5863, 4141, 3859, -5863, -5863, 3861, 1097, 3184, 2979, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3884, -5863, -5863, -5863, -5863, -5863, -5863, 1916, 1916, -5863, -5863, -5863, 1916, 1724, 305, 1188, 3184, -5863, 1063, 1492, 3863, -5863, 3864, -5863, -5863, -5863, 4049, 4050, 4052, 3872, 3873, 3918, 3875, 3880, 3932, -5863, 3883, 3934, 3886, 3935, 3888, 4197, 1043,120744, 4039, 1576, 3924, 4175, 1043, -5863, -5863, 3889, -5863, 3901, -5863, 2368, 4287, 4291, -5863, 93342, -5863, 438, 1220, 3184, -5863, 3902, -5863, 68401, 93342, -5863, -5863, -5863, 35323, 3804, 3818, 3821, 20763, 20763, 35323, -5863, -5863, 20763, 3807, -5863, -5863, -5863, -5863,120744, -5863, 93342, 4119, -5863, -5863, 1184, 93342, 93342, -5863, -5863, -5863, 93342, -5863, -5863, -5863, 4131, -5863, 586, 586, -5863, -5863, 4169, 8309, 3822, 199, -5863, 63820, 51969, 3222, 938, 1740, -5863, 71455, 93342, 71455, -5863, 1062, 4051, 93342, 93342, 93342, 3831, 3834, -5863, -5863, -5863, -5863, 68401, 932, 68401, 2756, -5863, -5863, 3911, -5863, 93342, 2251, 4366, 4202, 3490, -5863, 4327, 3354, 412, 1875, 327, 2947, 4263, 2553, 35323, 441, -5863, -5863, 2010, 93342, 3554, -5863, -5863, -5863, -5863, 1576, -5863, 3843, 3842, -5863, 93342, 4211, 93342, 93342, 93342, 93342, 3620, 3852, 93342, 3854,120744, 93342, 2542, 3180, 4349, 4233, 2383, 3572, 3947, 4234, 83671, 3871, 2373, -5863, -5863, 1096, -5863, 2380, 197, -5863, 1576, 71455,118269, 4225, -5863, 1004, 7996, -5863, -5863, 1004, 947, 93342, -5863, -5863, -5863, -5863, 4095, 2348, -5863, 4209, -5863, -5863, 2383, -5863,120744, 3865, -5863, 2384, -5863, -5863, -5863, 375, 3928, 1043, 3931, 1043, -5863, -5863, -5863, -5863, 93342, -5863, 93342, 66874, -5863, -5863, 93342, -5863, 4247, -5863, -5863, 4016, 4019, 4020, 4021, 4024, 93342, 3558, -5863, 3897, 93342, 93342, 68401, 1921, -5863, -5863, 68401, 292, -5863, 876, -5863, 83671, 4007, -5863, -5863, -5863, -5863, 4252, 4257, -5863, 3898, -5863, -5863, -5863, -5863, 1033, -5863, 78581, 376, -5863, 68401, 4190, 4191, 4192, 4193, 351, 4194, 4196, 4198, 4200, 4201, -5863, -5863, -5863, 3894, 19147, 35323, -5863, 4274,120744, -5863, 9205, -5863, -5863, -5863, 35323, -5863, -5863, 4199, -5863, -5863, 3963, 3972, 3899, 3614, 3777, -5863, 4123, 4130, 35323, 3777, 4377, 408, 35323, 35323, 35323, -5863, -5863, 4135, 4137, 35323, 2536, 2536, 35323, -5863, 3904, 35323, -5863, -5863, -5863, -5863, 2413, 35323, -5863, 35323, -5863, -5863, 26437, 4435, 4435, 3913,120744, 41120, 41120, 41120, 41120, 1700, 3042, 41120, 41120, 41120, 41120, 41120, 41120, 41120, 41120, 41120, 41120, 560, -5863, 4132, 35323, 35323, 34796, -5863, -5863,120744, 3919, 3629, 3921, 3925, 35323, -5863, -5863, -5863, 2390, 42683, 3927, 63820, -5863, 35323, 17823, 2397, 3970, 19455, 2010, 9572, 1576, 35323, 1239, 1369, 35323, 2401, 35323, -5863, -5863, -5863, -5863, 4281, -5863, -5863, -5863, -5863, -5863, -5863, 4170, 2536, -5863, -5863, 35323, 3930, 3461, 41120, 41120, 3957, -5863, 4178, 35323, 29521, -5863, 3689, -5863, 26970, 3929, 35323,117265, -5863, -5863, 1177, 1177, 1177, 1177, -5863, 93342, 93342, 93342, 4015, 3939, 4015, 230, -5863, -5863, 2383, -5863, 3938, -5863, -5863, -5863, -5863, -5863, 35323, 90288, 90797, 90288, 90288, 3941, 43198, 27486, 2245, 3943, 93342, -5863, -5863, 3946, 44228, 4232, 4145, -5863, 44228, 4145, 1971, 4145, 4239, 4032, 50923, -5863, -5863, 3955, -5863, -5863, 4154, -5863, 2060, 20763, 4413, 4300, -5863, 3958, -5863, 3714, 1584, -5863, -5863, -5863, 1326, -5863, 4033, -5863, -5863, -5863, 3713, 36904, 4106, -5863, -5863, -5863, 4014, 2405, -5863, -5863, 4403, 4106, -5863, 2215, -5863, 2417, 49893, 3718, 35323, 2010, 2419, 2081, -5863, -5863,117774, -5863, 4037, 2910, 2910, 1563, 3558, 4326, 1563, 9624, -5863, 1742, 93342, -5863, 93342, -5863, -5863, -5863, 4460, 4028, 4029, 4256, -5863, 2745, -5863, -5863, 68401, 93342, -5863, -5863, -5863, 444, 1415, 3184, -5863, 4057, -5863, -5863, 4292, 93342, -5863, 4446, 4072, 93342, 10166, 4353, 4041, -5863, -5863, 45773, 93342, 93342, 93342, -5863, 93342, 93342, 1742, 91815, -5863, 4425, 1742, 4093, 4333, 1969, 3180, 395, 4464, -5863, 1419, -5863, -5863, 4059, -5863, 93342, -5863, 93342, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4124, -5863, -5863, -5863, -5863, 64329, -5863, -5863, 93342, -5863, 63820, 51969, 63820, -5863, -5863, -5863, 93342, -5863, 1751, 502, 1436, 3184, -5863, 4070, -5863, 4360, 4074, 4075, 4136, 247, 288, 4079, 4082, 4138, 3995, 3996, 3997, -5863, 63820, 52497, 4166, 93342, 2910, 4000, 4046, 93342, 3808, 92324, -5863, 4001, -5863, -5863, 3808, 383, 1576, -5863, -5863, 1576, 2910, 1576, 93342, 93342, 93342, 93342, 378, -5863, -5863, -5863, 4477, 4101, 93342, 93342, 93342, 93342, -5863, 4061, -5863, -5863, -5863, 93342, 93342, 4369, 260, 2357, 68401, 93342, 93342, 68401, 93342, 93342, 93342, 93342, 93342, 93342, 93342, 4235, -5863, 4468, 4391, 2448, 4436, 4096, 93342, -5863, 93342, 1576, -5863, 3430, 93342, 93342, 93342, 93342, -5863, -5863, -5863, -5863, -5863, 3689, -5863, 4030, 4328, 1184, -5863, 4330, 4336, 4338, 1184, -5863, -5863, 1740, -5863, 943, 93342, -5863, 2561, 93342, -5863, -5863, -5863, 3958, 540, 550, -5863, -5863, -5863, -5863, -5863, -5863, 4035, 93342, 93342, 41120, -5863, 497, 2147, 1536, -5863, 4323, 93342, 3294, -5863, -5863, -5863, 267, 93342, -5863, -5863, -5863, -5863, 4036, -5863, 1251, 3852, -5863, 4357, 75527, 2910, 68401, 68401, 2910, -5863, 120744, 4038, 3554, -5863, 265, 4120, -5863, 68401, 412,116247, 3349, 4076, 4265, 10290, 44228, 44743, 1916, -5863, 4043, 4042, -5863, -5863, 93342, 4051, 66874, 2425, 2979, 4536, 1305, 2222, -5863, 77054, 4246, 3852, 4357, -5863, 3180, 4276, 4271, -5863, 2383, 93342, 3620, 3554, 1576, 93342, 4041, 51969, -5863, 4579, 2362, -5863,117774, 35323, 35323, -5863, 4048, -5863, 4053, 7996, -5863, 4133, 4054, 4547, 35323, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4146, 4060, 93342, 93342, 1096, 93342, -5863, 4062, 3895, -5863, 3895, -5863, 93342, -5863, 93342, -5863, 1043, -5863, 4204, 1043, 93342, 93342, 93342, 93342, 93342, 93342, 3558, 351, 3567, -5863, -5863, 4412, 67383, 4415, -5863, 63820, -5863, -5863, -5863, -5863, -5863, 2426, 93342, -5863, -5863, 1576, -5863, 4487, 4424, 1043, 200, 1276, 1276, 1276, 1276, 4380, 1276, 1276, 1276, 1276, 1276, -5863, 35323, 20763, -5863, 4071, -5863, 20763, 4466, 4367, 4371, -5863, -5863, 4083, 4317, 4320, -5863, 4084, 35323, 3777, 19680, -5863, -5863, 4324, 4325, -5863, 3777, 3777, 19680, -5863, 19680, 4089, 10867, 19717, -5863, 2430, 35323, -5863, 2473, 2473, 2473, 1091, 4449, -5863, 2885, 2473, 2473, 2473, 407, 407, 271, 271, 271, 4435, 560, 19793, 20100, 19813, 4094, -5863, -5863, -5863, 3629, -5863, 37431, 130, 4571, 42168, -5863, -5863, -5863, 4143, 4150, 4099, -5863, 35323, 37958, 4097,122724, 4321, -5863, 2139, 35323, 35323, 3353, -5863, 5458, 35323, -5863, -5863, 3353, 577, 35323, 1922, 1991, 35323, 35323, 4463, 12659, 4105, -5863, 2436, 35323, 12723, 4313, -5863, 93342, 93342, 93342, 93342, -5863, -5863, -5863, 4300, 1576, 4300, 4108, -5863, 4110, -5863, -5863, -5863, -5863, 64838, 4113, 3846, 90288, 4117, 93342, 2245, 44228, -5863, -5863, 2090, -5863, 44228, 4417, -5863, 44228, 71964, -5863, 93342, 4139, 93342, -5863, 1889, 35323, 4164, 55137, -5863, -5863, -5863, -5863, 4212, -5863, 4355, 20763, 32161, -5863, 2383, 1882, 93342, 2010, 886, -5863, 35323, 4142, 93342, -5863, 4106, 20763, -5863, 4205, 2442, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4218, 77563, 4481, -5863, -5863, 2160, 4461, 238, -5863, 1043, -5863,120744, 93342, 93342, 93342, 3124, -5863, -5863, 93342, 93342, 93342, 93342, -5863, -5863, 68401, 93342, -5863, -5863, 93342, 35323, 2443, -5863, 4179, 4593, 209, 2447, -5863, 2469, 1742, -5863, 2470, -5863, -5863, 92833, -5863, 4051, 378, 497, 4479, 4480, 4375, -5863, 351, -5863, 4639, 497, 4381, 378, -5863, -5863, -5863, -5863, 3219, -5863,120744, 1043, 1043, -5863, -5863, -5863, -5863, -5863, 4155, -5863, 4621, 4245, 93342, 93342, 93342, 93342, 93342, 68401, 93342, 93342, 2756, 2756, 120744, 4147, -5863, 2756, 2756, 4148, -5863, 68401, 93342, 93342, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4236, -5863, 35323, 4612, -5863, -5863, -5863, -5863, -5863, 35323, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 68401, 93342, 4240, -5863, 4241, -5863, 1027, -5863, -5863, 93342, 93342, 93342, 93342, 4532, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4530, 93342, -5863, -5863, 1576, 1576,120744, 1043, 1043, -5863, -5863, -5863, 4248, -5863, -5863, 4157, 4469, 1184, -5863, 1184, 1184, 1184, -5863, 4160, -5863, 1740, 4569, -5863, 1742, 352, 4518, -5863, 35323, -5863, 1176, 1091, -5863, 4578, 4661, -5863, -5863, -5863, -5863, 3490, 2251, 3490, -5863, -5863, 71964, 1127, -5863, 4499, 880, 63820, 4399, 75527, 1063, 2057, 4177, 4314, -5863, 2910, 2910, 4242, 93342, 4674, -5863, -5863, -5863, -5863, -5863, -5863, 68401, 3820, -5863, 4426, 1613, 4543, 93342, 44743, -5863, 3713, -5863, -5863, -5863, 1576, -5863, -5863, 4322, 3554, -5863, 1435, 93342, 4418, 75527, 3620, 2480, -5863, -5863, -5863, 4228, 4663, 3572, -5863, 1063, 4246, -5863, -5863, 4640, 4286, 4238, 4688, -5863, 4286, 4553, 4427, 4203, -5863, 3871, -5863, 93342, -5863, 20763, 20763, 1576,123219, 1004,120744, 4561, -5863, 20763, 93342, 944, 4206, 4372, -5863, 4527, 1043, 2493, -5863, 1043, 1043, -5863, 93342, -5863, 3558, 3558, 3558, 3558, 3558, -5863, 4428, -5863, -5863, -5863, -5863, 4519, -5863, -5863, 67383, -5863, 1043, -5863, -5863, -5863, -5863, -5863, -5863, 1276, -5863, -5863, -5863, -5863, -5863, 20763, -5863, 93342, -5863, -5863, -5863, -5863, -5863, -5863, 3385, 4207, 35323, 1387, -5863, -5863, 4210, 4213, 3777, 3777, -5863, -5863, 35323, -5863, 13042, 41120, 4563, -5863, 35323, 35323, 35323, -5863, 4215, 2499, 2506, -5863, -5863, 130, -5863, 4571, -5863, -5863, -5863, 13563, 4270, 20763, 4334, 4216, 1539, 3353, 3353, 5458, 3353, 35323, 35323, 3353, 3353, 35323, -5863, -5863, -5863, 13696, -5863, 4694, 3689, -5863, -5863, -5863, -5863, 4164, -5863, 4164, 4362, 35323, -5863, 2511, 4717, 40066, 4676, -5863, 93342, 2518, -5863, 35323, 4226, -5863, -5863, 44228, 2090, 4227, 2523, 93342, 2527,120744, 38485, 20763, 93342, 3689, 4224, -5863, 93342, 3078, -5863, 1939, -5863, -5863, 4671, 45773, 4628, 20340, 35323, -5863, -5863, -5863, -5863, 67383, 4457, 67383, 1742, -5863, -5863, -5863, -5863, -5863, -5863, 4237, -5863, -5863, -5863, -5863, 4319, -5863, -5863, 84, 3562, 1742, -5863, 13809, 4565, 45773, 56193, 93342, -5863, 93342, -5863, 4407, 4565, 4565, -5863, -5863, -5863, -5863, 4732, 4618, 4620, -5863, -5863, 4244, -5863, -5863, -5863, 4468, -5863, -5863, 51969, 68401, 93342, -5863, 4332, -5863, -5863, -5863, -5863, -5863, -5863, 47833, 55137, -5863, 247, 4250, 4251, 288, -5863, -5863, -5863, 93342, 14894, 4254, 15090, 1374, 3562, 93342, 93342, 4258, 4259, 4261, 1926, 1209, 2038, 3558, 4609, 93342, -5863, -5863, -5863, 4468, -5863, -5863, 93342, -5863, 1184, -5863, -5863, -5863, -5863, 63820, -5863, 3325, 4160, 1576, 71964, 4743, 4743, 15240, 4489, -5863, -5863, 889, 4329, 4533, 4329, 4262, 93342, 267, 4266, 2529, -5863, 93342, 4269, 4392, 2227, 2227, 93342, 93342, 93342, 2535, 2383, 2910, 4046, 412, 4649, 75527, 4695, 4051, 493, -5863, 93342, 4769, 93342, 3620, 3852, 93342, 4275, -5863, -5863, 77054, 4500, 3222, 93342, 2542, 4246, 3572, 1505, 93342, -5863, 388, -5863, 2383, -5863, 93342, 83671, 45773, 4634, -5863,122229, -5863, 2540, -5863, -5863, -5863, 4365, 21871, 3417, 4405, 4409, 4282, 2258, 4653, 93342, 1275, -5863, -5863, -5863, -5863, -5863, -5863, 93342, 376, -5863, -5863, -5863, -5863, 4288, -5863, 4787, 35323, 1082, -5863, -5863, -5863, -5863, -5863, 4520, -5863, 4294, -5863, -5863, 2613, 1387, 20384, -5863, 2320, 41120, 20763, 20763, 20763, 35323, -5863, 35323, -5863, -5863, -5863, -5863, 1006, -5863, -5863, 4622, 4296, 3353, 3353, 3353, -5863, 35323, 245, -5863, -5863, 2261, 4720, 20415, 3698, 64838, 4301, -5863, 41120, 2544, -5863, 1978, 93342, 2550, -5863, 20763, 93342, -5863, -5863, 35323, -5863, 2559, -5863, 4304, 1471, 4305, 25371, 4303, -5863, -5863, -5863, -5863, -5863, 20763, 4306, -5863, 4796, 1890, -5863, -5863, 4370, 93342, 2565, -5863, 149, 945, 1320, -5863, 4808, 4808, 20763, 1921, 1563, 523, -5863, 93342, 4414, -5863, 4593, 4315, 3490, -5863, 4318, -5863, -5863, 1801, 3180, 93342, 3490, 3490, 3222, 4660, -5863, -5863, 35323, 4385, -5863, 1395, 3562, 93342,120744, -5863, 160, 4691, -5863,120744, 120744, -5863, -5863, -5863, 35323, -5863, 4422, -5863, -5863, -5863, 35323, 35323, 74509, -5863, -5863, 93342, 93342, 93342, 93342, 93342, -5863, 1043, -5863, -5863, 2567, -5863, 46803, -5863, -5863, 3345, 1576, 3345, 2104, -5863, -5863, 3345, 3345, -5863, 3417, -5863, 4743, 1644, -5863, -5863, 4575, 4337, 35323, 4667, -5863, 1403, 4570, -5863, 4344, -5863, 71964, 4874, -5863, 63820, 3852, 4357, 93342, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 2578, 4051, 4718, 3554, 4238, -5863, 93342, 4389, -5863, 44228, 4051, 2383, 2222, -5863, 4246, 3852, 4357, -5863, -5863, 4351, 4271, 3572, 2542, 4502, -5863, 4503, -5863, 4818, 4580, 4820, 3620, -5863, 4041, 2589, 93342, -5863, -5863, 7996,123219,120744, -5863, -5863, -5863, 4358, 4760, 4406, 4411, -5863, -5863, -5863, 2258, -5863, 802, 4762, 4420, -5863, 4429, 93342, -5863, -5863, 4051, 1043, 35323, 63820, 20763, -5863, -5863, 4755, -5863, 281, 277, 1498, 4600, 4378, 35323, 2320, 2591, 2595, 4433, -5863, -5863, -5863, 3629, 39012, 39012, 39012, 4379, 4744, 4750, 93342, -5863, 93342, 4589, -5863, -5863, 93342, 1091, 4383, 40066, 63820, 2599, -5863,119754, -5863, 2601, 2603, -5863, 35323, 4390, 35323, -5863, 38485, 93342, 4393, 3472, 2383, -5863, 3417, 45773, -5863, 4523, -5863, 4664, -5863, -5863, 35323, 4485, 4490, -5863, 4753, -5863, -5863, 93342, -5863, 93342, 4329, 55137, 3714, 1801, 2251, 4329, 4329, 4337, 15977, 35323, -5863, 4497, -5863, -5863, 2605, 1919, 4581, 4581, 2607, 2617, 16352, 93342, 2619, 2631, -5863, 2633, 2756, 3559, 2038, 3559, -5863, 3558, -5863, -5863, 63820, -5863, -5863, 67892, -5863, -5863, -5863, 1576, -5863, 1576, 4643, 57722, 58231, 1576, 1576, -5863, -5863, -5863, -5863, 4728, -5863, 2979, -5863, 16505, 4505, -5863, -5863, -5863, 562, -5863, 4636, 4638, -5863, 4419, -5863, 2635, -5863, 1063, 4552, 4051, -5863, -5863, 93342, 4914, 4918, -5863, 1661, 93342, 3713, -5863, 4238, 3620, 3572, 1063, 4246, 3222, 46288, 4286, 2542, 4271, -5863, -5863, 4646, -5863, 4647, -5863, 4430, 4758, -5863, 1765, 1004, -5863, -5863, -5863, 1572, 4782, 4783, -5863, -5863, -5863, 3345, -5863, 146, 4431, 4807, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 4472, 349, 358, -5863, 4473, -5863, 4616, 4619, 1387, 2491, -5863, 20763, -5863, -5863, -5863, 40593, 4587, 968, 18064, 4822, -5863, 4822, 4822, -5863, 4921, 4922, 1447, -5863, 4892, 2641, 42168, -5863, -5863, -5863, 93342, 4662, 1481, 4944, 4615, 2643, 38485, 2649, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 49893, 4927, 20763, 538, 1476, 67383, 3562, 2666, 3808, 4452, -5863, 3714, 4533, -5863, -5863, -5863, -5863, 20763, 93342, 71964, 4935, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 3562, 4549, -5863, -5863, 74509, -5863, 93342, -5863, -5863, 2682, -5863, -5863, -5863, 58740, -5863, 4206, -5863, 4206, -5863, -5863, -5863, 2931, 4582, 93342, 1187, 1187, 4876, -5863, 4537, -5863, 4467, -5863, 4997, 4607, 93342, -5863, -5863, 247, 2383, 75527, 4051, -5863, -5863, 2542, 4246, 3572, 35323, 2683, -5863, 4593, 209, -5863, 4271, 4286, -5863, -5863, 45773, 4482, 3294, 4870, -5863, -5863, -5863, 2577, 71964, 71964, 93342, -5863, -5863, -5863, 35323, 267, -5863, 4522, -5863, 4524, -5863, -5863, 4705, 4706, 4486, 1387, -5863, 4980, -5863, -5863, -5863, -5863, -5863, 1111, -5863, -5863, -5863, 93342, 93342, 93342, 4488, -5863, 3846, -5863, -5863, 41120, 41120, 4723, -5863, 41120, 1481, -5863, 93342, -5863, 4491, -5863, -5863, 2687, -5863, 704, 1967, -5863, 4730, 4625, -5863, -5863, 4735, 215, -5863, 523, -5863, -5863, -5863, -5863, -5863, 4570, 1742, 1742, 3562, -5863, 93342, -5863, 4496, -5863, -5863, -5863, 67892, -5863, 4206, -5863, -5863, -5863, -5863, 5007, -5863, 1002, -5863, -5863, -5863, -5863, 93342, 4051, 4147, 4238, -5863, 4271, 3572, 2542, 16886, -5863, 46288, 93342, 93342, 4286, -5863, 2688, 45773, 3554, 4648, -5863, 2341, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 1010, 4498, 4501, -5863, -5863, 16907, 71964, -5863, -5863, 4650, 4652, -5863, 4726, 39539, 4651, -5863, 4721, -5863, 1592, 1725, 2013,116756, 4961, 1091, 1091, -5863, 1091, -5863, -5863, 35323, -5863, -5863, -5863, -5863, -5863, 49893, -5863, 4568, 1939, 4509, 93342, -5863, -5863, 1742, -5863, -5863, -5863, 35323, -5863, -5863, 2251, 2251, 4051, -5863, -5863, 4286, 2542, 4271, 4593, -5863, -5863, -5863, -5863, 4758, -5863, 2695, 4286, 4420, 2624, -5863, -5863, 2637, 2678, 4601, 4873, -5863, 4521, 4627, 4629, 4904, -5863, -5863, -5863, 93342, 93342, 65347, 93342, 381, 2696, -5863,120249, 93342, 17244, 4525, -5863, 4583, 35323, 2701, 1742, 2702, -5863, -5863, -5863, -5863, 4271, 4286, 93342, 3294, -5863, 45773, 3417, 4900, -5863, 2341, 4644, 4645, 63311, -5863, -5863, -5863, -5863, -5863, 5051, 348, 4941, -5863, -5863, 1576, 1387,116756, 4747, 185, 2707, -5863, 4586, 2709, 122, -5863, 4286, -5863, -5863, 3554, -5863, -5863, 267, -5863, 4574, 4576, -5863, 2715, -5863, -5863, -5863, -5863, 35323, 65347, 2446, 4531, -5863, -5863, 4736, 1576, 2613, 4736, -5863, -5863, -5863, 1939, -5863, -5863, 4286, 71964, 4890, 4891, -5863, 63311, 1207, 4599, 93342, 4539, -5863, 1387, -5863, 1498, 2613, 4597, 3417, 4541, 71964, 71964, -5863, 4542, 93342, 4995,116756, -5863, 1387, 1498, 4586, -5863, 63311, -5863, -5863, 1576, -5863, 4544, 2731, -5863, 1387, -5863, 2733,116756, -5863, -5863, -5863, 2739, -5863 }; /* 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[] = { 1725, 1464, 670, 1553, 1552, 1464, 0, 275, 0, 1564, 0, 1464, 443, 1121, 0, 0, 0, 0, 670, 1464, 0, 1725, 0, 0, 0, 0, 0, 1738, 0, 0, 0, 0, 0, 0, 1261, 0, 0, 0, 1464, 0, 0, 1745, 0, 0, 0, 0, 1738, 0, 1566, 0, 0, 0, 0, 1745, 0, 0, 0, 0, 0, 2, 9, 10, 45, 80, 81, 38, 37, 98, 63, 24, 71, 133, 132, 134, 50, 46, 88, 33, 35, 47, 51, 73, 75, 40, 53, 64, 110, 72, 31, 70, 76, 96, 58, 19, 20, 59, 21, 60, 22, 61, 106, 82, 99, 43, 69, 30, 52, 78, 79, 12, 54, 86, 18, 65, 66, 68, 91, 92, 93, 116, 94, 128, 49, 125, 103, 104, 122, 105, 123, 16, 107, 62, 23, 119, 118, 120, 89, 55, 90, 77, 97, 117, 34, 121, 25, 26, 28, 29, 27, 67, 36, 74, 39, 95, 124, 114, 109, 129, 127, 11, 135, 111, 83, 14, 15, 100, 13, 32, 57, 17, 42, 41, 56, 48, 131, 44, 1564, 102, 115, 101, 84, 108, 87, 112, 130, 113, 85, 126, 1689, 1688, 1749, 1692, 1724, 0, 1704, 1463, 1462, 1477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1474, 2453, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2486, 2485, 2487, 2488, 2860, 2489, 2490, 2491, 2797, 2798, 2861, 2799, 2800, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2801, 2802, 2501, 2502, 2503, 2504, 2505, 2803, 2862, 2506, 2507, 2508, 2509, 2510, 2511, 2863, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2864, 2522, 2523, 2524, 2865, 2525, 2526, 2527, 2528, 2529, 2530, 2804, 2805, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2806, 2561, 2562, 2563, 2564, 2807, 2565, 2566, 2567, 2568, 2808, 2569, 2570, 2571, 2572, 2866, 2867, 2573, 2574, 2575, 2576, 2577, 2809, 2810, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2868, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2869, 2811, 2598, 2599, 2600, 2601, 2812, 2813, 2814, 2602, 2870, 2871, 2603, 2872, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2826, 2873, 2612, 2874, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2827, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2828, 2875, 2829, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2830, 2831, 2642, 2643, 2644, 2876, 2645, 2832, 2646, 2833, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2834, 2877, 2658, 2878, 2835, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2836, 2673, 2837, 2676, 2674, 2675, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 2687, 2838, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2879, 2707, 2708, 2709, 2710, 2711, 2839, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2840, 2729, 2730, 2880, 2731, 2732, 2841, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2842, 2749, 2750, 2751, 2752, 2881, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2843, 2844, 2760, 2761, 2845, 2762, 2846, 2763, 2764, 2765, 2766, 2767, 2768, 2770, 2769, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2847, 2848, 2782, 2882, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2794, 2795, 2796, 146, 0, 0, 2420, 2454, 2455, 2458, 2453, 413, 412, 1678, 2417, 2454, 1563, 0, 1542, 670, 0, 1477, 442, 1725, 0, 0, 0, 0, 0, 0, 887, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 140, 0, 0, 467, 466, 0, 0, 1093, 472, 0, 0, 0, 0, 0, 660, 1605, 2674, 1603, 1679, 276, 279, 280, 277, 278, 2436, 0, 1233, 1234, 1236, 0, 0, 1246, 927, 928, 0, 0, 0, 941, 0, 0, 0, 925, 0, 0, 0, 947, 0, 944, 0, 0, 948, 945, 922, 946, 929, 0, 921, 0, 0, 1246, 949, 0, 0, 923, 0, 0, 0, 0, 1477, 1602, 473, 1725, 0, 1586, 1587, 1588, 1564, 1576, 1589, 1581, 1583, 1582, 1584, 1585, 1580, 2435, 2472, 1017, 1017, 1017, 1017, 1014, 1015, 1017, 1017, 1017, 2695, 0, 0, 996, 0, 998, 2437, 1017, 1022, 2480, 552, 552, 552, 0, 1021, 1026, 552, 0, 1445, 1486, 2419, 1737, 0, 997, 1444, 2499, 248, 2701, 2707, 2716, 2726, 2727, 2730, 2843, 2760, 2793, 213, 202, 0, 225, 2760, 1592, 0, 0, 0, 0, 2714, 1454, 258, 2726, 2843, 2760, 257, 251, 253, 0, 0, 1021, 552, 0, 1477, 1452, 993, 1744, 1742, 0, 2404, 2516, 2615, 2726, 2727, 2760, 203, 208, 269, 2726, 2843, 2760, 265, 1474, 0, 1705, 1855, 1854, 2413, 0, 1447, 1446, 1565, 0, 1568, 0, 2690, 1709, 1712, 1570, 1710, 2456, 1948, 1977, 1955, 1977, 1977, 1944, 1944, 2546, 1957, 1945, 1946, 1982, 2002, 0, 1977, 1944, 1949, 0, 1947, 1985, 1985, 1972, 3, 1927, 1928, 1929, 1930, 1958, 1959, 1931, 1964, 1965, 1969, 1932, 1999, 1935, 1944, 2457, 1746, 1747, 2404, 4, 2450, 5, 2331, 2449, 6, 7, 1701, 0, 0, 1, 1725, 0, 1575, 1741, 1741, 0, 1741, 0, 1693, 1701, 1696, 1700, 0, 0, 0, 0, 0, 0, 1448, 0, 0, 0, 952, 0, 1489, 1078, 0, 0, 0, 0, 0, 1330, 0, 1130, 1129, 2459, 2442, 2443, 2444, 0, 2440, 2441, 2460, 2461, 2462, 0, 2584, 1330, 0, 0, 2247, 2258, 2259, 2260, 2503, 2565, 2255, 2256, 2257, 2249, 2250, 2251, 2252, 2253, 2254, 0, 0, 1228, 2248, 0, 2584, 0, 1330, 0, 173, 0, 150, 1330, 0, 0, 2584, 0, 0, 2584, 0, 0, 0, 0, 0, 2584, 0, 0, 0, 0, 0, 173, 2620, 0, 150, 2584, 0, 0, 1468, 0, 0, 0, 1470, 1473, 1460, 0, 2328, 0, 2329, 2421, 1557, 0, 1556, 1550, 1560, 1555, 1545, 0, 2413, 0, 0, 0, 0, 935, 0, 0, 925, 0, 0, 0, 936, 0, 937, 938, 0, 0, 0, 0, 934, 0, 1458, 1450, 0, 1594, 1596, 1595, 1597, 1593, 552, 0, 0, 0, 2584, 0, 150, 1528, 0, 2584, 150, 0, 0, 471, 470, 150, 2440, 469, 468, 2503, 2565, 0, 1120, 0, 1203, 150, 2584, 0, 194, 2584, 729, 2584, 1570, 139, 0, 673, 0, 841, 2620, 150, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 659, 670, 1606, 1604, 0, 1237, 250, 249, 1235, 939, 2584, 1162, 145, 0, 0, 2584, 1509, 2584, 145, 956, 940, 0, 926, 2584, 145, 1126, 2584, 2445, 183, 0, 924, 2503, 2565, 2584, 145, 1230, 0, 2584, 145, 2584, 179, 2584, 145, 2584, 145, 2584, 674, 0, 0, 2584, 145, 2584, 2620, 181, 943, 2584, 145, 950, 2584, 145, 2415, 2584, 0, 1461, 0, 1598, 0, 1578, 2847, 0, 1725, 1017, 1016, 0, 1017, 0, 1017, 0, 1017, 0, 1017, 0, 0, 0, 1017, 2438, 2439, 999, 0, 1023, 0, 1031, 0, 1030, 1029, 1028, 0, 0, 0, 1032, 0, 1859, 1633, 0, 1442, 216, 247, 218, 246, 252, 219, 217, 0, 2494, 201, 0, 264, 263, 0, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 142, 0, 1259, 1256, 142, 1258, 1257, 142, 142, 1453, 256, 254, 0, 0, 0, 0, 0, 1459, 0, 1451, 0, 0, 0, 2423, 2425, 2426, 2261, 2331, 0, 2798, 2799, 2800, 2320, 0, 2801, 2802, 2803, 2862, 2135, 2121, 2130, 2136, 2122, 2124, 2131, 2804, 2805, 2070, 2806, 2807, 2433, 2808, 2809, 2810, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2825, 2826, 2126, 2128, 2827, 2828, 2829, 2831, 0, 2434, 2832, 2833, 2653, 2835, 2836, 2838, 2839, 2132, 2841, 2842, 2133, 2843, 2844, 2845, 2846, 2432, 515, 2134, 2848, 2850, 2851, 2852, 2853, 2855, 2856, 2857, 2858, 0, 0, 0, 2410, 0, 2099, 0, 1936, 1937, 1960, 1961, 1938, 1966, 1967, 1939, 0, 1940, 2409, 2003, 2206, 2098, 2116, 0, 2104, 2105, 0, 2097, 2093, 2208, 1727, 2405, 0, 2094, 2422, 2424, 2321, 1727, 2403, 271, 0, 272, 2411, 2726, 204, 2501, 205, 0, 206, 268, 266, 0, 1449, 0, 1857, 1856, 2414, 961, 0, 1567, 1564, 2271, 0, 1711, 0, 0, 0, 1976, 1963, 1971, 1970, 0, 1953, 1952, 1951, 0, 1950, 1977, 1977, 1975, 1954, 1927, 0, 0, 0, 1981, 0, 1979, 1923, 1919, 0, 1988, 1989, 1990, 1987, 2000, 1986, 0, 1933, 1991, 0, 1944, 1941, 1812, 0, 1691, 1690, 8, 0, 1572, 1574, 1548, 1570, 1739, 1740, 0, 0, 0, 0, 0, 0, 0, 0, 1799, 1757, 1758, 1760, 1796, 1800, 1808, 0, 1697, 0, 0, 0, 1861, 0, 0, 1475, 0, 0, 0, 0, 0, 1161, 0, 0, 0, 0, 953, 0, 0, 0, 1495, 0, 1497, 1498, 1499, 0, 0, 0, 0, 1500, 1501, 1489, 260, 1508, 1505, 1488, 1490, 1503, 0, 0, 0, 0, 0, 0, 0, 1520, 0, 187, 188, 0, 686, 670, 0, 2584, 0, 0, 0, 0, 1171, 1178, 1329, 0, 0, 0, 0, 0, 0, 0, 0, 1172, 1170, 0, 1173, 262, 1183, 1210, 1213, 0, 0, 1128, 1131, 0, 0, 0, 0, 0, 1320, 0, 0, 0, 1320, 0, 0, 0, 1329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 289, 302, 368, 0, 651, 0, 0, 0, 654, 0, 2584, 1330, 0, 0, 0, 1232, 0, 0, 0, 0, 0, 0, 0, 0, 1213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 154, 0, 0, 0, 0, 1213, 0, 0, 0, 0, 0, 0, 0, 637, 650, 0, 0, 0, 0, 0, 647, 0, 0, 150, 292, 627, 633, 0, 0, 0, 736, 735, 0, 0, 0, 0, 0, 0, 1418, 0, 1417, 0, 0, 0, 0, 0, 1518, 1517, 0, 0, 0, 0, 0, 1320, 0, 281, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 405, 406, 0, 0, 0, 154, 0, 0, 1320, 0, 294, 0, 0, 1469, 1466, 1467, 0, 1472, 0, 0, 0, 0, 2107, 0, 2275, 1749, 2273, 1146, 2327, 0, 2463, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2324, 2323, 2418, 2464, 2465, 2466, 2467, 2330, 1540, 0, 236, 237, 235, 1558, 238, 1559, 1554, 0, 1541, 0, 0, 0, 0, 0, 0, 0, 0, 2503, 2565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 849, 1489, 1527, 0, 0, 0, 679, 0, 2584, 0, 152, 888, 0, 839, 472, 0, 0, 0, 0, 1394, 152, 0, 0, 190, 0, 0, 733, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 840, 0, 0, 152, 0, 2584, 630, 2584, 0, 552, 552, 0, 0, 141, 138, 0, 0, 0, 0, 0, 0, 0, 0, 1683, 1682, 1685, 1684, 0, 1681, 0, 143, 144, 0, 1220, 1245, 0, 0, 0, 0, 0, 917, 942, 0, 0, 1214, 0, 0, 2584, 145, 2584, 0, 2584, 0, 0, 0, 1222, 145, 0, 1216, 0, 0, 1218, 0, 1420, 0, 933, 931, 930, 932, 0, 0, 915, 0, 0, 0, 0, 0, 910, 0, 0, 912, 0, 0, 0, 0, 1725, 1577, 0, 1007, 0, 1011, 0, 1002, 0, 1008, 0, 1003, 1000, 1001, 0, 1006, 0, 0, 553, 555, 0, 0, 2528, 2545, 0, 2573, 2608, 2609, 2663, 2680, 2710, 2716, 2722, 0, 2753, 2765, 0, 1037, 1075, 1027, 745, 0, 0, 1643, 1443, 221, 220, 0, 240, 244, 245, 215, 243, 0, 239, 223, 2192, 2191, 222, 214, 211, 209, 227, 229, 230, 212, 210, 226, 2280, 0, 1725, 0, 0, 1260, 0, 0, 138, 255, 0, 0, 1075, 0, 2714, 1456, 992, 670, 0, 2095, 0, 2102, 2103, 2319, 0, 0, 0, 0, 0, 0, 2101, 0, 0, 0, 0, 2376, 0, 0, 2376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2026, 0, 0, 2279, 0, 0, 2279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2027, 2008, 2009, 2099, 2271, 0, 2100, 2429, 0, 1999, 2468, 2261, 0, 2258, 2259, 2260, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 0, 2978, 2979, 2980, 2981, 2982, 2984, 2983, 2985, 2986, 2987, 2988, 2989, 2990, 2334, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 2041, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 2043, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3255, 3253, 3254, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3314, 3313, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3371, 3370, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 0, 2255, 2256, 2257, 2249, 2250, 2251, 2252, 2253, 2254, 2265, 0, 0, 2408, 2469, 0, 2208, 0, 2023, 0, 2216, 0, 0, 1812, 0, 2427, 2322, 1812, 273, 274, 270, 0, 0, 0, 267, 0, 0, 0, 145, 1575, 1562, 0, 0, 2334, 0, 2269, 0, 0, 2267, 0, 0, 0, 1809, 0, 1713, 0, 1717, 0, 0, 0, 1974, 1973, 1924, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 954, 0, 1942, 0, 1877, 2451, 2452, 2332, 1745, 1575, 0, 1571, 1708, 1707, 1750, 1751, 1112, 1706, 1779, 1780, 0, 0, 0, 0, 1805, 1803, 1770, 1761, 1769, 0, 0, 1767, 0, 1771, 2003, 1798, 1695, 1755, 1756, 1759, 1694, 0, 1801, 0, 1646, 1799, 1760, 1630, 0, 1608, 0, 0, 1862, 0, 0, 1476, 0, 0, 0, 1141, 1143, 0, 1142, 0, 1145, 0, 1154, 0, 0, 1140, 1159, 0, 1148, 1146, 0, 1516, 0, 0, 0, 0, 0, 1496, 0, 0, 0, 0, 2753, 259, 1499, 1504, 1491, 1502, 0, 0, 0, 0, 0, 1077, 1076, 0, 0, 0, 1523, 546, 0, 370, 0, 0, 0, 0, 0, 0, 0, 0, 835, 832, 0, 0, 831, 0, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 709, 0, 1320, 0, 300, 0, 1180, 0, 1179, 0, 1184, 0, 0, 1181, 1176, 1177, 2716, 261, 1182, 1212, 0, 1211, 1207, 0, 1123, 0, 1124, 0, 0, 0, 0, 0, 0, 0, 2557, 0, 2584, 0, 515, 308, 332, 537, 0, 1319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, 0, 0, 357, 356, 0, 0, 0, 0, 0, 362, 0, 340, 0, 341, 0, 361, 0, 0, 0, 652, 653, 0, 0, 0, 1320, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 1229, 0, 762, 0, 0, 2716, 1208, 0, 1403, 0, 2752, 1404, 1407, 552, 0, 552, 1409, 0, 0, 1406, 1408, 0, 0, 176, 0, 171, 175, 0, 0, 2716, 1209, 0, 0, 0, 0, 0, 635, 636, 649, 0, 640, 641, 638, 642, 643, 0, 0, 0, 0, 0, 0, 0, 634, 0, 0, 731, 730, 734, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 1203, 0, 0, 1411, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1263, 1262, 0, 0, 0, 0, 1330, 0, 878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 749, 0, 748, 0, 172, 177, 0, 0, 0, 0, 0, 0, 0, 0, 234, 1465, 1471, 1749, 1749, 1749, 2113, 0, 0, 0, 0, 1748, 2325, 2328, 1545, 1551, 1544, 1543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 419, 416, 417, 419, 0, 0, 0, 0, 851, 0, 854, 857, 1487, 499, 0, 0, 676, 709, 0, 0, 475, 185, 0, 0, 0, 0, 764, 0, 1203, 1202, 147, 138, 194, 473, 0, 193, 195, 197, 198, 199, 196, 200, 0, 728, 732, 0, 0, 0, 0, 672, 0, 0, 0, 0, 0, 0, 0, 1882, 0, 0, 170, 0, 0, 625, 629, 0, 0, 0, 0, 475, 591, 381, 2584, 0, 552, 0, 2584, 0, 137, 0, 838, 0, 0, 0, 1165, 1165, 0, 0, 778, 777, 0, 0, 0, 0, 0, 0, 1680, 145, 1163, 0, 1510, 0, 145, 957, 145, 1127, 184, 2446, 0, 919, 0, 0, 0, 0, 145, 1231, 907, 145, 180, 145, 145, 675, 0, 145, 182, 0, 0, 145, 951, 145, 2416, 0, 145, 1601, 2584, 552, 1579, 1004, 1013, 1012, 1010, 1009, 1005, 0, 1024, 0, 551, 0, 0, 0, 0, 0, 1045, 1046, 0, 0, 1042, 1047, 0, 1049, 1033, 1035, 1043, 1044, 1050, 1039, 1038, 1051, 1052, 0, 0, 0, 1064, 743, 0, 0, 0, 0, 1640, 0, 1638, 0, 1860, 1642, 1631, 224, 0, 1999, 0, 1591, 0, 1590, 0, 618, 1254, 1253, 1255, 0, 1021, 0, 145, 0, 1455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2284, 0, 2285, 0, 0, 2318, 2314, 0, 0, 0, 0, 0, 2288, 2291, 2292, 2293, 2290, 2294, 2289, 0, 0, 2295, 0, 0, 2369, 2386, 0, 2099, 2369, 2397, 0, 2396, 2402, 0, 2275, 2003, 0, 0, 2393, 2387, 0, 2393, 0, 0, 2376, 0, 0, 0, 0, 2176, 0, 0, 0, 2275, 2278, 0, 0, 2839, 0, 0, 0, 0, 2071, 0, 0, 2242, 0, 2275, 0, 0, 0, 0, 0, 0, 0, 2271, 2310, 0, 513, 0, 2061, 0, 0, 0, 2190, 0, 2187, 0, 0, 0, 0, 2331, 0, 0, 2430, 2004, 2019, 2020, 2021, 2024, 2407, 2007, 0, 2333, 0, 0, 2005, 2032, 0, 2311, 2057, 0, 2062, 2047, 2377, 2296, 2297, 2298, 2299, 2064, 0, 2040, 2045, 2049, 0, 2386, 2028, 0, 2025, 0, 2334, 2270, 0, 2268, 0, 2016, 2017, 2018, 2010, 2011, 2012, 2013, 2014, 2015, 2022, 2246, 2244, 2245, 0, 0, 2216, 0, 0, 2044, 0, 0, 2115, 2576, 2615, 0, 1738, 1738, 1738, 1726, 1736, 2406, 1877, 1749, 1877, 2412, 0, 1858, 959, 960, 958, 1547, 1561, 1575, 2272, 1569, 1715, 0, 0, 0, 1943, 1956, 0, 1983, 1984, 1985, 1985, 0, 1925, 0, 1968, 1993, 1994, 1995, 1996, 1997, 1998, 0, 1992, 1934, 955, 2815, 2824, 0, 2712, 2859, 0, 1838, 1811, 1813, 1823, 1838, 1845, 1838, 1838, 2117, 1875, 2118, 2119, 2413, 0, 1782, 2448, 1549, 1573, 0, 1110, 1111, 0, 1115, 2839, 2712, 0, 0, 0, 0, 1772, 1806, 0, 1797, 0, 2423, 1773, 2422, 1774, 1777, 1778, 1768, 1807, 1644, 0, 1802, 1699, 1698, 0, 1880, 0, 0, 0, 1622, 1610, 0, 0, 1863, 0, 1812, 1648, 0, 2331, 1810, 1370, 1264, 1331, 1144, 0, 1944, 1155, 0, 1139, 0, 1138, 1944, 0, 1156, 0, 1944, 1371, 1265, 1332, 1372, 1266, 1333, 1373, 1507, 1267, 1506, 1494, 1493, 1492, 0, 0, 0, 0, 0, 0, 0, 0, 816, 2584, 145, 1521, 1374, 0, 1268, 369, 1522, 1334, 1526, 834, 833, 0, 0, 1335, 0, 685, 690, 0, 692, 693, 2503, 2565, 694, 697, 698, 0, 700, 689, 688, 0, 0, 0, 0, 0, 706, 711, 0, 0, 0, 0, 0, 0, 1174, 1175, 1375, 1271, 0, 1336, 0, 1122, 0, 1272, 186, 0, 0, 288, 0, 2584, 310, 0, 0, 0, 0, 0, 0, 0, 0, 816, 497, 816, 0, 1322, 307, 338, 0, 353, 348, 349, 347, 2584, 145, 2584, 145, 0, 0, 0, 0, 0, 350, 345, 346, 342, 0, 0, 355, 2475, 2547, 2727, 0, 717, 719, 0, 724, 358, 1292, 377, 376, 375, 0, 363, 0, 382, 385, 0, 360, 339, 337, 334, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1224, 0, 1378, 1337, 0, 1359, 1363, 0, 0, 0, 756, 1381, 1278, 1340, 0, 552, 0, 0, 567, 567, 552, 1392, 1279, 174, 1309, 163, 0, 0, 159, 0, 0, 0, 0, 153, 1382, 1280, 1341, 0, 0, 1383, 1281, 0, 0, 293, 628, 639, 644, 1286, 648, 645, 1349, 646, 1390, 1282, 0, 1386, 1312, 1344, 395, 611, 394, 1203, 1203, 1393, 1413, 1283, 1203, 0, 1320, 0, 282, 284, 0, 142, 0, 1284, 0, 1342, 1385, 1311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 1322, 2584, 145, 876, 1384, 0, 1317, 0, 1357, 0, 0, 0, 407, 0, 1310, 1320, 0, 295, 1288, 0, 1351, 0, 0, 232, 231, 233, 0, 0, 0, 0, 2276, 2277, 0, 2274, 2108, 2327, 0, 1539, 981, 967, 980, 0, 963, 2545, 0, 966, 968, 0, 0, 0, 969, 973, 974, 0, 965, 962, 964, 0, 418, 0, 0, 773, 774, 0, 0, 0, 0, 853, 0, 0, 1519, 0, 150, 683, 0, 0, 0, 678, 708, 713, 0, 0, 0, 0, 474, 478, 482, 483, 484, 0, 0, 0, 0, 164, 151, 0, 896, 0, 552, 0, 766, 1203, 1396, 0, 194, 189, 0, 0, 729, 0, 1570, 0, 0, 606, 609, 608, 0, 381, 848, 846, 845, 847, 869, 844, 0, 1881, 1883, 0, 0, 0, 0, 0, 0, 618, 477, 0, 0, 555, 0, 594, 0, 0, 0, 0, 591, 0, 0, 0, 2456, 0, 865, 837, 0, 1133, 0, 1151, 1134, 0, 0, 0, 0, 1188, 1195, 1164, 1189, 1166, 1195, 0, 0, 779, 783, 782, 786, 784, 0, 780, 657, 1686, 1687, 0, 1221, 0, 0, 1515, 0, 1513, 918, 1215, 145, 0, 145, 0, 145, 1223, 1217, 1219, 1421, 0, 916, 0, 0, 909, 911, 0, 913, 0, 1025, 554, 0, 0, 0, 0, 0, 0, 1041, 655, 1048, 0, 0, 0, 1063, 1058, 1060, 0, 1075, 1069, 0, 742, 0, 0, 1641, 1634, 1636, 1635, 0, 0, 1632, 0, 241, 228, 2281, 908, 0, 624, 0, 1075, 1066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1743, 2282, 2283, 0, 0, 0, 2315, 0, 0, 2152, 0, 2123, 2125, 2138, 0, 2153, 2106, 0, 2368, 2365, 0, 0, 0, 2369, 2376, 2172, 0, 0, 0, 2376, 0, 2396, 0, 0, 0, 2167, 2169, 0, 0, 0, 2386, 2386, 0, 2174, 0, 0, 2154, 2127, 2129, 2139, 0, 0, 2262, 0, 2142, 2141, 0, 2073, 2074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2088, 2143, 2241, 0, 0, 0, 2145, 2144, 0, 0, 2309, 0, 0, 0, 2150, 514, 2155, 0, 0, 0, 0, 2161, 0, 2198, 0, 0, 0, 2096, 2272, 0, 0, 0, 0, 0, 0, 0, 2379, 2380, 2381, 2378, 0, 2063, 2048, 2066, 2042, 2046, 2050, 0, 2386, 2065, 2068, 0, 0, 2036, 0, 0, 2034, 2058, 2030, 0, 0, 2059, 0, 2114, 0, 0, 0, 2219, 2214, 2215, 1738, 1738, 1738, 1738, 1735, 0, 0, 0, 1782, 0, 1782, 207, 1546, 1716, 1725, 1962, 0, 1980, 1978, 1921, 1926, 2001, 0, 1838, 1845, 1838, 1838, 0, 0, 1701, 0, 1823, 0, 1837, 1821, 1836, 0, 0, 1851, 1849, 0, 1851, 0, 1851, 0, 1815, 0, 1841, 1817, 1836, 1819, 1825, 0, 1867, 2414, 1876, 0, 1795, 1752, 0, 2263, 1115, 0, 1754, 1776, 1775, 0, 1765, 0, 1804, 1762, 1645, 1629, 0, 1627, 1614, 1616, 1615, 0, 0, 1617, 2331, 0, 1627, 1609, 0, 1653, 0, 0, 1880, 0, 1652, 0, 1944, 1136, 1137, 0, 1160, 0, 1080, 1081, 0, 1079, 0, 0, 0, 545, 548, 0, 1524, 0, 1391, 1308, 687, 0, 0, 0, 0, 702, 661, 703, 705, 0, 0, 704, 707, 710, 1320, 0, 301, 1294, 0, 1355, 1168, 0, 0, 1125, 0, 0, 0, 0, 0, 1096, 536, 1095, 0, 0, 0, 0, 816, 0, 0, 540, 0, 496, 493, 333, 0, 0, 0, 0, 390, 0, 312, 325, 388, 331, 0, 365, 0, 336, 0, 329, 351, 343, 352, 344, 364, 366, 0, 721, 722, 720, 716, 0, 723, 725, 0, 379, 0, 0, 0, 397, 359, 396, 0, 1377, 0, 1320, 0, 297, 1290, 0, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 761, 0, 758, 0, 567, 0, 1405, 0, 1402, 1400, 567, 0, 0, 156, 155, 0, 162, 0, 0, 0, 0, 0, 0, 1414, 1415, 1416, 0, 0, 0, 0, 0, 0, 401, 0, 304, 306, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 372, 0, 872, 0, 0, 0, 410, 0, 0, 1369, 0, 0, 0, 0, 0, 1376, 1273, 2111, 2112, 2109, 1749, 2326, 0, 0, 0, 978, 0, 0, 0, 0, 421, 422, 150, 420, 445, 0, 816, 0, 0, 850, 855, 863, 2653, 2249, 2250, 861, 856, 858, 860, 862, 859, 0, 0, 0, 0, 518, 0, 0, 0, 505, 0, 0, 515, 498, 501, 502, 0, 0, 679, 682, 680, 681, 0, 701, 0, 477, 525, 581, 0, 166, 0, 0, 167, 165, 0, 0, 381, 763, 0, 760, 1395, 0, 192, 0, 733, 0, 0, 0, 0, 0, 1203, 671, 0, 868, 870, 842, 0, 713, 0, 0, 630, 0, 552, 1602, 613, 0, 583, 477, 581, 590, 0, 0, 598, 380, 0, 0, 618, 381, 0, 0, 1096, 0, 864, 0, 0, 1132, 0, 0, 0, 1185, 1190, 1186, 0, 1165, 1147, 0, 1187, 0, 0, 1193, 1118, 1167, 1119, 1437, 1438, 1435, 1436, 0, 0, 0, 0, 0, 0, 1677, 0, 0, 1511, 0, 920, 0, 903, 0, 905, 145, 750, 0, 145, 0, 0, 0, 0, 0, 0, 1040, 0, 1034, 1036, 1061, 0, 0, 1075, 1074, 0, 1065, 1073, 1071, 1072, 1070, 0, 0, 1639, 1637, 0, 616, 0, 0, 145, 1075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2286, 0, 2317, 2313, 0, 2120, 2287, 2367, 2383, 2385, 2173, 2375, 0, 0, 0, 2398, 0, 0, 2376, 2336, 2390, 2389, 0, 0, 2388, 2376, 2376, 2336, 2175, 2336, 0, 0, 0, 2242, 0, 0, 2072, 2084, 2085, 2086, 2302, 0, 2091, 0, 2081, 2082, 2083, 2075, 2076, 2077, 2078, 2079, 2080, 2087, 2306, 2305, 0, 0, 2147, 2148, 2149, 2308, 2156, 0, 2493, 2199, 0, 2160, 2189, 2188, 0, 0, 0, 2163, 0, 0, 2185, 0, 2243, 2431, 2006, 0, 0, 2033, 2312, 2051, 0, 2067, 2069, 2029, 2262, 0, 0, 0, 0, 0, 2038, 0, 0, 2239, 0, 0, 0, 2221, 2218, 0, 0, 0, 0, 1729, 1728, 1734, 1795, 2108, 1795, 0, 1922, 0, 1822, 1818, 1820, 1826, 0, 2854, 0, 1827, 1834, 0, 1814, 0, 1850, 1846, 0, 1847, 0, 0, 1848, 0, 0, 1816, 0, 1834, 0, 1874, 1741, 0, 2210, 0, 1753, 1113, 1114, 1763, 0, 1766, 2524, 1878, 0, 1628, 0, 0, 0, 1619, 1625, 1607, 0, 0, 0, 1649, 1627, 1650, 1157, 0, 0, 1149, 1086, 1087, 1090, 1088, 1085, 1089, 0, 0, 0, 816, 819, 0, 0, 0, 817, 145, 1269, 0, 0, 0, 0, 662, 1389, 1270, 0, 0, 0, 0, 1169, 1323, 0, 0, 1293, 816, 0, 0, 0, 562, 0, 1109, 1109, 0, 309, 0, 542, 603, 0, 495, 494, 0, 492, 713, 0, 0, 316, 326, 0, 321, 0, 1321, 0, 0, 0, 0, 320, 323, 322, 392, 0, 389, 0, 145, 145, 367, 718, 378, 383, 384, 387, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 897, 880, 0, 0, 898, 899, 0, 0, 0, 1226, 1227, 1225, 1360, 1361, 1367, 1364, 1362, 1366, 1368, 1365, 0, 1276, 0, 0, 754, 1324, 1397, 1399, 1398, 0, 1401, 160, 157, 158, 161, 1325, 1306, 1287, 1350, 612, 0, 0, 0, 1285, 0, 1343, 0, 1302, 1296, 0, 0, 0, 0, 0, 1388, 1316, 1348, 1387, 1314, 1346, 1313, 1345, 1315, 1347, 1307, 0, 0, 1885, 877, 0, 0, 0, 145, 145, 875, 752, 1289, 0, 1352, 1298, 0, 0, 0, 970, 0, 0, 0, 972, 426, 446, 150, 0, 772, 836, 0, 0, 852, 0, 503, 0, 509, 516, 0, 0, 520, 521, 519, 504, 1203, 552, 1203, 805, 806, 0, 0, 826, 0, 677, 0, 0, 475, 0, 522, 0, 0, 479, 169, 168, 0, 0, 0, 767, 771, 769, 768, 770, 765, 0, 756, 194, 2584, 0, 0, 0, 0, 610, 604, 607, 1410, 843, 0, 1884, 746, 0, 381, 626, 0, 0, 0, 475, 618, 0, 480, 485, 486, 499, 0, 591, 582, 0, 583, 592, 593, 0, 600, 1485, 0, 619, 600, 0, 0, 0, 867, 0, 866, 0, 1135, 1152, 1153, 0, 0, 1195, 0, 0, 1197, 1192, 0, 0, 785, 788, 781, 664, 145, 0, 1514, 145, 145, 1252, 0, 914, 1055, 1056, 1057, 1054, 1053, 656, 0, 1059, 1018, 1068, 744, 0, 242, 617, 0, 1019, 145, 995, 987, 994, 983, 986, 988, 0, 990, 991, 985, 982, 984, 2316, 2137, 0, 2382, 2384, 2171, 2395, 2394, 2170, 2401, 0, 0, 2364, 2392, 2391, 0, 0, 2376, 2376, 2140, 2151, 0, 2241, 2272, 0, 0, 2092, 0, 0, 0, 2146, 2849, 0, 0, 2203, 2204, 0, 2200, 2201, 2196, 2197, 2162, 0, 2641, 2180, 0, 0, 2195, 2055, 2053, 2052, 2037, 0, 0, 2035, 2031, 0, 2060, 2205, 2238, 2272, 2207, 0, 1749, 1733, 1732, 1731, 1730, 2210, 2428, 2210, 1720, 0, 1870, 0, 1873, 0, 0, 1824, 0, 0, 1828, 0, 0, 1830, 1832, 0, 0, 0, 0, 0, 0, 2417, 0, 1794, 0, 1749, 0, 1764, 0, 1626, 1611, 0, 1612, 1618, 0, 0, 0, 0, 0, 1654, 1647, 1150, 1158, 0, 0, 0, 547, 821, 820, 823, 818, 822, 1525, 0, 695, 696, 699, 1295, 0, 1356, 1304, 0, 1643, 538, 311, 0, 557, 0, 0, 0, 1102, 140, 1101, 0, 557, 557, 491, 490, 499, 319, 0, 0, 0, 313, 391, 0, 393, 314, 318, 372, 335, 328, 0, 0, 0, 1291, 0, 1354, 1300, 1327, 1379, 1274, 1338, 0, 0, 886, 0, 0, 0, 0, 1380, 1275, 1339, 0, 0, 0, 0, 0, 1643, 0, 0, 0, 0, 0, 0, 0, 0, 1534, 0, 0, 371, 874, 873, 372, 409, 1318, 0, 2110, 0, 971, 976, 977, 975, 0, 415, 423, 426, 0, 0, 1243, 1243, 0, 0, 500, 517, 0, 602, 561, 602, 0, 0, 0, 0, 0, 714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 759, 758, 191, 0, 475, 0, 713, 0, 871, 0, 0, 0, 618, 477, 0, 0, 1599, 476, 0, 0, 488, 0, 594, 583, 591, 0, 0, 615, 0, 1478, 0, 621, 0, 0, 0, 815, 1191, 0, 1205, 0, 1146, 1116, 1200, 0, 1725, 1877, 0, 0, 0, 0, 798, 0, 668, 1244, 1512, 904, 906, 751, 1062, 0, 1075, 1067, 989, 2366, 2400, 2335, 2337, 0, 0, 2358, 2351, 2354, 2352, 2353, 2355, 0, 2350, 0, 2168, 2399, 2348, 2362, 2301, 2243, 2089, 0, 2304, 2303, 2307, 0, 2157, 0, 2158, 2202, 2164, 2181, 0, 2165, 2193, 0, 0, 2056, 2054, 2039, 2240, 0, 2225, 1703, 1702, 0, 1723, 1906, 1875, 0, 0, 1869, 0, 0, 1900, 0, 0, 0, 1835, 1853, 0, 1831, 1829, 0, 1842, 0, 1844, 2523, 2810, 2709, 0, 1781, 1783, 1786, 1788, 1787, 1789, 1785, 2209, 2211, 0, 1760, 2264, 1879, 0, 0, 0, 1097, 0, 0, 1627, 1656, 1668, 1668, 1651, 1063, 0, 145, 691, 0, 0, 290, 1109, 0, 1203, 563, 2653, 564, 1108, 1112, 139, 0, 1203, 1203, 487, 0, 317, 327, 0, 374, 386, 0, 1643, 0, 0, 884, 893, 893, 881, 0, 0, 900, 1277, 755, 0, 566, 0, 285, 1303, 1297, 0, 0, 0, 1536, 1537, 0, 0, 0, 0, 0, 1326, 145, 1299, 979, 0, 448, 456, 427, 431, 1528, 0, 1528, 0, 428, 432, 1528, 1528, 425, 1877, 444, 1243, 0, 1240, 1239, 550, 632, 0, 0, 507, 0, 572, 506, 0, 827, 0, 0, 712, 0, 477, 581, 0, 535, 526, 527, 528, 529, 531, 530, 532, 533, 534, 524, 523, 0, 713, 890, 381, 1485, 753, 0, 0, 726, 0, 713, 0, 1602, 614, 583, 477, 581, 481, 499, 0, 598, 591, 594, 0, 595, 0, 599, 0, 0, 0, 618, 1538, 1096, 0, 0, 816, 1204, 1165, 0, 0, 1194, 1198, 1199, 0, 0, 0, 0, 1247, 792, 793, 787, 789, 0, 800, 804, 663, 0, 0, 667, 658, 713, 145, 0, 0, 2349, 2356, 2357, 0, 2178, 0, 0, 2374, 0, 0, 0, 2090, 0, 0, 2183, 2182, 2194, 2166, 2220, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 2336, 1868, 1871, 0, 1903, 0, 0, 0, 0, 1888, 0, 1833, 0, 0, 1843, 0, 0, 0, 1790, 0, 0, 0, 1799, 0, 1624, 1877, 0, 1621, 0, 1663, 0, 1655, 1657, 0, 0, 0, 1082, 0, 1083, 1305, 0, 1103, 0, 602, 0, 1115, 1112, 552, 602, 602, 632, 0, 0, 330, 0, 298, 1301, 0, 0, 895, 895, 0, 0, 0, 0, 0, 0, 403, 0, 0, 1530, 0, 1531, 1532, 1535, 411, 424, 0, 454, 453, 0, 451, 450, 452, 0, 441, 0, 0, 0, 0, 0, 0, 414, 1238, 1242, 1241, 0, 508, 0, 510, 0, 0, 558, 559, 560, 0, 512, 568, 569, 824, 0, 829, 0, 715, 0, 0, 713, 580, 737, 0, 0, 0, 1479, 0, 0, 605, 747, 1485, 618, 591, 0, 583, 489, 0, 600, 594, 598, 596, 597, 0, 1482, 0, 620, 0, 1105, 814, 0, 1195, 1206, 1201, 1196, 1441, 0, 0, 790, 795, 794, 1528, 799, 0, 0, 0, 666, 665, 741, 1020, 2338, 2339, 2363, 0, 0, 0, 2342, 0, 2340, 0, 0, 2362, 0, 2179, 2300, 2186, 2159, 2184, 2797, 2524, 2768, 0, 2237, 2226, 2237, 2237, 2217, 0, 0, 0, 1905, 0, 0, 0, 1901, 1902, 1886, 0, 0, 1890, 1840, 1866, 0, 0, 0, 1784, 2212, 2213, 2447, 1613, 1623, 1098, 0, 1665, 1667, 0, 0, 0, 1643, 0, 567, 0, 1099, 1115, 561, 816, 816, 324, 315, 373, 0, 0, 0, 891, 894, 882, 883, 902, 901, 757, 1643, 0, 399, 398, 0, 402, 0, 449, 459, 0, 457, 429, 434, 0, 440, 439, 436, 435, 430, 433, 549, 0, 0, 0, 0, 0, 0, 570, 0, 571, 0, 828, 0, 0, 0, 739, 889, 0, 0, 475, 713, 1480, 1600, 594, 583, 591, 0, 0, 585, 1109, 1109, 462, 598, 600, 1483, 1484, 0, 0, 515, 0, 1117, 1440, 1439, 1725, 0, 0, 0, 801, 802, 797, 0, 0, 2343, 0, 2346, 0, 2347, 2341, 2371, 2373, 0, 2359, 2360, 0, 2230, 2229, 2228, 2232, 2231, 0, 2224, 2222, 2223, 0, 0, 0, 0, 1872, 0, 1889, 1892, 0, 0, 0, 1898, 0, 1891, 1893, 0, 1852, 0, 1864, 1792, 0, 1791, 1877, 0, 1670, 0, 0, 1658, 1659, 0, 0, 1660, 145, 291, 556, 816, 565, 1100, 572, 541, 539, 1643, 885, 0, 286, 0, 404, 1533, 455, 0, 438, 437, 631, 511, 601, 577, 0, 576, 0, 574, 573, 825, 830, 0, 713, 879, 1485, 727, 598, 591, 594, 0, 584, 0, 140, 140, 600, 460, 0, 0, 381, 0, 1423, 1725, 1422, 1424, 1432, 1429, 1431, 1430, 1428, 0, 1250, 1251, 791, 796, 0, 0, 2344, 2345, 0, 0, 2177, 0, 0, 0, 2234, 0, 2235, 0, 0, 0, 0, 0, 1895, 1896, 1897, 1899, 1894, 1839, 0, 1793, 1620, 1664, 1666, 1661, 0, 1662, 0, 0, 0, 0, 1671, 1084, 543, 816, 299, 892, 0, 458, 575, 552, 552, 713, 738, 1481, 600, 594, 598, 1109, 586, 588, 587, 464, 1105, 1106, 0, 600, 804, 0, 1433, 1427, 1701, 1688, 0, 0, 803, 0, 0, 0, 0, 2227, 2233, 2236, 0, 0, 0, 0, 2634, 0, 1907, 0, 0, 0, 1669, 1675, 0, 0, 0, 544, 0, 579, 578, 740, 463, 598, 600, 140, 515, 1104, 0, 1877, 0, 1425, 1725, 0, 0, 809, 2370, 2372, 2361, 1719, 1718, 2815, 0, 0, 1722, 1915, 0, 2364, 0, 0, 1918, 0, 1865, 0, 0, 0, 400, 600, 461, 589, 381, 1107, 1091, 0, 1426, 0, 0, 811, 0, 807, 810, 812, 813, 0, 0, 0, 0, 1908, 1909, 1918, 0, 2348, 1918, 1887, 1672, 1676, 0, 1673, 465, 600, 0, 0, 0, 775, 0, 1749, 0, 0, 0, 1904, 2364, 1917, 2374, 2348, 0, 1877, 0, 0, 0, 808, 0, 0, 0, 0, 1912, 2362, 2374, 0, 1092, 809, 1248, 1249, 0, 1721, 0, 0, 1910, 2362, 1674, 0, 0, 1913, 1911, 776, 0, 1914 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -5863, -5863, -5863, 4144, -430, -1744, -5158, -1151, 1760, -5863, -5863, -973, -1360, 3357, -1774, -5863, -5863, -5863, 1513, -5863, -5863, -5863, -5863, 4107, -5863, -2931, -5863, -5863, 194, -386, 75, 74, 3819, 1837, -5863, -1049, -5863, -5863, -613, 4, -5863, 162, 706, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -691, 2106, -5863, 2198, 1434, -4855, -5863, -5863, -1574, -3819, -5863, 682, -5863, 708, -4160, -5863, -4871, -981, -5863, -5863, -5863, 2089, -5863, -5863, -5863, 2036, 1223, -338, -5863, -5863, -5863, -5863, -5863, -5863, -801, -5863, -5863, -1111, 2, -654, -2982, -4383, -5863, -5863, 529, -379, -1513, -5863, 724, -5863, 725, -5863, -4892, -5863, 28, -2777, -4399, -5863, -5863, -5863, -351, -1537, 1466, -5863, 1529, -5863, -746, -1186, 1909, -2470, -942, -5863, -244, -3616, -1087, -816, -814, -976, -4400, -4908, -5863, -5863, -1116, -3793, -5260, -5492, -4926, -4815, 1474, -5863, -1, 530, -5863, 3, -3689, -3836, 8, 506, -5863, 10, 14, -5863, 522, -745, -974, -1628, -5863, -917, -5863, -5863, -5863, -3503, -5863, -5863, -5863, 189, -5863, -5863, -5863, -5863, 565, -5863, -5863, -5863, -5863, -5863, -5863, -3212, 2056, 2058, -5863, -4426, -5863, -943, -5863, 731, -3540, 1457, -5863, -5863, 1214, 4125, 549, -5863, -5863, -5863, -5863, -5863, -5863, -1815, -5863, -5863, -5863, -5863, 23, -327, -5863, -5863, -5863, -5863, -5863, -5863, -5863, 15, -5863, 1174, 488, -5863, -5863, -636, -5863, -5863, -5863, -5863, -5863, -5863, -1174, -5242, -1306, -1280, -5863, -3470, -5863, -5863, -5863, -300, -5863, -5863, -5863, -5863, -5863, -887, -5863, 1270, -4202, -5863, -5863, 525, -5863, -5863, -5863, -5863, -5863, -953, -241, 3274, -5863, -500, -724, -5863, -5863, -5863, -238, -5863, -5863, -5863, -5863, -5863, -533, -1283, 5145, 4504, -1130, 15981, -861, -572, -5863, -5863, -5863, -2898, -5863, -5863, -4296, -5863, 5137, 2630, 1192, 16, -5863, 48, 107, 3940, -5863, 1138, -1191, -3156, 481, -458, -5863, -5863, -5863, 485, -5863, -2001, -5863, -5863, -5863, -5863, -4157, 20, -5863, -4427, -5252, -4666, -4176, -1143, -5863, -4402, -5238, -4132, -5863, 2085, -5863, -5863, -561, -144, 3248, -5863, -1501, 2431, -1425, -5863, -2552, 548, 1622, 3258, -3304, -105, 3246, -3039, -5863, -676, 1210, -5863, -323, -3835, -5863, -5863, -5863, -2809, -582, -5863, -5863, 1662, -1101, -5863, -5863, -5863, -5863, -649, 3227, -172, -5863, -5863, 4475, -5863, -5049, -5863, 4440, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -1488, 1378, -5863, -841, -5863, -5863, 2189, 757, -5863, -5863, -5863, -5863, 1464, -434, -5863, -5863, -5863, -5863, -5863, -5863, -5863, -937, -1168, -5863, -5863, -5727, -5863, -5863, -5863, -5863, -5863, 2528, -958, -756, 4335, -226, 22, -5459, -5863, -5863, -447, -5863, 3660, -5863, -5863, -5863, -5863, -5863, 543, 544, -5863, -5863, -5863, -5863, -4547, -5863, -5863, -5112, -5863, -5863, 2166, -5863, -5863, 1340, 5, 3367, -5863, -5863, -5863, -5, -5863, -5863, -1021, 2516, -5863, -2407, -5863, -590, -5863, -5863, -1942, 25, -4404, -5863, 13, -5863, -5863, -5122, -1086, 334, -5863, -5863, -4129, 21, -5863, -5863, -5863, -5863, -5093, -5863, 38, -4929, 903, -3376, -5863, 11, -5863, -408, -5863, -5863, -409, -5863, -5863, -5863, -4014, 32, 46, -5863, -5863, 82, 3520, -45, 19, 35, 7, 190, 3778, -5863, -5863, -5863, -5711, 3815, -5863, 12, -874, 5174, 5177, -5863, -946, -147, 490, 1727, -695, -2632, 3723, 3731, -5863, 1714, 2531, -2466, -2465, -5863, -1039, -807, -612, -5863, -5863, -5863, -5863, -1546, -689, -2648, -5863, 3733, -5863, -5863, -5863, -2401, -3416, -3245, 1755, -3327, -3222, -5863, 989, 977, -972, -67, -36, -1503, -784, 1782, -5863, -5863, 1766, -335, -5863, -5863, -332, -3351, 939, -5863, -4622, -2845, 1768, -1097, -776, -5863, -924, -5863, -575, 1778, -5863, -5253, -1126, -5863, -3532, 5661, 3813, -837, -5863, -5863, -810, 10919, -5863, -5863, -5863, 11060, 11147, -5863, -5863, 12536, 12775, -5863, -587, 12919, 10422, -794, -1954, -197, 13749, 18571, -1899, 3740, 58, -5863, -2922, -2567, -5863, -5863, -5863, -296, 1088, 984, -5863, -5863, -4676, -4494, -5863, 2650, -1995, -5863, -584, 1840, -574, -5863, -5863, -5863, -2737, -5572, -2767, 2651, -5863, -5863, -5863, -185, -5863, 18425, -3288, -5863, -795, -1028, -1621, 3154, -3028, -1947, -5863, -5863, -5863, -3147, -5863, -5863, -5863, -638, 1870, -5863, -5863, 1999, -5863, -5863, -5863, -991, 2239, -763, -1208, 1876, -4522, -5863, -518, -5222, -5047, -5863, -5449, -5862, -1848, -1106, -3058, -3976, -1952, 1891, -3131, -5863, -1976, 1968, 1180, -5863, 1339, -5863, 4363, -806, 2660, -798, 17024, -679, 10536, -1296, -5863, 3311, -5838, 1101, 7394, 44, -111, 2212, -360, 2604, 3250, -5863, -5863, -6, 9566, -593, -873, -5863, 5211, 16552, 15166, -3721, -5863 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 58, 59, 60, 61, 1116, 1121, 1925, 1944, 62, 63, 1648, 3079, 2932, 3908, 3909, 64, 65, 1644, 66, 67, 68, 69, 1558, 70, 1897, 3093, 71, 2767, 823, 860, 825, 2057, 2058, 3024, 2059, 2047, 1250, 1843, 1580, 840, 1252, 1540, 1581, 73, 74, 1414, 2633, 75, 76, 77, 1611, 1704, 1612, 1613, 1552, 5048, 5878, 3694, 2887, 3956, 3695, 3696, 4384, 4385, 3774, 4413, 4475, 5892, 5893, 78, 1720, 1721, 79, 80, 3061, 3874, 4528, 5435, 5436, 5697, 670, 5071, 5072, 5684, 5685, 5907, 6080, 6081, 3094, 701, 3951, 4612, 3899, 5142, 3900, 5143, 3901, 5144, 4938, 4939, 4374, 4375, 3885, 4559, 4560, 2123, 5084, 4561, 3902, 5103, 5731, 3903, 2853, 2782, 2783, 5922, 3128, 2016, 2014, 5634, 5710, 4924, 4925, 4449, 5931, 5932, 5933, 6223, 5105, 5148, 5149, 6118, 6119, 3954, 4618, 5155, 5493, 5708, 3652, 82, 3927, 3928, 83, 764, 1919, 4058, 765, 3131, 702, 766, 3095, 88, 3121, 5924, 3122, 1674, 2946, 4541, 4031, 89, 1144, 4338, 5518, 5791, 5792, 755, 90, 1905, 91, 92, 3074, 3892, 93, 2800, 3600, 94, 95, 3619, 3620, 3621, 96, 4569, 5454, 1614, 3683, 3684, 3685, 3686, 4405, 97, 1900, 3102, 3103, 98, 99, 100, 3233, 3234, 101, 3010, 102, 103, 104, 105, 4443, 5005, 5119, 3725, 3915, 4585, 5117, 106, 3878, 3096, 3149, 3989, 3990, 5516, 5783, 5784, 5785, 5982, 6258, 5787, 5984, 6140, 5986, 5094, 6404, 6405, 5768, 4327, 4902, 108, 5095, 5096, 5937, 109, 2798, 110, 111, 1874, 3067, 3068, 4542, 3138, 3964, 3965, 4598, 4599, 112, 3814, 113, 4981, 4982, 703, 5945, 5884, 6066, 114, 115, 4985, 4986, 116, 117, 118, 119, 120, 756, 1078, 1079, 758, 1199, 1200, 3561, 1161, 121, 2641, 122, 3854, 123, 1293, 5209, 124, 790, 1215, 1216, 3097, 126, 800, 3256, 802, 3217, 3218, 2032, 4035, 4036, 4686, 127, 128, 4039, 4040, 4693, 3230, 129, 1545, 2777, 2778, 4894, 3098, 704, 3646, 5616, 5361, 5617, 6129, 6320, 5362, 3505, 4283, 131, 705, 1586, 2837, 1167, 1168, 3142, 3969, 2746, 2747, 1743, 4639, 2749, 3971, 2750, 1518, 2751, 1154, 1155, 3977, 3978, 3979, 3980, 4635, 4645, 4646, 5510, 5776, 4642, 1893, 5504, 5505, 132, 1583, 2834, 133, 134, 135, 1627, 1002, 1177, 1178, 136, 717, 718, 137, 5702, 138, 1157, 139, 5514, 140, 141, 1279, 1280, 832, 142, 143, 2857, 4387, 144, 1584, 145, 146, 3719, 3720, 4997, 147, 148, 149, 2918, 2919, 150, 151, 152, 153, 154, 6248, 6323, 6324, 6325, 4653, 6134, 155, 1247, 156, 157, 158, 159, 197, 1043, 1044, 1045, 955, 3099, 5495, 161, 162, 1541, 1542, 1543, 1544, 2772, 163, 164, 165, 3999, 4000, 166, 167, 168, 169, 1877, 170, 171, 5675, 172, 173, 1847, 174, 175, 1052, 1053, 1054, 1055, 1845, 3449, 664, 877, 1434, 1440, 1483, 1484, 1485, 177, 768, 178, 1270, 1083, 769, 1208, 180, 770, 2728, 3535, 4298, 4299, 4300, 4303, 5327, 4871, 771, 3531, 183, 2039, 3239, 3242, 3527, 772, 3541, 3542, 3543, 4307, 773, 5620, 5621, 5622, 5623, 5859, 6191, 6192, 6195, 6296, 774, 792, 1147, 3153, 775, 1380, 189, 190, 191, 935, 880, 881, 3454, 5576, 5823, 193, 2626, 3435, 809, 1489, 923, 924, 925, 944, 3034, 2694, 2695, 2719, 2720, 1498, 1499, 2707, 2711, 2712, 3518, 3511, 2700, 4277, 5601, 5602, 5603, 5604, 5605, 5606, 4860, 2715, 2716, 1501, 1502, 1503, 2724, 194, 2684, 3484, 3485, 3486, 4253, 4254, 6180, 4268, 4264, 4845, 5304, 3487, 869, 1245, 1510, 4853, 6182, 3488, 5293, 5294, 5581, 4273, 3497, 4294, 3939, 3940, 3941, 3489, 5833, 5834, 6177, 6178, 5583, 5584, 3490, 5825, 6343, 6344, 6382, 6417, 2752, 1463, 908, 1381, 909, 1476, 1382, 1450, 911, 1383, 1384, 1385, 914, 1386, 1387, 1388, 917, 1442, 1389, 1390, 1459, 1472, 1473, 1391, 1435, 5585, 1393, 1394, 1395, 3492, 1396, 4790, 5266, 5252, 3357, 3358, 2054, 5566, 4786, 4169, 4780, 2619, 2623, 5316, 5608, 5609, 3428, 4218, 4817, 5283, 5819, 6013, 6014, 6161, 1397, 1398, 1399, 3420, 2613, 1005, 1400, 4544, 2615, 3348, 3326, 1746, 3327, 2065, 2086, 3275, 3291, 3292, 3396, 3328, 3336, 3341, 3349, 3382, 1401, 3277, 3278, 4080, 2088, 1402, 1049, 1749, 1050, 1478, 3377, 5232, 5531, 5532, 5804, 5805, 5542, 5806, 5543, 5533, 4091, 4092, 6002, 3302, 3397, 4095, 3310, 3311, 4113, 4102, 3303, 1403, 4104, 1411, 1412, 1405, 2033, 870, 5300, 1203, 1830, 806, 1406, 1407, 1408, 1409, 1620, 976, 1170, 1171, 926, 928, 929, 2688, 660, 652, 978, 3687, 2616, 661, 654, 655, 1835, 2617 }; /* 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[] = { 651, 1504, 81, 84, 72, 176, 1842, 192, 85, 868, 86, 185, 934, 181, 87, 107, 125, 803, 1745, 805, 130, 182, 160, 811, 826, 179, 767, 1004, 192, 834, 826, 845, 186, 848, 2881, 1110, 826, 826, 184, 871, 1003, 874, 1959, 945, 1673, 2959, 1404, 2013, 930, 930, 930, 1236, 1237, 1238, 658, 2852, 1415, 1242, 872, 1836, 1475, 709, 1725, 968, 649, 1455, 794, 1490, 1619, 1492, 1056, 1009, 794, 3651, 1014, 3258, 1678, 3528, 1202, 2851, 1446, 1447, 187, 1436, 2838, 843, 1737, 4228, 1431, 4230, 1454, 2083, 2748, 956, 3529, 2075, 3898, 3116, 1523, 1242, 1902, 4060, 1422, 1148, 3981, 824, 1012, 1209, 1430, 2864, 839, 1461, 4610, 4597, 4292, 4344, 3493, 865, 4450, 3028, 1034, 2068, 1875, 1150, 3249, 2070, 1880, 3313, 2071, 2072, 801, 1884, 1077, 2989, 2990, 2920, 2920, 3274, 1844, 2920, 4400, 1894, 4402, 1615, 844, 3857, 4648, 3860, 3861, 4862, 3309, 3811, 3865, 3866, 3867, 1914, 3869, 3870, 3871, 3920, 2748, 4267, 5297, 4546, 4306, 3779, 4623, 4896, 1637, 3183, 1056, 939, 1210, 1654, 4877, 1831, 1181, 5133, 2680, 1185, 1193, 3135, 4372, 3929, 4376, 5541, 1948, 3366, 5102, 4926, 1027, 233, 651, 959, 959, 3554, 3556, 959, 841, 5162, 5614, 970, 1253, 871, 5639, 5141, 1006, 1587, 4965, 970, 5714, 947, 970, 2985, 5151, 871, 4281, 959, 3333, 5237, 871, 5238, 1150, 1887, 959, 3438, 871, 948, 5753, 3440, 5150, 5458, 5309, 5497, 5311, 3447, 859, 4250, 1056, 1911, 3017, 883, 4097, 5490, 3520, 4197, 4312, 3523, 5766, 1497, 3297, 3301, 3304, 3305, 5486, 1500, 3314, 4607, 3316, 3317, 5631, 5959, 5363, 715, -2421, 4265, 4200, 4270, 4271, -1977, -2489, 1910, 4099, -2568, -2610, 2811, 668, 3917, 5947, 5489, 776, 776, 3499, 1056, 4133, 5257, -1944, 5360, -2456, -1957, -1982, -2636, 1582, 4305, 5112, -2677, 1430, -2456, -2456, 1217, 1941, 1443, 1444, 5020, 5677, 5678, 3113, 4110, -2572, 3002, -2002, 2639, 1453, -2457, 5998, -2865, 5667, 4633, 5994, 776, 954, 2843, -2457, -2457, -2865, -2865, 3838, 1672, 3254, -1972, 715, 5883, 715, 1582, 2144, 6292, 1703, 1221, 1582, 3375, 3375, 3235, 6415, 1867, 2048, 1056, 1730, 3228, 2060, 2060, -2420, 715, 1039, -1985, 715, 2855, 1616, 2996, 2999, -1985, 5341, 2624, 776, 3212, 1287, 1941, 2645, 1465, 3284, 5995, 2855, 715, 2044, 1872, 1616, 715, 4534, 1249, 1709, 1183, 776, 2685, 2983, 3059, 3228, 2855, 6144, -1916, 2920, 776, 5113, 4110, 5703, 1196, 776, 6146, 1941, 4469, 1941, 2647, -150, 5870, 4362, 715, -2417, 4062, -150, 6250, 4345, 5211, 5212, 5213, 1994, 5215, 5216, 5217, 5218, 5219, 2855, 1137, 4133, 1710, 2847, 6255, 3876, 5163, 4978, 3801, 2788, 4099, -1777, 5031, 1257, 5816, -2633, 2784, 1232, 6154, 1941, 1836, 1734, 1082, 5852, 2976, 6422, 1466, 5092, 782, 3350, 1941, 782, 782, 5760, 3423, 2949, 1941, 1040, 1889, 41, -2247, 5761, 2698, 1150, 2785, 1737, 2691, -2247, 4983, 782, 6124, 3802, 783, 782, 3236, 783, 783, 3228, 5644, 2144, 1554, 3285, 5114, 2144, 3082, 1240, 782, 5630, 2687, 2826, 2045, 5254, 2683, 783, 6112, 4049, 5961, 783, 45, 3773, 1004, 3250, 1519, 6379, 3627, 3668, 3803, 3645, 1446, 1447, 783, 2645, 3091, 3114, 5369, 2645, 662, 2855, 6416, 2855, 3231, 6250, 6412, 1041, 1467, 2855, 5649, 1468, 2872, 1554, 5082, 6138, 5439, 2968, 1206, 3088, 2913, 6255, 6293, 3493, 1454, 1520, 49, 5371, 2647, 1521, 2891, 804, 2647, 4100, 1004, 5377, 776, 2937, 6151, 3118, 2892, 5083, 4979, 3286, 5880, 3228, 776, 2969, 2873, 6139, 5440, 1461, 663, -1096, 5681, 3669, 1104, 6432, 4133, 6450, 1241, 2699, 1114, -1944, 1522, 4050, 5754, 2855, 4111, 2137, 1042, 1941, 2827, 2640, 1128, 896, 1957, 715, 2849, 1555, 3092, 1836, 57, 4984, 5817, 6294, 1831, 3628, 3424, 3417, 3351, -2266, 5255, 3083, 2950, 1942, 3418, -1777, -2266, 2951, 5093, 1711, 2138, 4594, 5853, 3232, 1291, 1957, 1997, 1233, 2046, 1873, 1735, 1047, 5032, 5818, 6240, 1048, 6054, 5711, 2786, 3287, 1873, 1695, 3288, 716, 6250, 2042, 1555, 5762, 1469, 2818, 2629, 875, 3213, 2661, 5918, 3877, 3060, 3229, 4129, 2825, 6255, 1059, 4186, 5115, -1944, 1150, 6188, 871, 2682, 959, 4111, 959, 4980, 5742, 959, 1150, 1150, 6189, 1942, 192, 2625, 1006, 2080, 1087, 4345, 1084, 1117, 4078, 959, 2882, 6095, 5595, 4546, 1085, 959, 3115, 6294, 1626, 2954, 6335, 4090, 2957, 1150, 6123, 1957, 3237, 3839, -2633, 4100, 1942, 1086, 1942, 3003, 3026, 3027, 5342, 6381, 2850, 651, 2734, 5000, 934, 1443, 1444, 4634, 3016, 3238, 970, 1241, 3376, 4204, 1006, 1712, 1873, 970, 1290, 1873, 970, 5116, 2964, 2984, 1957, 3004, 6310, 1047, 5996, 2944, 1441, 1048, 2947, 2948, 1942, 6295, 959, 1088, 4470, 5331, 2038, 2926, 669, 1453, 3289, 1942, 2658, 1470, 1213, 5111, 5559, 1942, 1241, 1873, 1736, 192, 2882, 6309, 5999, 1244, 2882, 1943, 5997, 2882, 3025, 1142, 5370, -2633, 2899, 2789, 6077, 3623, 5158, 2997, 3000, 4101, 1047, 5379, -2421, -2633, 1048, 788, 789, -1977, 3270, 3033, 1505, 4148, 3464, 871, 5159, 2977, 2978, -2489, 826, 2725, -2568, -2610, 826, 826, 1445, 2726, -2456, 1449, -1982, 1967, 6360, 1214, 2943, 1219, 4112, 1223, 3201, 1281, -2636, 5007, 4688, 1227, -2677, 788, 789, 5011, 1244, 1230, 2098, 5954, 1950, -2457, -2247, -2865, 6145, -2572, 1410, 1410, 871, 826, 826, 2612, 4308, 6147, 6232, -1944, 3185, -1972, 2140, 5957, 2627, 871, 1456, 1457, 2663, 2664, 871, 6393, 1456, 1457, 2816, 1954, 1410, 1965, 3290, 6242, 1617, 1618, -2420, 3244, 2034, 1458, 6409, 3708, 1004, 4507, 1646, 1460, 839, 3211, 2686, 4912, 1258, 1260, 1617, 1618, 1942, 1858, 1047, 4932, 6261, 3226, 1048, 788, 789, 1556, 4546, 2833, 788, 789, 1647, 2067, 3493, 1987, 4685, 3493, 1509, 4267, 5528, 1410, -150, -150, 1854, 4187, 1990, 2883, 1859, 2076, 1860, 4378, 1957, 1561, 2898, 871, 4145, 4146, 4147, 4148, 3047, 81, 84, 72, 176, 3888, 192, 85, 871, 86, 185, 4970, 181, 87, 107, 125, 947, 1849, 6197, 130, 182, 160, 2833, 871, 179, 3493, 4521, 1539, 5866, 4464, 4465, 186, 948, 3493, 4466, 1557, 6312, 184, 4744, 2833, 6208, 4595, 871, 2907, 4739, 4740, 4607, 959, 959, 3419, 4588, -2266, 2607, 2608, 2609, 2610, 2611, 2612, 2609, 2610, 2611, 2612, 3069, 4314, 6462, 4315, 876, 3087, 4526, 4527, 6190, 2883, 4188, 4842, 4886, 2883, 6468, 4846, 2883, 826, 826, 187, 3594, 4832, 2865, 4834, 4835, 2810, 1546, 1298, 5073, 3276, 4133, 4595, 6096, 6122, 4134, 4135, 4136, 710, 4725, 4690, 1410, 1410, 4232, 3520, 4379, 4286, 5741, 2882, 6116, 1418, 1420, 6359, 2956, 6051, 651, 4643, 959, 3889, 6056, 6057, 970, 4685, 5074, 1006, 970, -1944, 970, 4802, 6104, 1437, -447, 959, 4649, -1944, 3308, 1445, -1944, 1474, 1274, -1944, 6315, 6316, 2037, 5705, 6115, 4143, 4144, 4145, 4146, 4147, 4148, 2769, 2687, 966, 4562, 871, 5747, 839, 1258, 4189, 2884, 1298, 959, 959, 4133, 6267, 1941, 4586, 4134, 4135, 4136, 949, 6300, 1891, 6186, 3077, 4045, 2882, 4576, 5798, 2882, 5512, 6305, 793, 871, 871, 871, 1100, 959, 793, 651, 2885, 651, 651, 1465, 949, 2986, 1527, 6156, 3373, 4309, 1547, 5909, 3018, 5911, 1714, 4699, 1836, 5915, 5916, 4998, 1715, 987, 1164, 3575, 5182, 2886, 6426, 3748, 988, 989, 990, 5451, 4650, 715, 3525, 959, 4340, 959, 959, 1275, 6350, -1778, 3452, 3690, 3129, 1264, 1493, 5127, 2905, 1567, 5650, 4926, 4473, 2884, 1694, 5980, 4691, 2884, 3670, 715, 2884, 3496, 3723, 5325, 6438, 6461, 2880, 6241, 3453, 3146, 1410, 950, 6395, 5412, 2923, 6023, 6233, 2927, 665, 5854, 2882, 1466, 6470, 6269, 2885, 1604, 6452, 4137, 2885, 192, 3985, 2885, 3147, 1906, 1528, 950, 2015, 5413, 2015, 3223, 3224, 3691, 871, 4474, 803, 5981, 5855, 4047, 3748, 2886, 4138, 4308, 2882, 2886, 1056, 3576, 2886, 4547, 1298, 6219, 3614, 4133, 3402, 951, 3671, 4134, 4135, 4136, 3809, 1716, 2063, 1999, 715, 2001, 1495, 2003, 1907, 2005, 3890, 2007, 2008, 2009, 3724, 4795, 4380, 4381, 2011, 3526, 1529, 871, 2880, 715, 5452, 2079, 2880, 2883, 3271, 2880, 3273, 1467, 4053, 3372, 1468, 5811, 3280, 4550, 6270, 1410, 6306, 6440, 3294, 3295, 6022, 1934, 5482, 4382, 6157, 5943, 1288, 3187, 4577, 3986, 3318, 6317, 4138, 5476, 5951, 1935, 5940, 3078, 4700, 3553, 3338, 2906, 1548, 3624, 4139, 3374, 3353, 4692, 3643, 4543, 1933, 934, 5939, 5541, 5507, 5968, 3210, 1410, 5953, 4651, 3215, 711, 3918, 3558, 3692, 3222, 5956, 3615, 3225, 3740, 1276, -1778, 5488, 2883, 4552, 3595, 2883, 2866, 6348, 1136, 3891, 4117, 5955, 4046, 5989, 1549, 1410, 1410, 1410, 2138, 1410, 2867, 1936, 2868, 3160, 4644, 1298, 761, 942, 4133, 5799, 6358, 3476, 4134, 4135, 4136, 5541, 3148, 5513, 3162, 1530, 1410, 6365, 1277, 3403, 1278, 6271, 15, 4139, 3404, 1550, 4796, 712, 3194, 3175, 3709, 3181, 3177, 3848, 1469, 3625, 967, 5070, 1942, 4652, 3795, 2038, 5326, 871, 4640, 5706, 3796, 4563, 1137, 5337, 3070, 2643, 940, 4130, 4131, 1892, 6394, 6137, 4150, 20, 2882, 1410, 3741, 1638, 2869, 4927, 1717, 1004, 1265, 713, 1101, 714, 2883, 5354, 4279, 3405, 4341, 2962, 952, 3086, 2768, 2882, 3214, 2884, 1908, 4138, 3220, 3221, 3324, 6424, 5443, 5862, 1509, 1976, 1509, 4555, 1165, 6220, 1551, 4181, 4182, 1937, 952, 3853, 2883, 3710, 6172, 1410, 4462, 1718, 4048, 1410, 1410, 5856, 2885, 6277, 2959, 3742, 3740, 3947, 941, 6441, 871, 871, 871, 2732, 5330, 1410, 3700, 5534, 2692, 2693, 2122, 2697, 5298, 1138, 1977, 6106, 5812, 2886, 5414, 3904, 4556, 942, 1719, 1266, 948, 948, 3693, 948, 1470, 826, 5535, 2884, 1235, 3797, 2884, 1267, 5536, 4557, 3618, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 3269, 4139, 5537, 3987, 1938, 1471, 4454, 6272, 1639, 3743, 2880, 5455, 6221, 3614, 2885, 5789, 2822, 2885, 3988, 3559, 3125, 826, 3560, 1536, 959, 5208, 1537, 1909, 2790, 4472, 5676, 1924, 5100, 5927, 715, 1039, 3741, 871, 2854, 2886, 4287, 6222, 2886, 5477, 942, 4138, 871, 3126, 3164, 959, 5301, 3439, 5172, 6173, 6132, 5305, 3005, 3032, 5307, 5138, 3406, 4509, 3176, 808, 6193, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 5064, 3182, 1006, 2884, 871, 5068, 2880, 826, 5756, 2880, 2922, 2922, 5139, 4865, 2922, 1512, 1836, 3742, 3970, 4558, 5746, 2794, 33, 5757, 826, 2779, 1539, 871, 2829, 3614, 871, 1539, 2795, 1939, 2885, 2884, 5087, 4476, 3615, 2980, 4546, 3467, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 3929, 959, 6042, 41, 2883, 782, 4139, 3744, 2886, 1139, 3650, 5538, 6231, 5919, 1040, 2885, 3493, 1039, 871, 6194, 3493, 3905, 4870, 3616, 5755, 2883, 2773, 5673, 3743, 783, 959, 959, 959, 959, 871, 2779, 1978, 2829, 2774, 2748, 2886, 3470, 45, 2748, 3798, 6238, 6239, 1140, 871, 2880, 3573, 5674, 681, 1539, 2829, 2780, 2775, 1539, 5928, 1410, 1410, 1410, 3701, 41, 6000, 6053, 3617, 1640, 3468, 943, 4888, 5564, 3841, 4428, 1990, 2791, 3006, 3615, 5790, 4863, 1041, 2880, 829, 666, 5132, -1701, 49, 3799, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4288, -1701, 50, 6174, -708, 45, 5666, -1701, 6175, 1004, 1004, 5091, 1493, 1641, 1141, 5101, 1142, 5129, 1494, 6133, 1143, 4381, 4357, 3173, 1040, 3800, 51, 5879, 3493, 683, 3127, 1514, 6308, 1837, 4914, 6001, 1838, 5619, 1831, -623, 3163, 5929, 3745, 6176, 3205, 57, 1042, 4866, 1642, 49, 3746, 4956, 1979, 3747, 3744, 4972, -1701, 5565, 2701, 4864, 41, 871, 50, 5088, 2796, 4755, 1469, 4756, 3156, 5140, 3502, 5539, 871, 5920, 1515, 2792, 5758, 830, 3618, 6166, 959, 959, 2884, 5540, 849, 3574, 51, 1513, 4543, -1701, 1041, 4429, 195, 1469, 4898, 3455, 959, 2781, 850, 45, 1495, 4358, 3906, 2884, 5841, 57, 2702, 2797, 793, 1516, 793, 6357, 793, 2885, 871, 2922, 4996, 4898, 793, 1228, 1229, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 959, 959, 959, 959, 2885, 2776, 1455, 196, 2886, 871, -1701, 6361, 1957, 49, 5295, 3125, 871, 5946, 1487, 3136, -1701, 1496, 6201, 1042, 3907, 3524, 50, 5967, 2781, 2886, 1004, 3503, 1298, 1957, 651, 4133, 6130, 651, 3618, 4134, 4135, 4136, 3126, 2703, 3030, 3031, 4889, 970, 970, 2880, 51, 2701, 4899, 4890, 2855, 831, 3745, 5272, 1006, 1006, 4891, 5960, 970, 5138, 3746, 970, 2856, 3747, 3759, 57, 2880, 1218, 1220, 1222, 851, 4899, 1224, 1225, 1226, 1262, 959, 959, 694, 3206, 695, 3203, 1231, 959, 1298, 871, 5139, 4133, 4757, 2704, 6338, 4134, 4135, 4136, 4892, 2702, 1643, 1298, 3240, 192, 4133, 2097, 2015, 3697, 4134, 4135, 4136, 699, 662, 959, 5788, 970, 5832, 3207, 3219, 970, 970, 4893, 871, 871, 1488, 959, 5273, 3493, 3493, 3760, 4900, 3208, 871, 3721, 4901, 866, 4003, 3763, 4689, 2860, 3766, 2861, 1656, 878, 3195, 4430, 3196, 4467, 3197, 5526, 3198, 4410, 3199, 4900, 3300, 1493, 3200, 4901, 2705, 4702, 3532, 5591, 871, 4411, 938, 871, 3136, 6319, 803, 3209, -1701, 803, 3260, 192, 4968, 4543, 1410, 1087, 1410, 1084, 3842, 3843, 3844, 1410, 1410, 1657, 793, 1085, 4431, 2785, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1212, 1086, 3804, 1410, 2862, 1410, 1006, 1410, 1410, 1410, 1410, 1410, 1410, 2704, 6113, 1410, 5457, 1410, 1410, 3255, 4432, 1410, 2748, 4468, 6339, 4942, 4714, 3203, 2959, -173, 3721, 4356, 2748, 4738, 6131, 1047, 1410, 1410, 1410, 1048, 1495, 3650, 4726, 4138, 5470, 1088, 4258, 4730, 3640, 2144, 4969, 3810, 4177, 793, 1410, 5481, 3735, 5777, 6114, 1705, 4943, 936, 5430, -2440, 5431, 5432, 5433, -173, 1273, 1451, 1452, 3733, 1604, 3734, 5938, 5625, 1150, 5627, 2705, 1129, 4259, 3259, 3997, -1748, 1675, 6397, 5468, 4257, 1255, -1748, 2631, 1496, 6110, 1265, 959, 4848, 3886, 4671, -173, 4138, 3929, 5322, 1706, 4368, 2144, 1628, 1707, 2748, 5459, 3825, 1684, 2635, 4138, 1432, 2647, 1715, 1130, 3848, 4261, 3933, 3934, 3935, 3936, 4516, 3938, 846, 2920, 1676, 1646, 4139, 6063, 1129, 4751, 4752, 4753, 4754, 2645, 1708, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 3758, 3966, 4729, 937, 1647, 5721, 1131, 4734, 4735, 5460, 4944, 3533, 3203, 953, 3, 4, 2632, 4258, 3493, 5085, 1130, 2647, 1266, -1748, 1524, 3493, 41, 1482, 1685, 5447, 3493, 5449, 5338, 3493, 1267, 1629, 5988, 4139, 3785, 1646, 3776, 4829, 3777, 1892, 4471, 2855, 3781, 5971, 4030, 1681, 4139, 4259, 2949, 1410, 4806, 4807, 1132, 2863, 4589, 5722, 6064, 954, 5723, 1647, 4257, 45, 4260, 1525, 5820, 5724, 1686, 4425, 6234, 3832, -1748, 5950, 3826, 1687, 2060, 1298, 761, 1688, 4133, 195, 41, 4311, 4134, 4135, 4136, 4261, 3732, 4508, 1682, 5086, 4257, 1677, 5917, 5725, 4263, 2930, 15, 1646, 1526, 962, 2933, 4041, 5339, 1410, 1132, 49, 1023, 793, 2872, 1532, 4426, 793, 793, 3805, 4262, -1701, 4296, 964, 50, 45, 6420, 1647, 6423, 1683, 196, 6287, 4619, 1102, -1701, 1103, 195, 3959, 3807, 20, -1701, 5821, 986, 1024, 4258, 4831, -150, 5912, 51, 5302, 2873, 4427, 5913, 36, 3806, 4927, 6288, 1998, 1892, 5726, 2000, 4297, 2002, 4684, 2004, 1410, 2006, 57, 5673, 49, 2010, 977, 5727, 3808, 4258, 985, 6321, 2052, 4259, 3008, 1013, 196, 50, 3014, 2929, 5728, 6199, 4927, 3921, -1701, 6464, 6311, 5674, 4260, 1035, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 3021, 1990, 51, 5914, 4259, 2950, 4685, 6340, 1029, 6451, 2951, 1990, 4261, 3022, 681, 4263, 2053, 1097, -1701, 4260, 1912, 3534, 5050, 6463, 3469, 3471, 3472, 3637, 4167, 3019, 1298, 6433, 6341, 4133, 4174, 3, 4, -2992, -2992, -2992, 4229, 4262, 4261, 3023, 1913, 5051, 6041, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 3521, 3522, 1984, 1689, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, -1701, 4878, 4262, 3020, 1649, 6434, 5033, 5673, 1038, 5683, -1701, 234, 4029, 1985, 2138, 4132, 4074, 667, 5781, 683, 1047, 2656, -2992, 1722, 1048, 759, 1726, 4160, 2662, 1690, 5034, 5674, -1700, 1691, 1456, 1457, 3493, 2669, 1046, 2670, 5303, 4075, 5782, 2673, 847, -1700, 4076, 1456, 1457, 1090, 2679, -1700, -2413, 1458, 4284, 6425, 4927, 1047, 1092, 1235, 776, 1048, 4318, 4184, 6203, 6204, 1460, 1445, 1692, 2681, 1047, 4263, -2421, 33, 1048, 1693, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, -2414, 1410, 1106, 4885, 1107, 1047, 1125, 1235, 1445, 1048, 2681, 871, 1410, 1004, 1410, -1700, 4263, -1772, -1772, 5882, 41, 871, 4215, 4139, 5886, 5887, 3607, 6152, 29, 871, 4477, 1410, 1111, 6153, 959, 1410, -622, -473, 1410, 5729, 1410, 3448, 5730, 1410, 5081, 791, 1150, 1410, -1700, 4656, 5295, 791, 1133, 3604, 4657, 3608, 3609, 793, 1134, 45, 4237, 4238, 1135, 5166, 1636, -1121, 1152, 793, 4657, 1653, 3495, 4346, 1445, 1156, 1474, -1701, 871, 871, 5199, 4231, 1163, 1996, 2069, 4313, 1838, 1838, 2084, 1410, 57, 3601, 3387, 3388, 3389, 3390, 1172, 5207, 1410, 1410, 4159, -1700, 4161, 4162, 2642, 49, 1179, 1838, 4386, 762, 1173, -1700, 871, 1228, 1229, 1445, 1190, 2681, 50, 694, 3539, 695, 3544, 3636, 6298, 2655, 5972, 4274, 2656, 2689, 3191, 41, 1838, 2656, 3493, 3202, 3491, 3204, 3203, 1836, 3203, 3247, 51, 1197, 3248, 4202, 2682, 3451, 1888, 4955, 1990, 1207, 826, 4605, 3493, 3456, 793, 681, 2656, 793, 793, 763, 776, 803, -473, 803, 3545, 662, 3634, 2656, 45, 3635, 3622, 41, 3715, 5230, 1234, 3716, 4139, 1410, 1235, -1094, 5235, 5236, 5134, 3882, 3493, 1239, 3883, 4021, 651, 940, 3203, 970, 1006, 970, 970, 4073, 1246, 959, 2656, 4945, 871, 4952, -1749, 3536, 4082, 1243, 4088, 2656, -1749, 2656, 45, 4089, 49, 3739, 2656, 3577, 1255, 3580, 5868, 826, 4108, 1527, 6353, 3841, 4543, 50, 5873, 5874, 6286, 683, 839, 2854, 4220, 1262, 4221, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 3656, 871, 4222, 4930, 4223, 51, 4119, 3667, 4913, 2656, 49, 4152, 1263, 941, 2656, -1700, 871, 4701, 4166, 6246, 29, 2656, 1269, 50, 57, -1434, 1261, -1434, 4171, 3730, 4235, 4172, 6436, 2656, 4403, 6439, 4408, 4404, 871, 4409, 2748, 6196, 685, 1105, 5642, 5643, -1749, 51, 4322, 1105, 3829, 4436, 4505, 4592, 4437, 4437, 2829, 4628, 1271, 871, 4629, 1105, 1282, 4564, 4631, 1528, 57, 4632, 4662, 1283, 1951, 4663, 826, -2991, 4776, 1284, 1955, 4777, 4927, 4971, 4349, 4787, 3493, 1272, 4788, 4798, 1966, 1285, 2656, 4873, 1969, 3151, 4874, 3152, 1972, 959, 1974, -1749, 959, 1286, 5769, 4879, 1982, 4884, 4880, 793, 3560, 942, 1988, 5135, 5201, 1991, 3203, 2038, 5242, 1292, 3375, 2656, 1659, 1529, 5279, 41, 1267, 2656, 871, 871, 5333, 5357, 5847, 3560, 5358, 5364, 1294, 4445, 3203, 4333, 1456, 1457, 4451, 3812, 1660, 3815, 3817, 4535, -2992, -2992, -2992, 4143, 4144, 4145, 4146, 4147, 4148, 5365, 5366, 1150, 3203, 3203, 1421, 3069, 45, 3493, 3775, 6398, 5483, 4420, 1659, 5484, 694, 5245, 695, 5246, -2991, 1410, 1410, 1410, 4093, 5520, 4094, 1410, 4663, -1121, 4616, 5556, 4617, 6120, 5557, 959, 1660, 1423, 5558, 5152, 1661, 2656, 698, 5578, 1425, 1888, 5579, -1701, 959, 5075, 5588, 5076, 49, 1990, 1410, 5594, 959, 1424, 4602, 5596, -1701, 5716, 4602, 1429, 5717, 50, -1701, 5736, 1433, 2854, 3203, 5145, 5770, -2991, 871, 5771, 5830, 6015, 6016, 5831, 3919, 1530, 5836, 803, 1439, 1990, -2991, 6454, 1661, 51, 4875, 5839, -2991, 1438, 4602, 959, 3930, 5850, -2991, 5901, 5851, 5802, 5902, 5803, -2991, 943, 3812, -2991, 6247, 3359, 5942, -2991, 3362, 2634, 1441, -1701, 959, 4066, 3952, 4068, 4069, 5969, 1448, 6006, 5851, 5481, 4172, 6007, 3970, 1445, 2656, 6027, 1662, 6031, 6028, 6032, 1990, 6062, 2656, 6068, 3248, -2991, 3248, -2991, -1776, -1776, 1531, 4708, -1701, 6069, 1462, 6072, 3248, 4063, 2656, 1532, 6367, 959, 6368, 959, 3491, 959, 1491, 6073, 4582, 6074, 2656, 6102, 6075, 1479, 6103, -1689, 3493, 6168, -2991, 6183, 4602, 4929, 2656, 4931, 1662, 6185, 4934, 2687, 2656, 1533, 4826, 1449, 4828, 1534, 3282, 3283, 1464, 36, 2015, 1663, 6039, 1479, 6198, -1701, 1664, 3203, 4927, 3948, 2748, -1775, -1775, 3319, 3320, -1701, 1480, 1004, 4319, 4320, 6212, 6236, 2958, 6213, 6237, 6285, 6318, 1506, 5844, 5851, 1535, -2991, 1507, 6363, 6383, -2991, 6364, 6384, 1508, 6391, 6392, -2991, 4874, 2656, 3365, 6419, 1559, 6421, 6028, 1663, 2656, 6162, 6163, 6429, 1664, 4596, 6430, 1666, 651, 959, 1659, 970, 4694, 970, 970, 1536, 959, 1511, 1537, 6467, 2958, 6469, 6384, 1410, 6430, 1517, 1737, 6471, 1410, 4565, 6384, 4567, 1660, 5288, 1474, 5290, 1836, 3493, 5546, 5547, 934, 2727, 4847, 2730, 4850, 1585, 5573, 4547, 5574, 1150, 4782, 1150, -2991, 4548, 2143, 1666, 1668, 2144, 931, 932, -2458, 1588, 1590, 1591, 1626, 1630, 1631, 4549, 6120, 1538, 650, 1632, 4280, 2687, 4927, 1643, 1645, 1410, 1410, 1410, 1669, 4955, 1410, 1655, 1661, 1658, 1680, 4748, 934, 2645, 1410, 1410, 1410, 1410, 1696, 4550, -2992, 4551, 5550, 1697, 1713, 1671, 4679, 1723, 1668, 6244, 1410, 3376, 1724, 1410, 1727, 1410, 1733, 4637, 1732, -1701, 2143, 4441, 1846, 2144, 1848, 4775, 2647, 1410, 1410, 1850, 1855, 1410, 1669, 1861, 1866, 1869, 5687, 1150, 1871, 2143, 1876, 1879, 2144, 4457, 1881, -2991, 1873, 1890, 3493, 1895, 1006, 1896, 1410, 1671, 1410, 2645, 1410, 4949, 1898, -137, 4552, 1899, -2992, 1901, 1903, 4946, 5355, 1904, 1915, -2991, 1922, -2991, -2991, 1924, 2645, 1410, 4814, 1927, 4219, 1931, 1662, -2992, 871, 5688, 214, 1940, 1945, 1047, 2647, 4553, 1479, 1048, 1946, -2991, 934, 1947, 1949, 1952, 4183, 4927, 871, 4225, 4226, 4227, 1953, 1957, 1956, 2647, 5689, 1964, 1968, 1970, 1971, 1973, 1975, 1980, -2991, 1981, -2991, -2991, 1993, 1983, 1986, 6216, 1989, 1995, 5179, 5690, 2143, 1992, 651, 2144, 5691, 3495, 4255, 4909, 2055, 2012, 4255, 4269, 4255, 4255, 2043, 1663, -2992, -2755, 934, 1410, 1664, -2992, 2066, 2073, 1410, 2081, 5692, 2074, 2077, 2082, 5693, -1948, 2682, -1955, 2089, 2645, 2958, 2090, 957, 1410, 2091, 2092, -2992, 4554, 2093, 5694, 57, 969, 4555, 188, 4995, 4201, 2095, 3495, 5794, 969, 2096, 4301, 969, 2097, 4304, 3495, -1945, 3544, -1946, 3697, 3491, 4966, 2647, 3491, 188, 1666, -2992, 4575, 2099, 4578, -1949, 2100, -2992, 2101, 2102, 2103, 2104, -2992, 5069, -1947, 2105, 2106, 2107, 3493, 2108, 2109, 5056, 3721, 2110, 4556, 2111, -2992, 2112, 5061, 2143, 2114, -2992, 2144, 1410, 2115, 933, 2145, 2146, 2147, 2620, 2116, 4557, 2117, 6396, 2118, -2755, 3491, 2119, 2120, 1668, 2121, 2122, 2124, 2125, 3491, 2126, 2127, 959, 959, 2652, 3383, 2128, 3384, -2992, 2645, 2129, 2130, 2131, 2618, 4805, 2622, 2646, 2624, 1669, 2625, 2634, 4190, 2636, 4191, 2637, 5695, 2659, -2992, 2660, 2665, 2667, 2668, 2671, 3385, 2672, 2674, 2675, 2676, 1410, 1671, 2677, 2678, 2647, -2755, 2683, 2690, 1494, 2721, 1496, 4192, 2733, 2735, 2723, 2736, 2737, 5808, -2755, 2738, 2754, 2755, -2992, 2756, -2755, 2681, 2758, -2992, 2652, 2757, -2755, 2760, 2759, 2761, 2764, 3493, -2755, 2762, 2763, -2755, 2765, 3493, 5696, -2755, 2787, 2793, 2771, 2652, 5829, 2820, 2813, 2817, 4558, 2821, 2823, 2799, 2824, 4414, 2835, 2839, 3386, 2841, 2840, -2992, 4280, 2858, 2859, 4703, 2819, 2870, 2874, 2876, 2877, -2755, 2878, 2879, 3386, 946, -2992, 2880, 2888, 871, 2895, 2894, 3167, 2890, 2893, 2889, 2904, 2900, 2901, 2922, 3174, 2914, 2928, 2910, 2911, 2924, 2925, 2938, 2931, 2934, 2945, 2952, 2955, 2935, -2755, 1604, 2981, 2998, 2982, 5503, 2970, 3007, 2972, 2974, 3387, 3388, 3389, 3390, 3036, 3029, 2648, 3391, 3392, -2992, 2940, 2649, 5196, 3393, 2941, 2953, 3387, 3388, 3389, 3390, 2652, 3463, 3465, 4193, 2979, 3041, 2960, 3473, -2992, 4194, 2961, 2966, 2967, 2973, 2650, 2337, 3043, 3044, 2975, 2987, 2988, -2755, 3045, 3046, 3001, -2755, 3493, 3012, 3050, 3051, 3052, -2755, 3054, -2992, 3057, 3055, 3056, 3058, 3062, 3519, 3519, 3063, 2651, 3064, 4041, 2607, 2608, 2609, 2610, 2611, 2612, 3065, 3072, 3073, 3076, 676, 3081, 3089, 3100, 3104, 3105, 1677, 3108, 3117, 1410, 3120, 3123, 3124, 3133, 3144, 1410, 3150, 3154, 3166, 3168, 3137, 3141, 3170, 3169, 3184, 3159, 959, 3171, 3216, 3227, 2404, 3257, 3241, 3246, 3276, 3321, 3354, -2755, 2144, 3281, -2992, 3360, -2992, 3401, 3364, 2652, 3421, 793, 3427, 3442, 3444, 3445, 2607, 2608, 2609, 2610, 2611, 2612, 2687, -2992, 3459, 1469, 3458, 871, 871, 871, 3380, 3399, 3460, 3474, 3426, 2607, 2608, 2609, 2610, 2611, 2612, 3443, 3457, 3496, 871, 3513, 3537, 3461, 941, 3515, 3530, 3538, 3462, 3466, 3514, 3475, 3549, 3550, 1410, 3394, 808, 3501, 5464, 3516, 4626, 3569, 3578, 3583, 3552, 3586, 3591, 3395, 3581, 3011, 3596, 4195, 2015, 871, 871, 3602, 3597, 3610, 871, 3626, 3599, 5145, 3631, 4196, 3633, 3647, -2755, 3641, 5267, 3648, 871, 3649, 3655, 3659, 3672, 3677, 3678, 3704, 3698, 3705, 3711, 2143, 2654, 3706, 2144, 3714, 3722, 3732, -2992, 3731, -2755, 3729, -2755, -2755, 3753, 1892, 5253, 3752, 5313, 3813, 2607, 2608, 2609, 2610, 2611, 2612, 3828, 3836, 3837, 5191, 5192, 5193, 5194, 5195, -2755, 3840, 2645, 942, 3849, 3769, 3856, 1244, 3862, -2992, 3863, 3868, 959, 3895, 3896, 3864, 3873, 3884, 3910, 3912, -2755, 3914, 3494, -2755, -2755, -2755, 3219, 4682, 3924, 5375, 3916, 3943, 957, 3945, 3937, 2647, 3931, 871, 3942, 3944, 4622, 969, 3946, 3950, 3953, 3955, 3957, 793, 969, 3958, 3961, 969, 3962, 871, 3967, 793, 3982, 3983, 793, 3984, 3992, 3993, 3994, 3996, 5320, 4812, 5871, 3998, 4012, 4014, 793, 4015, 1410, 4018, 2603, 4020, 4659, 4038, 4023, 1562, 4024, 1410, 4025, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 4028, 4026, 4027, 1410, 1990, 1987, 5437, 1410, 1410, 1410, 1954, 4033, 4032, 4042, 1410, 4808, 3090, 1410, 4044, 4057, 1410, 4051, 4059, 1563, 3107, 4067, 1410, 4087, 1410, 4043, 1241, 1410, 3011, 4103, 4090, 4107, 1410, 1410, 1410, 1410, 4105, 4084, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 4085, 4086, 4098, 1410, 1410, 1410, 4115, 4109, 3298, -2992, 4120, 4118, 3841, 1410, -2992, 4121, 4125, 4127, 1410, 4128, 4129, 934, 1410, 2656, 4151, 3165, -2239, 4156, 4157, 4164, 1410, 4165, 4168, 1410, 1564, 1410, 4179, 4185, 4209, 4210, 4216, 4180, 4212, 4199, 2143, 188, 4214, 2144, 4233, 4234, 4239, 1410, 3011, 4241, 1410, 1410, 4247, 4276, 4289, 1410, 1410, 4291, 4293, 4295, 1410, -2992, 1410, 4818, 5317, 4272, 4240, 1565, 5107, 5108, 2098, 871, 871, 871, 4302, 2645, 4310, 4280, 4242, 4316, 4282, 4248, -2992, 4321, 4819, 4820, 4821, 4822, 1410, 4255, 4269, 4255, 4255, 192, 1410, 4255, 4324, 1087, 4840, 1084, 4323, 4328, 3495, 4256, 4330, 4280, 3495, 1085, 2647, 4342, 4353, 4343, 4855, 4354, 4355, 4361, 4359, 1566, 4367, 2652, 4365, 4370, 4366, 4371, 1086, 6278, 6279, 4373, 4388, 6281, 4389, 4391, 4377, 4397, 188, 933, 4398, 4399, 4407, 1410, 4415, 4424, 4438, 4440, 4442, 1562, 4444, 4446, 4448, 4453, 4452, 4458, 4456, 4459, 3544, 4463, 1410, 1567, 4460, 4485, 4461, 1568, 4478, 4479, 4480, 4481, 3491, 4482, 1088, 793, 3491, 4483, 4484, 4488, 4486, 4490, 4492, 4494, 4499, 4487, 4809, 1563, 4489, 4497, 4501, 4491, 2996, 4493, 4503, 5572, 2999, 4513, 4517, 1569, 1570, 4520, 5448, 4052, 5503, 793, 4504, 4510, 1532, 5415, 5416, 4514, 5418, 4525, 4515, 4533, 4531, 4928, 2015, 2854, 2015, 4568, -2992, 2015, 4573, 4936, 4580, 4583, 5611, 957, 4574, 4584, -2992, 4587, 4591, 969, 4601, -2992, 4602, 969, 4604, 969, 1571, 4960, 4611, 4620, 36, 4614, 4621, 4625, 1564, 1572, 4624, 4627, 4641, 4655, 4658, 4661, 4665, 3446, 1573, 4667, 4673, 4674, 4695, 4696, 4675, 4676, 4677, 1574, 4697, 4678, 4704, 4705, 4706, 4707, 4709, 1575, 4710, 4717, 4711, 3491, 4712, 4713, 2084, 4721, 4722, 1565, -2992, 4727, 1576, 4698, 4724, 4680, 4731, 4723, 4728, 4742, 5009, 1577, 4280, 4736, 3494, 4737, 1578, 1926, 4133, 1928, 1929, 4749, -2238, 4789, 4772, 946, 4773, 188, 4800, 4843, 4774, 4801, 4781, 4844, 2959, 4804, 4851, 4815, 4852, 4857, -2992, 4830, 4858, 2143, 4827, 4836, 2144, 4867, 4839, 1566, 4841, 4870, 2607, 2608, 2609, 2610, 2611, 2612, 2652, 4856, 4859, 4872, 4861, 4876, 4887, 5053, 5012, 4895, 4905, 4908, 4906, 4907, 1659, 1579, 4915, 4918, 4916, 3775, 2645, 4919, 4922, 4937, 4940, 3645, 4941, -2992, 4958, 4973, 4961, 1567, 4974, 4975, 4976, 1568, 1660, 4977, 4987, 4989, 959, 4988, 4990, 4991, 4992, 5001, 5003, 5010, 5021, 5004, 5022, 5027, 5030, 2647, 959, 5046, 1410, 5895, 5047, 5897, 5049, 4947, 4937, 871, 5063, 5052, 5065, 1633, 1570, 5097, 5352, 4236, 5066, 5686, 5067, 5089, 1532, 5062, 5104, 5118, 2854, 5078, 5099, 5124, 5110, 5125, 5137, 5147, 1661, 4947, 5130, 5154, 5131, 5153, 5164, 871, 2790, -2992, 5170, 5171, 3495, 3930, 5173, 5175, 5174, 5177, 5178, 5197, 3812, 5183, 1634, 3228, 5204, 5205, 36, 5189, 5214, 5146, 5221, 1572, 5223, 4285, 4285, 5222, 5224, 5276, 5226, 871, 1573, 5227, 5225, 5228, 5587, 5233, 5234, 4948, 5239, 1574, 5244, 1410, 1410, 5250, 5256, 5587, 5259, 1635, 5261, 5265, 6020, 5906, 1410, 5260, 5278, -2240, 5282, 5291, 5306, 4949, 1576, 5296, 5292, 2015, 871, 5299, 3491, 3491, 5315, 1577, 5318, 5319, 5336, -2992, 1578, 5408, 5332, 5733, -2992, 5334, 5329, 871, 1662, 5340, 5359, 5360, 5374, 5310, 5372, 5373, 1004, 5376, 5378, 5383, 5384, 6050, 5385, 5404, 5406, 5397, 5400, 5410, 5411, 5419, 5420, -2992, 5428, 5429, 5434, 5427, 5438, 5441, 5445, 5446, 5453, 5456, 5156, 2607, 2608, 2609, 2610, 2611, 2612, 1410, 5637, 5461, 5465, 5462, 5463, -2992, 5471, 1579, 5469, 5485, 5480, 5475, 5487, 5492, 5491, 1410, 5496, 6086, 6088, 5494, 5498, 1663, 5509, 188, 5515, 5499, 1664, 5500, 5517, 5524, 5551, 5525, 5530, 1410, 3203, 5544, 5656, 5561, 5545, 5555, 5562, 5563, 2958, 5571, 5575, 5580, 4950, 5586, 5466, 5612, 5590, 5593, 5810, 5615, 5618, 5626, 5629, 5633, 5641, 5908, 5645, 1410, 5628, 2652, 1410, 5646, 5815, 5647, 5648, 5653, 5679, 5701, 1410, 1410, 5659, 5660, 5088, 1666, 5664, 1410, 1410, 5720, 5670, 5671, 1410, 5672, 5712, 5709, 5838, 1410, 5715, 5707, 1410, 1410, 5719, 2137, 5739, 5744, 5740, 1410, 5749, 5767, 5751, 871, 871, 871, 871, 5780, 3494, 5778, 2085, 3494, 5772, 5779, 5786, 5796, 5795, 5813, 5800, 5801, 651, 5814, 5822, 4255, 5846, 5828, 1668, 3495, 5840, 5842, 2094, 5844, 3495, 5858, 5845, 3495, 651, 5848, 3812, 5867, 5312, 5865, 5869, 1410, 5875, 1006, 6079, 5877, 2143, 5889, 1669, 2144, 5883, 5921, 1410, -2992, -2992, -2992, 4301, 3494, -2992, 5923, 1410, 5926, 3544, 5890, 5891, 3494, 5930, 5934, 5936, 1671, 5944, 4951, 5949, 5958, 4373, 5962, 5963, 803, 5964, 5965, 5966, 2645, 3491, 5975, 5976, 5977, 6215, 2135, 2646, 3491, 5978, 5983, 5993, 5987, 3491, 5985, 6003, 3491, 6008, 5837, 6018, 6004, 6017, 3995, 2854, 1410, 6019, 5231, 4001, 6024, 4002, 5992, 6034, 6043, 2647, 4217, 6046, 6044, 6048, 5368, 4008, 6047, 6061, 4009, 6091, 4010, 4011, 6065, 6084, 4013, 6094, 5335, 6097, 4016, 6099, 4017, 3546, 6092, 4019, 6105, 6108, 6101, 5321, 5323, 6109, 6125, 6126, 6026, 6128, 6135, 6136, 6142, 6127, 6141, 3562, 6143, 6148, 6149, 3565, 6155, 6150, 6167, 3568, 6160, -2992, 6171, 6273, 6274, 6164, 6165, 6179, 6181, 3775, 793, 6187, 6200, 2607, 2608, 2609, 2610, 2611, 2612, 6207, 3775, 6209, 1410, 2880, 3587, 5899, 6095, 6225, 6226, 1410, 6217, 6227, 6096, 4579, 946, 946, 6245, 946, 6264, 6265, 6268, 6243, 6262, 4061, 6263, 6280, 6266, 6276, 6289, 5651, 6284, 959, 6290, 6291, 5686, 6302, 6304, 6322, 3629, 6334, 6336, 6328, 6337, 6332, 6329, 6333, 959, 6346, 6351, 2648, 6033, 6349, 6035, 6369, 2649, 6370, 1105, 6372, 6374, 6373, 6371, 6399, -2002, 6401, 6402, 6389, 6410, 6414, 4308, 6294, 6427, 6435, 6428, 6416, 6443, 6444, 6447, 1410, 6449, 6453, 6455, 6460, 6458, 6466, 5894, 5774, 1481, 3013, 4054, 1589, 2062, 3786, 3703, 651, 3688, 4383, 4964, 4957, 1150, 6210, 2854, 3827, 3875, 4530, 5698, 2651, 6078, 6303, 5106, 2015, 5750, 4953, 4954, 5444, 5732, 4363, 4326, 4022, 6202, 5635, 6299, 3717, 6100, 6098, 3930, 6224, 6314, 3726, 4369, 5473, 5128, 6055, 5157, 5136, 5098, 6058, 3893, 959, 3894, 3952, 4962, 3736, 4590, 4401, 5123, 5738, 4630, 5467, 1105, 1679, 5181, 3749, 5979, 6366, 6465, 6445, 5713, 3754, 4536, 5165, 6229, 5658, 5885, 2652, 3080, 871, 6067, 5661, 757, 6079, 810, 5198, 5861, 793, 1080, 4681, 871, 3767, 5200, 1004, 6362, 3922, 3143, 3770, 3555, 5167, 2035, 4317, 3491, 3139, 3778, 3155, 5775, 4647, 5973, 1191, 3172, 1151, 4500, 4993, 3824, 4447, 6249, 4280, 3793, 6400, 1426, 2770, 3852, 5184, 3038, 3500, 5185, 5324, 6352, 1004, 4881, 5857, 3819, 5860, 852, 2657, 653, 853, 5478, 6052, 5229, 2718, 5657, 1105, 1410, 2630, 6184, 4278, 2717, 4290, 3510, 6036, 4833, 2722, 1410, 2714, 4251, 1410, 4849, 5592, 1410, 1410, 1410, 5827, 4244, 5826, 4245, 4882, 6387, 5655, 957, 6170, 6282, 957, 2654, 6025, 4246, 6413, 5809, 4783, 6037, 4213, 922, 969, 969, 1410, 1410, 2666, 3422, 1410, 3425, 6038, 3340, 4207, 3851, 4079, 5991, 4205, 969, 6418, 4114, 969, 4198, 4732, 3437, 1410, 0, 1477, 0, 1410, 0, 3498, 0, 0, 5700, 1410, 0, 0, 0, 3495, 0, 0, 0, 5312, 0, 0, 1410, 0, 5610, 0, 0, 1150, 0, 0, 0, 0, 0, 0, 0, 4928, 0, 0, 1410, 0, 0, 0, 0, 0, 0, 0, 0, 969, 0, 0, 0, 969, 969, 0, 0, 0, 0, 0, 0, 0, 4329, 0, 0, 0, 0, 0, 0, 4928, 1006, 959, 0, 959, 0, 0, 0, 0, 2603, 0, 0, 3491, 5613, 0, 0, 0, 0, -2992, -2992, -2992, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 6431, 0, 0, 3491, 0, 0, 0, 970, 1006, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 3491, 0, 653, 979, 0, 0, 0, 0, 0, 4390, 653, 4392, 979, 653, 0, 0, 0, 970, 0, 0, 0, 0, 0, 4037, 0, 0, 979, 0, 0, 5097, 0, 0, 0, 0, 871, 0, 0, 0, 0, 871, 0, 0, 0, 0, 0, 0, 4056, 5765, 2854, 0, 0, 0, 2143, 4037, 0, 2144, 0, 0, 871, 2145, 2146, 2147, 5146, 0, 0, 5752, 5894, 0, 0, 6446, 0, 0, 0, 0, 0, 0, 959, 871, 4928, 0, 0, 0, 6408, 0, 0, 0, 0, 2645, 0, 0, 0, 6354, 0, 0, 2646, 793, 81, 84, 72, 176, 188, 192, 85, 0, 86, 185, 0, 181, 87, 107, 125, 0, 1410, 0, 130, 182, 160, 0, 0, 179, 2647, 0, 0, 793, 0, 0, 186, 0, 0, 1410, 0, 5737, 184, 1410, 0, 1410, 0, 793, 0, 934, 6390, 6408, 3491, 6355, 6356, 0, 0, 0, 793, 1410, 0, 0, 0, 0, 0, 4495, 0, 651, 0, 0, 1410, 4502, 5763, 0, 5835, 0, 6408, 1592, 0, 0, 188, 1410, 0, 1593, 0, 0, 187, 0, 1410, 3494, 0, 0, 0, 3494, 0, 0, 0, 0, 1698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3299, 1150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1595, 871, 0, 3491, 0, 0, 1228, 1229, 1410, 3352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 1410, 2649, 0, 0, 0, 0, 1410, 1410, 0, 0, 0, 959, 959, 959, 959, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2992, -2992, 1004, 0, 0, 0, 0, 1699, 1592, 1596, 0, 0, 0, 0, 1593, 0, 1597, 0, 1410, 0, 1598, 0, 3494, 0, 0, 0, 651, 0, 2651, 1698, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 793, 0, 1599, 0, 0, 871, 0, 0, 3495, 0, 0, 0, 0, 1595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2992, 0, 0, 0, 0, 0, 0, 0, 871, 0, 4664, 0, 4666, 1600, 4668, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 793, 0, 0, 0, 0, 0, 0, 0, 1410, 0, 0, 0, 0, 0, 0, 1699, 0, 1596, 0, 3491, 1410, 0, 0, 0, 1597, 0, 0, 4331, 1598, 1410, 1410, 1410, 0, 0, 0, 2015, 0, 0, 0, 0, 0, 3812, 0, 0, 1410, 5952, 0, 0, 0, 0, 0, 0, 0, 1410, 3381, 1410, 1599, 1410, 5610, 0, 0, 3307, 3307, 0, 4928, 1700, 0, -2757, 0, 1602, 0, 1410, 0, 0, 0, 0, 3334, 0, 0, 1603, 2015, 0, 1006, 0, 2654, 3355, 0, 0, 0, 1604, 1410, 0, 1600, 979, 0, 0, 0, 0, 0, 0, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 0, 0, 0, 0, 979, 0, 0, 0, 0, 0, 0, 0, 2015, 2015, 3491, 0, 979, 0, 0, 0, 0, 0, 4416, 6206, 0, 0, 0, 0, 0, 0, 1701, 0, 979, 1607, 1608, 6040, 0, 653, 3494, 3494, 0, 0, 922, 959, 0, 0, 653, 979, 0, 0, 0, 0, -2757, 653, 0, 979, 653, 6121, 1700, 0, 0, 0, 1602, 0, 0, 1702, 0, 0, 922, 979, 0, 0, 1603, 0, 0, 0, 2603, 0, 0, 979, 0, 0, 1604, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 1605, 0, 6256, 6257, 0, 650, 0, 0, 0, 0, 0, -2757, 0, 0, 1410, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2757, 0, 0, 3491, 0, 1410, -2757, 0, 0, 5835, 0, 0, -2757, 979, 0, 1410, 0, 0, -2757, 3783, 1610, -2757, 1607, 1608, 3544, -2757, 0, 0, 793, 979, 0, 0, 0, 0, 793, 4511, 0, 0, 0, 793, 0, 0, 0, 970, 0, 0, 0, 0, 0, 0, 653, 653, 0, 0, 3784, -2757, 0, 0, 959, 0, 0, 0, 0, 0, 0, 2015, 5394, 5395, 0, 0, 0, 5398, 5399, 0, 979, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2757, 0, 0, 2854, 0, 0, 0, 0, 0, 0, 1410, 957, 922, 0, 969, 0, 969, 969, 0, 0, 4928, 0, 0, 0, 0, 0, 0, 0, 970, 970, 6259, 0, 0, 0, 1410, 653, 0, 0, 0, 1610, 192, 0, 0, 0, 0, 0, 6251, 0, 979, 0, 0, -2757, 0, 0, 6252, -2757, 0, 2015, 2015, 6275, 0, -2757, 0, 0, 0, 1410, 1410, 0, 3381, 1410, 0, 6253, 6283, 0, 3494, 0, 0, 0, 0, 0, 0, 3494, 0, 0, 3491, 0, 3494, 0, 0, 3494, 6230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 959, 6327, 3483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6254, 0, 0, 0, 0, 0, 0, -2757, 0, 0, 0, 3011, 0, 0, 0, 6121, 959, 959, 0, 0, 0, 4928, 0, 0, 0, 0, 0, 0, 0, 0, 4683, 0, 188, 0, 4687, 0, 0, 0, 192, 651, 0, 653, 653, 1832, 6251, 0, 1410, 0, 0, 0, 979, 0, 6252, 0, 6345, 653, 0, 0, 0, 0, 922, 653, 1410, 0, 0, 653, 808, 653, 3544, 6253, 0, 922, 0, 4301, 0, 0, 0, 0, 0, 3491, 1410, 0, 0, 6456, 6457, 3491, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, -2757, 0, 0, 0, 0, 0, -2774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6254, 0, 0, 6375, 6376, 651, 6380, -2757, 0, -2757, -2757, 5835, 0, 0, 0, 0, 1410, 0, 653, 0, 653, 653, 0, 0, 0, 0, 959, 0, 0, 4928, 0, -2757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 6345, 0, -2757, 6251, 0, -2757, -2757, -2757, 0, 1162, 0, 6252, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1410, 651, 0, 6253, 0, 0, 0, 0, 0, 0, 1162, 0, 0, 650, -2774, 653, 0, 651, 0, 3491, 0, 0, 0, 0, 0, 0, 5188, 0, 0, 5190, 0, 0, 0, 0, 970, 970, 0, 3512, 6459, 0, 6345, 0, 0, 0, 0, 0, 0, 6254, 979, 0, 0, 0, 0, 0, 0, 0, 0, 6345, 0, 5206, 0, 3494, 0, 979, 0, 0, 0, -2774, 0, 0, 0, 0, 0, 979, 979, 0, 0, 922, 1592, 979, -2774, 793, 0, 0, 1593, 0, -2774, 0, 0, 0, 0, 0, -2774, 0, 0, 979, 0, 0, -2774, 1594, 979, -2774, 0, 0, 0, -2774, 0, 0, 0, 0, 0, 0, 653, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 1595, 0, 0, 0, 0, 0, -2774, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 4910, 0, 0, 653, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2774, 957, 0, 0, 969, 0, 969, 969, 0, 0, 0, 0, 0, 0, 2647, 653, 653, 653, 1596, 653, 0, 0, 0, 0, 0, 1597, 0, 0, 0, 1598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2774, 0, 0, 0, -2774, 0, 1599, 0, 0, 0, -2774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 3494, 0, 0, 720, 0, 0, 0, 0, 3261, 0, 0, 653, 0, 0, 0, 0, 0, 0, 5343, 1600, 3494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1832, 0, 0, 0, 0, 0, 0, 0, -2774, 0, 5035, 0, 3494, 5038, 0, 0, 0, 653, 2648, 723, 3262, 653, 653, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5381, 5382, 724, 653, 0, 0, 0, 1853, 0, 922, 0, 0, 2650, 2337, 0, 0, 0, 0, 1862, 0, 1064, 0, 0, 2143, 0, 1601, 2144, 0, 0, 1602, 2145, 2146, 2147, 808, 1870, 0, 0, 0, 0, 1603, 2651, 0, 0, 0, 3263, 0, 0, 0, 2644, 1604, 0, 0, 0, 0, 0, 0, 0, 727, 2645, 0, 0, 1605, 0, -2774, 0, 2646, 728, 0, 793, 0, 0, 650, 0, 0, 650, 0, 0, 922, 0, 729, 5120, 0, 0, 2404, 0, 3264, 0, -2774, 0, -2774, -2774, 2647, 0, 0, 5425, 5426, 0, 3011, 2652, 0, 0, 2653, 0, 0, 1606, 0, 0, 1607, 1608, 0, 0, -2774, 1067, 0, 0, 0, 0, 0, 922, 0, 3494, 0, 650, 0, 0, 0, 0, 0, 0, 0, 650, -2774, 0, 2135, -2774, -2774, -2774, 0, 0, 1609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3265, 922, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 733, 0, 0, 0, 0, 0, 4037, 0, 0, 2135, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 2654, 0, 0, 0, 3494, 2646, 0, 0, 0, 0, 3381, 0, 0, 0, 2648, 0, 2064, 1610, 0, 2649, 979, 0, 0, 0, 0, 0, 4211, 0, 0, 5519, 0, 2647, 5521, 5522, 0, 653, 653, 653, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5527, 0, 0, 0, 0, 214, 3266, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6076, 0, 0, 0, 4243, 0, 0, 4249, 0, 1071, 1592, 0, 3267, 0, 0, 0, 1593, 0, 0, 742, 0, 0, 0, 0, 0, 2603, 743, 0, 0, 744, 0, 0, 2404, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 2652, 0, 745, 2653, 4106, 0, 0, 979, 3483, 0, 1073, 0, 933, 0, 1595, 0, 3483, 747, 0, 922, 1074, 2648, 0, 0, 0, 749, 2649, 0, 3334, 3334, 922, 0, 0, 3334, 0, 0, 0, 0, 0, 3494, 3268, 0, 1832, 0, 0, 0, 922, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 754, 0, 0, 0, 1596, 0, 979, 3334, 3334, 0, 2651, 1597, 0, 0, 979, 1598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1562, 0, 0, 0, 2654, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 653, 1599, 0, 653, 0, 0, 922, 0, 0, 922, 922, 2404, 0, 653, 653, 0, 979, 979, 0, 0, 1563, 0, 0, 0, 0, 0, 2652, 0, 653, 2653, 979, 653, 0, 0, 0, 0, 5391, 1600, 0, 3494, 922, 922, 0, 979, 979, 0, 0, 0, 5401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 1564, 0, 653, 653, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 4122, 1700, 0, 4123, 1565, 1602, 0, 2654, 0, 0, 0, 0, 3972, 0, 0, 1603, 0, 0, 0, 0, 2903, 0, 0, 0, 0, 1604, 653, 0, 653, 0, 3494, 0, 0, 653, 653, 0, 1562, 1605, 0, 0, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 0, 1566, 0, 653, 0, 653, 0, 653, 653, 653, 653, 653, 653, 0, 0, 653, 0, 653, 653, 1563, 0, 653, 0, 0, 0, 0, 0, 1728, 0, 0, 1607, 1608, 0, 0, 0, 922, 653, 653, 653, 0, 0, 1592, 0, 0, 0, 1568, 0, 1593, 0, 0, 0, 0, 0, 0, 653, 0, 1832, 0, 0, 0, 2603, 0, 1729, 0, 0, 0, 0, 5863, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 1570, 0, 0, 0, 1564, 0, 0, 4124, 1532, 0, 0, 0, 0, 719, 1595, 0, 0, 2143, 0, 4037, 2144, 0, 807, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1565, 2644, 5900, 0, 0, 36, 0, 2831, 0, 0, 1572, 2645, 0, 0, 0, 0, 1610, 0, 2646, 1573, 0, 0, 0, 0, 0, 0, 0, 3494, 1574, 0, 1596, 0, 0, 6406, 0, 0, 2832, 1597, 0, 188, 0, 1598, 0, 0, 2647, 3973, 0, 0, 0, 1576, 1566, 0, 0, 0, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 1578, 0, 0, 0, 0, 0, 1599, 0, 2143, 3042, 0, 2144, 188, 0, 0, 2145, 2146, 2147, 0, 653, 3053, 0, 0, 0, 0, 0, 0, 0, 0, 6406, 0, 1568, 0, 2644, 0, 0, 3071, 0, 0, 0, 0, 0, 1600, 2645, 4037, 0, 4037, 0, 0, 0, 2646, 0, 5990, 0, 6406, 0, 0, 1579, 0, 0, 0, 0, 0, 0, 1570, 650, 0, 0, 0, 650, 0, 0, 1532, 653, 3494, 0, 2647, 0, 0, 0, 3494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3145, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 3157, 0, 0, 1162, 3161, 36, 0, 0, 0, 0, 3974, 0, 0, 0, 0, 0, 0, 1700, 0, 1573, 0, 1602, 2650, 2337, 653, 0, 0, 0, 1574, 0, 0, 1603, 0, 0, 3180, 1162, 2832, 0, 0, 0, 0, 1604, 0, 0, 0, 0, 0, 0, 0, 1576, 2651, 0, 0, 1605, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 1578, 0, 0, 0, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3975, 0, 0, 0, 0, 2648, 0, 0, 0, 2404, 2649, 0, 3494, 0, 0, 1607, 1608, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 2650, 2337, 0, 1579, 0, 0, 2135, 3976, 0, 0, 0, 0, 0, 0, 1609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3483, 0, 0, 0, 3483, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 2404, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 3367, 0, 0, 0, 0, 2652, 1610, 2654, 2653, 2644, 653, 653, 653, 653, 653, 653, 653, 653, 653, 2645, 653, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 653, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3307, 0, 0, 653, 0, 2647, 0, 653, 0, 0, 653, 0, 653, 0, 0, 653, 0, 0, 0, 653, 0, 0, 3334, 3334, 3334, 3334, 0, 0, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 0, 0, 1832, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 650, 650, 2654, 4779, 0, 0, 653, 0, 0, 0, 0, 0, 0, 2603, 0, 653, 653, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 4175, 3334, 3334, 0, 979, 0, 0, 0, 0, 0, 0, 922, 0, 6297, 0, 922, 922, 0, 0, 0, 0, 0, 979, 0, 0, 0, 979, 0, 0, 0, 979, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 979, 0, 0, 0, 0, 4838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 0, 653, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 653, 2603, 922, 653, 0, 653, 653, 0, 922, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2651, 979, 1592, 3972, 3363, 0, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 979, 0, 0, 0, 0, 0, 0, 1562, 0, 1081, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1595, 0, 0, 1832, 979, 2652, 0, 1832, 2653, 0, 1563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1149, 719, 0, 0, 3483, 979, 0, 1832, 0, 0, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 0, 0, 0, 188, 1596, 979, 0, 0, 979, 0, 650, 1597, 0, 0, 979, 1598, 0, 650, 0, 0, 1564, 0, 650, 0, 0, 650, 5308, 0, 0, 0, 0, 0, 0, 0, 979, 0, 0, 0, 0, 0, 979, 0, 0, 1599, 0, 0, 0, 979, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 1565, 0, 0, 0, 979, 0, 0, 0, 0, 0, 0, 0, 1248, 1251, 0, 1149, 1254, 0, 979, 0, 0, 0, 1600, 1832, 0, 0, 0, 1268, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3973, 1289, 653, 653, 653, 1566, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4037, 1592, 0, 0, 0, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 653, 922, 0, 0, 0, 0, 0, 0, 0, 1832, 0, 0, 0, 0, 1568, 0, 3334, 0, 2603, 0, 0, 0, 1700, 0, 0, 0, 1602, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 1603, 0, 1595, 0, 4116, 0, 653, 0, 0, 2143, 1604, 1570, 2144, 0, 0, 0, 2145, 2146, 2147, 1532, 0, 0, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 922, 0, 0, 0, 922, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 3483, 0, 0, 0, 36, 3483, 1596, 0, 3483, 1572, 0, 0, 2814, 1597, 0, 1607, 1608, 1598, 1573, 0, 0, 0, 0, 0, 2647, 0, 0, 1574, 0, 188, 188, 0, 0, 0, 0, 2832, 0, 0, 0, 0, 0, 0, 5450, 0, 0, 1599, 0, 2815, 1576, 0, 0, 0, 0, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 1578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 650, 0, 979, 0, 1832, 0, 0, 0, 1600, 0, 3975, 0, 0, 1149, 0, 0, 0, 0, 0, 0, 0, 979, 0, 922, 0, 979, 0, 0, 3603, 0, 0, 0, 979, 0, 3611, 0, 653, 0, 922, 653, 0, 653, 653, 922, 0, 0, 1579, 1610, 0, 0, 3976, 653, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 922, 2649, 0, 0, 0, 0, 3653, 0, 0, 0, 0, 5258, 0, 0, 0, 1601, 0, 0, 0, 1602, 0, 0, 1592, 0, 2650, 2337, 0, 0, 1593, 1603, 0, 0, 653, 653, 653, 1659, 0, 653, 0, 1604, 0, 0, 0, 0, 0, 653, 653, 653, 653, 0, 0, 1605, 2651, 0, 0, 0, 1832, 1660, 0, 0, 0, 653, 1832, 0, 653, 0, 653, 0, 0, 0, 0, 0, 0, 1595, 0, 0, 0, 0, 653, 653, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2896, 2404, 0, 1607, 1608, 0, 0, 0, 0, 653, 0, 653, 0, 653, 650, 1661, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 650, 2897, 1596, 2040, 0, 0, 0, 0, 0, 1597, 0, 0, 1149, 1598, 0, 0, 0, 0, 2050, 2051, 188, 0, 1149, 1149, 0, 0, 0, 0, 0, 0, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 1149, 0, 0, 0, 653, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 969, 0, 653, 0, 0, 1662, 1610, 653, 0, 1600, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 3880, 0, 653, 0, 0, 0, 0, 1592, 0, 0, 0, 0, 0, 1593, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 969, 1592, 0, 0, 0, 0, 0, 1593, 0, 0, 0, 922, 0, 0, 922, 0, 922, 0, 0, 0, 0, 922, 0, 1663, 0, 2139, 0, 0, 1664, 0, 0, 0, 0, 1595, 2141, 0, 979, 979, 0, 0, 0, 0, 653, 0, 1665, 0, 0, 0, 1602, 0, 2628, 0, 1595, 0, 0, 0, 0, 979, 1603, 0, 979, 650, 0, 922, 0, 0, 0, 0, 1604, 0, 0, 922, 2603, 0, 0, 0, 3483, 0, 0, 1666, 1605, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 1596, 0, 0, 0, 4532, 0, 922, 1597, 0, 0, 0, 1598, 653, 0, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 0, 1597, 0, 0, 0, 1598, 0, 0, 1667, 0, 0, 1607, 1608, 1668, 1599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 650, 1832, 1832, 1832, 0, 0, 0, 0, 1599, 0, 0, 0, 1669, 0, 0, 0, 0, 0, 1670, 4055, 0, 0, 0, 0, 0, 1600, 979, 0, 0, 0, 0, 0, 0, 1671, 4065, 922, 0, 922, 0, 4070, 0, 0, 0, 0, 1600, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 4096, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 1610, 0, 0, 3334, 188, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 1700, 0, 0, 0, 1602, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 1603, 0, 0, 0, 0, 1700, 0, 188, 0, 1602, 1604, 0, 0, 0, 922, 0, 5935, 0, 0, 1603, 0, 188, 1605, 0, 0, 2647, 0, 3334, 0, 1604, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 0, 1605, 0, 653, 650, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 2963, 0, 0, 3639, 0, 0, 1607, 1608, 2971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3830, 1832, 922, 1607, 1608, 0, 0, 979, 0, 979, 0, 0, 0, 0, 0, 0, 1609, 0, 0, 0, 0, 0, 979, 0, 979, 0, 0, 2135, 0, 0, 0, 0, 0, 0, 0, 3831, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 650, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 1610, 0, 979, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1610, 0, 0, 0, 0, 0, 922, 2651, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 979, 0, 0, 0, 979, 2645, 2404, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 3483, 4334, 188, 0, 2652, 0, 0, 650, 0, 4337, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 653, 0, 3334, 922, 3101, 0, 0, 0, 3106, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 653, 653, 653, 0, 0, 0, 3334, 653, 0, 0, 653, 0, 0, 653, 0, 0, 0, 0, 0, 653, 0, 653, 0, 0, 653, 0, 0, 0, 922, 653, 653, 653, 653, 0, 0, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 0, 0, 2654, 653, 653, 653, 0, 188, 922, 0, 0, 0, 969, 653, 4433, 0, 4435, 0, 653, 0, 1832, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 653, 0, 653, 0, 0, 0, 0, 2648, 0, 0, 1592, 0, 2649, 0, 0, 0, 1593, 0, 653, 0, 0, 653, 653, 0, 0, 0, 653, 653, 0, 0, 0, 653, 0, 653, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 3243, 650, 0, 0, 0, 0, 3245, 0, 0, 969, 969, 0, 0, 0, 0, 0, 653, 0, 1595, 0, 2651, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 0, 2603, 0, 653, 0, 4496, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 3293, 0, 0, 0, 0, 1562, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 1596, 0, 0, 2652, 0, 4518, 2653, 1597, 0, 653, 0, 1598, 0, 0, 0, 922, 0, 0, 1563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 650, 0, 0, 1599, 0, 979, 650, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3334, 6331, 0, 0, 0, 653, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 1600, 0, 2145, 2146, 2147, 0, 1564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 2654, 3653, 0, 1832, 0, 2645, 921, 0, 1832, 922, 1832, 0, 2646, 0, 0, 0, 0, 188, 1565, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 1832, 922, 2647, 6378, 0, 0, 188, 0, 0, 4660, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 1700, 0, 2645, 0, 1602, 0, 0, 0, 650, 2646, 0, 0, 0, 1566, 1603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1604, 0, 0, 979, 0, 0, 979, 0, 0, 0, 0, 2647, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 1567, 6378, 0, 0, 1568, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 6442, 0, 0, 4719, 0, 4718, 0, 0, 0, 4347, 0, 0, 1607, 1608, 0, 0, 0, 969, 969, 1650, 1570, 0, 0, 0, 653, 0, 0, 6169, 1532, 0, 6326, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 1592, 0, 0, 4348, 0, 0, 1593, 0, 0, 979, 979, 0, 0, 922, 0, 0, 4750, 0, 2650, 2337, 979, 1651, 0, 0, 0, 36, 0, 653, 653, 0, 1572, 0, 0, 0, 0, 0, 0, 979, 0, 1573, 0, 4771, 2648, 0, 0, 0, 2651, 2649, 1574, 0, 0, 1595, 0, 0, 0, 0, 1652, 0, 0, 0, 922, 0, 0, 0, 0, 922, 653, 653, 0, 1576, 2650, 2337, 0, 0, 0, 0, 1610, 653, 1577, 0, 0, 0, 0, 1578, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 1596, 0, 188, 0, 0, 0, 0, 1597, 0, 0, 979, 1598, 0, 1832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3334, 3334, 0, 0, 3334, 0, 1579, 2404, 0, 0, 0, 0, 0, 1599, 653, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 653, 0, 922, 0, 0, 0, 653, 653, 0, 0, 0, 653, 0, 0, 0, 0, 653, 0, 0, 653, 653, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1700, 0, 0, 0, 1602, 0, 653, 0, 0, 0, 0, 0, 0, 653, 1603, 0, 0, 0, 653, 0, 0, 653, 653, 0, 1604, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 1605, 0, 0, 0, 653, 0, 0, 0, 2603, 0, 0, 0, 653, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 4792, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 4418, 0, 0, 1607, 1608, 0, 0, 0, 0, 979, 0, 0, 0, 0, 653, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 4419, 0, 0, 0, 4897, 0, 0, 0, 0, 0, 0, 1149, 0, 0, 922, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 979, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 979, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 653, 0, 0, 0, 2646, 0, 0, 653, 1254, 0, 0, 0, 0, 0, 1610, 0, 0, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 5109, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 653, 1254, 2145, 2146, 2147, 1832, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 979, 1254, 0, 0, 0, 0, 2645, 653, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 922, 0, 922, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 3818, 0, 0, 0, 3822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3855, 0, 3855, 0, 3855, 3855, 0, 653, 0, 3855, 3855, 3855, 0, 3855, 3855, 3855, 0, 653, 0, 0, 653, 0, 0, 653, 653, 653, 2404, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 919, 0, 2652, 0, 0, 2653, 0, 0, 0, 653, 653, 0, 2648, 653, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3932, 653, 0, 0, 0, 653, 0, 0, 0, 0, 0, 653, 2650, 2337, 0, 653, 0, 0, 0, 0, 0, 922, 653, 0, 0, 3960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 653, 0, 2651, 0, 659, 979, 0, 979, 0, 0, 708, 659, 0, 0, 0, 0, 760, 0, 659, 0, 0, 0, 0, 0, 659, 0, 5344, 828, 0, 653, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 882, 882, 0, 0, 0, 0, 0, 0, 922, 979, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 653, 0, 0, 0, 0, 0, 0, 1747, 0, 0, 0, 0, 0, 0, 5380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 1149, 5396, 921, 0, 0, 1832, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2654, 0, 0, 0, 4921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 5424, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 961, 0, 0, 0, 965, 0, 0, 0, 653, 0, 0, 0, 1008, 0, 0, 1010, 0, 0, 1015, 1016, 0, 1019, 0, 1022, 0, 653, 1028, 0, 1030, 653, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 720, 0, 0, 0, 0, 1060, 0, 653, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 653, 0, 0, 0, 0, 0, 0, 653, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5126, 1061, 0, 0, 0, 0, 0, 0, 0, 5508, 921, 0, 0, 0, 723, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1063, 0, 0, 0, 724, 0, 0, 653, 0, 0, 0, 0, 0, 922, 0, 0, 0, 0, 922, 922, 0, 0, 1064, 653, 0, 2143, 0, 0, 2144, 653, 653, 979, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 979, 1065, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 727, 2645, 0, 0, 0, 0, 653, 0, 2646, 728, 0, 0, 0, 0, 653, 0, 0, 1832, 0, 0, 0, 0, 729, 0, 0, 0, 0, 0, 1066, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1067, 0, 0, 0, 0, 910, 0, 4496, 0, 0, 0, 0, 0, 0, 0, 0, 922, 922, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 653, 1832, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 733, 653, 653, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 1832, 0, 0, 922, 0, 0, 0, 0, 653, 0, 653, 0, 653, 0, 0, 0, 0, 0, 0, 653, 2648, 0, 0, 0, 0, 2649, 653, 1069, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4406, 0, 0, 2753, 0, 0, 0, 0, 653, 0, 0, 2650, 2337, 0, 0, 0, 0, 736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 1070, 0, 0, 738, 912, 1832, 0, 0, 979, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4455, 1071, 0, 0, 1072, 0, 0, 0, 741, 0, 919, 742, 0, 2753, 0, 0, 0, 0, 743, 0, 0, 744, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 919, 0, 0, 2652, 0, 745, 2653, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 921, 0, 747, 0, 0, 1074, 0, 913, 1058, 0, 749, 0, 0, 0, 0, 0, 4498, 0, 1075, 1095, 751, 0, 0, 1099, 0, 1076, 0, 0, 653, 0, 1112, 1113, 0, 921, 1119, 0, 1123, 1124, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 1146, 754, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3855, 0, 0, 979, 0, 1159, 0, 0, 0, 0, 0, 0, 4529, 4529, 0, 0, 0, 653, 2654, 0, 0, 0, 4545, 0, 0, 0, 1187, 1149, 1189, 1149, 979, 0, 0, 198, 0, 0, 0, 0, 1205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1747, 1747, 1747, 0, 0, 0, 0, 0, 0, 0, 0, 2064, 0, 0, 0, 0, 2064, 2064, 0, 0, 919, 0, 0, 659, 653, 0, 0, 4600, 0, 0, 0, 0, 0, 0, 653, 0, 199, 0, 0, 0, 0, 0, 653, 653, 0, 0, 0, 0, 653, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 4636, 1149, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 2603, 202, 0, 653, 653, 0, 0, 653, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 203, 0, 0, 5240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 882, 921, 0, 0, 0, 0, 205, 0, 0, 979, 0, 0, 921, 0, 0, 0, 0, 0, 5974, 206, 0, 0, 0, 0, 0, 207, 0, 0, 921, 0, 0, 0, 208, 653, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 653, 6030, 921, 919, 0, 1553, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 921, 653, 919, 921, 921, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 211, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 921, 2644, 0, 0, 653, 0, 0, 0, 0, 922, 0, 2645, 0, 0, 0, 653, 0, 0, 2646, 0, 0, 0, 0, 0, 212, 0, 4793, 1731, 653, 0, 0, 0, 0, 0, 0, 1832, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 213, 1852, 0, 0, 0, 0, 0, 0, 0, 0, 214, 215, 0, 0, 216, 0, 1864, 0, 1865, 0, 0, 0, 653, 653, 0, 0, 0, 0, 1868, 0, 0, 0, 0, 0, 0, 1878, 0, 0, 0, 653, 0, 0, 217, 1832, 0, 218, 0, 910, 0, 219, 0, 0, 220, 0, 0, 0, 653, 653, 0, 221, 0, 0, 222, 0, 0, 0, 0, 0, 1832, 0, 1747, 0, 0, 910, 0, 0, 0, 0, 1930, 0, 1932, 0, 223, 0, 1747, 2049, 0, 1747, 0, 0, 224, 0, 0, 919, 0, 225, 0, 226, 0, 0, 227, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 2648, 921, 0, 0, 229, 2649, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, 0, 0, 659, 0, 659, 0, 659, 0, 659, 0, 659, 659, 659, 0, 0, 2651, 0, 659, 0, -136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 912, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 4, 4545, 0, 0, 0, 2404, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 5, 910, 0, 2652, 0, 0, 2653, 0, 0, 0, 6, 0, 4999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 5013, 0, 0, 5014, 10, 5015, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5055, 913, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 0, 3855, 0, 19, 0, 0, 3855, 2654, 0, 0, 0, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 882, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6386, 919, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 5160, 0, 0, 4545, 0, 25, 26, 0, 2603, 0, 0, 27, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 28, 0, 3035, 0, 919, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5203, 0, 0, 2812, 0, 0, 5210, 5210, 5210, 5210, 30, 5210, 5210, 5210, 5210, 5210, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 32, 0, 0, 0, 0, 0, 33, 34, 0, 35, 912, 0, 0, 0, 36, 0, 0, 0, 0, 0, 37, 0, 0, 38, 0, 0, 912, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, 2908, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 910, 0, 0, 0, 0, 1747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 5289, 0, 913, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 913, 0, 0, 48, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 51, 0, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 57, 0, 0, -136, 0, 0, 3551, 0, 0, 0, 2753, 3557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 921, 0, 919, 919, 0, 0, 921, 0, 0, 0, 0, 0, 0, 3039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 3075, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 5422, 5423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3855, 0, 3855, 3855, 3855, 0, 3140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 3178, -136, 3179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5474, 3188, 0, 3189, 0, 1, 0, 0, 0, 659, 0, 659, 0, 659, 0, 659, 2, 659, 3, 4, 910, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5502, 0, 919, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 912, 910, 0, 0, 0, 0, 7, 0, 8, 9, 0, 915, 0, 0, 0, 10, 0, 11, 0, 0, 0, 1747, 0, 0, 0, 0, 0, 0, 0, 3252, 12, 5210, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 912, 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 913, 0, 20, 0, 21, 2143, 0, 0, 2144, 0, 0, 22, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 23, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 2753, 2645, 0, 0, 2753, 0, 0, 24, 2646, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 2143, 0, 0, 2144, 2647, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 25, 26, 0, 0, 2645, 910, 27, 0, 0, 913, 0, 2646, 0, 4545, 0, 0, 910, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 2647, 0, 0, 29, 0, 913, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 3855, 0, 0, 0, 916, 0, 921, 0, 0, 5699, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 910, 0, 31, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 921, 910, 0, 32, 910, 910, 0, 0, 0, 33, 34, 0, 35, 0, 0, 0, 0, 36, 0, 2650, 2337, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 910, 910, 0, 0, 0, 40, 41, 0, 0, 0, 0, 912, 2651, 42, 0, 0, 0, 43, 0, 0, 2648, 0, 912, 0, 0, 2649, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 45, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 2652, 0, 918, 2653, 0, 0, 2651, 0, 47, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 49, 0, 0, 912, 0, 0, 0, 0, 0, 913, 0, 0, 0, 50, 0, 0, 0, 0, 912, 0, 913, 912, 912, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 913, 51, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 912, 912, 0, 0, 57, 0, 0, -136, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 910, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 913, 0, 1149, 0, 0, 0, 5910, 0, 0, 2645, 0, 0, 0, 0, 0, 913, 2646, 0, 913, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2753, 0, 0, 3557, 2647, 3557, 0, 0, 0, 0, 2753, 913, 913, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 921, 919, 919, 0, 2603, 0, 0, 0, 921, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5277, 0, 0, 0, 0, 0, 0, 2753, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 2603, 0, 2648, 0, 0, 0, 0, 2649, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5281, 0, 0, 0, 915, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 3547, 3548, 0, 919, 0, 0, 0, 921, 0, 921, 0, 0, 0, 0, 0, 915, 0, 0, 913, 3563, 3564, 2651, 3566, 3567, 0, 0, 1149, 0, 3570, 3571, 6082, 0, 6083, 0, 0, 0, 6089, 6090, 0, 0, 0, 0, 0, 3582, 0, 0, 0, 3585, 0, 0, 0, 3588, 3589, 0, 0, 3592, 3593, 0, 0, 0, 0, 0, 3598, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3613, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 3630, 0, 0, 0, 0, 3632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3638, 921, 0, 0, 3644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3654, 0, 0, 3658, 0, 3660, 3663, 3665, 0, 0, 0, 0, 3673, 3676, 0, 1747, 0, 0, 0, 0, 0, 1747, 3689, 0, 0, 0, 0, 0, 3699, 0, 921, 0, 3702, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3712, 3713, 915, 0, 0, 3718, 0, 0, 0, 0, 0, 3727, 3728, 2654, 3557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3737, 0, 0, 3738, 0, 0, 0, 0, 0, 0, 3750, 3751, 0, 0, 0, 0, 3755, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 3762, 0, 0, 3765, 0, 0, 0, 0, 3768, 0, 0, 0, 916, 0, 3771, 3772, 0, 0, 0, 0, 0, 0, 3780, 0, 0, 0, 3782, 0, 0, 921, 3789, 3790, 3791, 3792, 0, 3794, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3820, 3821, 3557, 3823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3833, 3834, 3835, 2603, 0, 0, 0, 919, 0, 0, 921, 919, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2143, 0, 0, 2144, 5549, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 915, 0, 0, 0, 0, 0, 1149, 2645, 3887, 0, 0, 915, 0, 0, 2646, 0, 3911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 3923, 0, 0, 0, 0, 2647, 0, 0, 0, 918, 0, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 910, 910, 0, 0, 919, 918, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 919, 3991, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 0, 0, 4005, 2143, 4007, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 919, 0, 910, 0, 921, 0, 0, 0, 910, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 6407, 0, 0, 0, 0, 0, 0, 2628, 910, 2647, 0, 6411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 912, 0, 915, 4072, 912, 912, 0, 6437, 0, 0, 0, 0, 2651, 0, 0, 0, 2143, 0, 918, 2144, 0, 6407, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 2644, 0, 0, 0, 0, 6407, 0, 916, 5289, 0, 2645, 0, 0, 0, 2404, 0, 0, 2646, 0, 912, 0, 0, 0, 916, 0, 912, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 2753, 0, 0, 0, 0, 2647, 0, 0, 913, 0, 2648, 0, 913, 913, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 913, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 919, 0, 0, 919, 3557, 919, 0, 0, 0, 0, 919, 910, 918, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 918, 0, 0, 0, 0, 0, 913, 0, 0, 3557, 2648, 2652, 0, 0, 2653, 2649, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 919, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 910, 919, 0, 0, 910, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5560, 0, 0, 0, 0, 2654, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 915, 2653, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 4332, 0, 0, 919, 0, 919, 0, 0, 0, 0, 0, 0, 0, 921, 0, 0, 0, 4339, 0, 0, 0, 4339, 0, 0, 0, 0, 4350, 4351, 4352, 915, 0, 1592, 0, 0, 910, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 1659, 0, 0, 0, 4364, 910, 0, 0, 0, 0, 910, 918, 0, 0, 0, 0, 3557, 0, 915, 0, 912, 2753, 1660, 0, 912, 0, 0, 4393, 4394, 4395, 4396, 0, 2603, 0, 913, 0, 0, 0, 1595, 2654, 910, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5570, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 4417, 0, 4421, 4422, 4423, 0, 0, 0, 0, 1661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 919, 1597, 0, 0, 0, 1598, 913, 0, 0, 0, 913, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 912, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 912, 0, 0, 0, 0, 912, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 1662, 5632, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 921, 912, 0, 916, 0, 0, 0, 4506, 0, 0, 0, 0, 0, 0, 0, 0, 4512, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 913, 919, 915, 0, 4522, 4523, 916, 0, 0, 4524, 0, 1663, 0, 0, 0, 913, 1664, 0, 915, 0, 913, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 4566, 1665, 0, 0, 0, 1602, 0, 0, 916, 0, 918, 0, 0, 0, 0, 1603, 0, 0, 0, 913, 0, 0, 0, 0, 0, 1604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1666, 1605, 0, 0, 0, 915, 0, 910, 0, 921, 910, 0, 910, 920, 0, 0, 4603, 910, 0, 0, 915, 4609, 0, 915, 915, 0, 0, 4615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 919, 918, 0, 3756, 0, 0, 1607, 1608, 1668, 0, 0, 0, 0, 915, 915, 0, 4654, 0, 910, 0, 0, 921, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 1669, 0, 0, 0, 0, 0, 3757, 0, 0, 0, 918, 921, 0, 4669, 0, 4670, 0, 0, 0, 910, 919, 1671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 912, 1610, 912, 0, 0, 921, 0, 912, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 910, 0, 910, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 2143, 0, 912, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 912, 0, 913, 0, 0, 913, 0, 913, 2645, 0, 0, 916, 913, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 916, 916, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 2647, 5506, 919, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 916, 916, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 912, 910, 912, 0, 0, 0, 918, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 4153, 0, 0, 919, 0, 0, 4154, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 919, 913, 0, 913, 4903, 918, 4904, 0, 918, 918, 0, 910, 912, 0, 0, 0, 0, 0, 921, 4911, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 4917, 0, 910, 0, 4920, 0, 0, 0, 918, 918, 0, 0, 0, 2143, 0, 4933, 2144, 0, 0, 2651, 2145, 2146, 2147, 0, 910, 912, 0, 0, 916, 0, 0, 0, 0, 0, 4959, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 4963, 912, 0, 2646, 0, 0, 3557, 0, 4967, 0, 2404, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 2647, 0, 0, 0, 5002, 0, 0, 0, 5006, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5016, 5017, 5018, 5019, 0, 910, 0, 919, 913, 0, 5023, 5024, 5025, 5026, 0, 0, 0, 912, 0, 5028, 5029, 0, 0, 920, 0, 5036, 5037, 0, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 0, 913, 0, 0, 912, 0, 0, 0, 0, 5054, 0, 0, 0, 5057, 5058, 5059, 5060, 0, 0, 919, 0, 0, 910, 0, 919, 0, 912, 0, 0, 0, 0, 0, 0, 918, 0, 4155, 0, 4339, 0, 3557, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 5080, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 913, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 913, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 912, 2646, 913, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5161, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2404, 0, 0, 0, 912, 4339, 0, 0, 0, 0, 0, 0, 5186, 0, 5187, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 912, 0, 921, 0, 0, 0, 0, 921, 921, 0, 913, 0, 0, 5202, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 915, 913, 0, 0, 915, 915, 2645, 2648, 0, 0, 0, 0, 2649, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 910, 0, 0, 0, 0, 920, 0, 0, 5506, 921, 915, 0, 0, 2651, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 971, 981, 920, 912, 0, 0, 0, 919, 971, 0, 981, 971, 2404, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 981, 0, 0, 2652, 921, 919, 2653, 0, 0, 0, 2603, 920, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5663, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 5345, 5346, 5347, 0, 0, 0, 5348, 5349, 5350, 5351, 0, 0, 0, 5353, 0, 0, 0, 0, 0, 0, 0, 913, 2650, 2337, 0, 0, 0, 0, 912, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 2654, 912, 910, 0, 0, 0, 0, 0, 0, 5386, 5387, 5388, 5389, 5390, 0, 5392, 5393, 0, 0, 0, 0, 916, 0, 0, 0, 916, 916, 5402, 5403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 2652, 910, 0, 2653, 0, 0, 0, 913, 5409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 916, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 920, 915, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 920, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 5665, 920, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5472, 0, 918, 0, 0, 0, 918, 918, 0, 0, 0, 0, 0, 915, 0, 0, 0, 915, 0, 0, 920, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 912, 0, 0, 920, 0, 0, 920, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 5523, 0, 913, 918, 920, 920, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 5529, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 918, 913, 5704, 0, 0, 0, 913, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 915, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 981, 0, 0, 0, 0, 915, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 912, 0, 0, 981, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 971, 981, 0, 910, 0, 0, 0, 971, 0, 981, 971, 0, 0, 0, 0, 921, 916, 0, 0, 0, 916, 0, 0, 981, 0, 5652, 0, 0, 0, 919, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 5662, 0, 0, 0, 0, 0, 5668, 5669, 0, 0, 0, 0, 0, 0, 0, 0, 5680, 0, 0, 0, 0, 0, 0, 5682, 0, 912, 0, 0, 0, 0, 0, 910, 0, 0, 0, 1747, 0, 0, 0, 0, 0, 981, 0, 918, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 981, 5734, 5735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5743, 2644, 5745, 0, 0, 0, 0, 912, 0, 0, 0, 2645, 916, 0, 0, 0, 0, 5759, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 912, 0, 981, 916, 0, 0, 0, 0, 0, 0, 0, 0, 913, 4339, 0, 2647, 918, 0, 0, 0, 918, 5793, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 919, 0, 0, 0, 0, 919, 919, 0, 0, 0, 915, 0, 0, 915, 0, 915, 910, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 981, 913, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 5849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5864, 0, 918, 0, 0, 0, 915, 0, 2648, 0, 0, 0, 0, 2649, 0, 958, 960, 918, 0, 963, 0, 0, 918, 0, 5881, 0, 0, 0, 0, 919, 0, 0, 0, 0, 913, 0, 2650, 2337, 0, 1021, 0, 0, 0, 0, 0, 0, 1031, 0, 0, 1834, 0, 0, 918, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 910, 971, 912, 0, 0, 971, 0, 971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 915, 0, 0, 0, 5941, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 916, 4339, 0, 916, 0, 916, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6021, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 912, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 2654, 916, 0, 2644, 0, 0, 0, 0, 915, 0, 0, 0, 0, 2645, 0, 0, 0, 6049, 0, 0, 2646, 0, 981, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 981, 910, 0, 0, 6071, 0, 0, 0, 0, 2647, 981, 981, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 981, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 918, 0, 918, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 6111, 0, 0, 915, 916, 2603, 916, 920, 0, 0, 0, 920, 920, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 915, 0, 6059, 0, 0, 2143, 0, 0, 2144, 0, 0, 918, 2145, 2146, 2147, 0, 0, 0, 0, 918, 913, 0, 915, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 2645, 0, 920, 2649, 918, 0, 0, 2646, 920, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 2650, 2337, 910, 910, 0, 0, 0, 2647, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6205, 0, 0, 0, 0, 0, 920, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6218, 916, 0, 918, 0, 918, 0, 0, 0, 0, 1834, 6228, 0, 0, 0, 0, 0, 2404, 0, 0, 913, 0, 0, 1091, 0, 1094, 0, 0, 1096, 916, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 915, 0, 0, 1122, 0, 0, 0, 0, 0, 1126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 915, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 912, 912, 0, 0, 0, 0, 0, 0, 916, 0, 2650, 2337, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 910, 0, 0, 2651, 0, 2654, 980, 0, 0, 6307, 0, 0, 0, 919, 0, 980, 0, 916, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 913, 0, 918, 0, 0, 913, 913, 0, 0, 0, 0, 0, 920, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 918, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 920, 6070, 0, 981, 920, 0, 0, 918, 0, 912, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 916, 0, 0, 0, 2654, 0, 0, 918, 0, 2143, 0, 913, 2144, 2644, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 2645, 0, 916, 0, 0, 0, 0, 2646, 0, 0, 0, 2644, 0, 0, 0, 915, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 6448, 0, 0, 1624, 1625, 915, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 918, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 920, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 1834, 6093, 0, 0, 1851, 0, 0, 0, 920, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 1863, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 918, 981, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 1885, 1886, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 0, 2650, 2337, 0, 0, 0, 1923, 915, 0, 0, 971, 971, 0, 981, 981, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 971, 0, 981, 971, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 981, 0, 0, 0, 0, 1961, 1963, 0, 0, 2651, 0, 0, 0, 915, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 916, 0, 971, 0, 0, 0, 971, 971, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 980, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 980, 918, 0, 0, 0, 0, 980, 0, 0, 0, 0, 1018, 0, 0, 0, 0, 0, 0, 980, 0, 2143, 0, 1037, 2144, 0, 0, 0, 2145, 2146, 2147, 910, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 980, 0, 0, 0, 0, 0, 2645, 0, 980, 0, 2654, 0, 0, 2646, 0, 0, 920, 0, 0, 920, 0, 920, 980, 0, 0, 0, 920, 0, 0, 0, 0, 2654, 980, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 915, 0, 918, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 916, 0, 918, 0, 920, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 916, 0, 0, 912, 0, 916, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 2603, 6313, 0, 0, 0, 0, 0, 0, 980, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 2648, 915, 6330, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 920, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 913, 0, 915, 0, 2651, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 918, 0, 0, 2652, 0, 0, 2653, 0, 2830, 0, 920, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2875, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 920, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2965, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 1057, 0, 2991, 2992, 2993, 2994, 1089, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 915, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 980, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 6388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 980, 0, 0, 0, 0, 980, 918, 0, 0, 916, 0, 0, 920, 0, 0, 2143, 0, 0, 2144, 3048, 3049, 980, 2145, 2146, 2147, 0, 980, 0, 0, 1834, 915, 0, 0, 0, 0, 3066, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 918, 1416, 0, 0, 0, 920, 0, 0, 0, 0, 3109, 3110, 3111, 3112, 1428, 0, 0, 0, 0, 0, 0, 0, 918, 0, 2647, 981, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 981, 0, 0, 0, 981, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 3186, 0, 971, 918, 971, 971, 3190, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 981, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 981, 0, 2644, 0, 1623, 0, 3502, 0, 0, 0, 0, 0, 2645, 2648, 0, 0, 0, 0, 2649, 2646, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 1834, 981, 0, 0, 1834, 2650, 2337, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 981, 0, 1834, 0, 2143, 2651, 981, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 916, 0, 0, 981, 0, 918, 0, 0, 0, 0, 981, 0, 2644, 981, 0, 0, 3503, 0, 0, 981, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 2404, 0, 0, 0, 0, 0, 0, 1883, 981, 0, 0, 0, 0, 0, 981, 2652, 0, 0, 2653, 0, 0, 981, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 1917, 1920, 1921, 0, 916, 920, 0, 0, 0, 0, 4784, 0, 0, 981, 0, 2648, 0, 0, 1834, 0, 2649, 0, 0, 0, 981, 0, 0, 0, 0, 0, 3378, 0, 0, 920, 0, 0, 915, 0, 0, 0, 0, 915, 915, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 2654, 918, 0, 0, 6158, 0, 0, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 1416, 0, 2649, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 980, 0, 0, 916, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 918, 2145, 2146, 2147, 0, 0, 915, 0, 1416, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 2644, 0, 0, 4081, 0, 0, 0, 0, 920, 0, 2645, 0, 0, 0, 0, 2603, 0, 2646, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 915, 0, 0, 2652, 0, 920, 2653, 0, 0, 2654, 920, 0, 0, 0, 0, 0, 0, 0, 2143, 980, 0, 2144, 981, 0, 1834, 2145, 2146, 2147, 0, 0, 0, 0, 6159, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 2644, 0, 981, 0, 0, 0, 0, 0, 918, 981, 2645, 1833, 0, 0, 0, 916, 971, 2646, 971, 971, 916, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3504, 0, 0, 980, 0, 0, 2638, 0, 0, 0, 0, 980, 2647, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 2648, 0, 2144, 0, 2603, 2649, 2145, 2146, 2147, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 2644, 0, 980, 980, 2650, 2337, 0, 0, 0, 0, 2645, 0, 0, 0, 1834, 0, 980, 2646, 0, 0, 1834, 0, 0, 0, 0, 2729, 0, 0, 0, 980, 980, 0, 2651, 0, 920, 0, 0, 0, 0, 0, 0, 916, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 2648, 0, 2603, 918, 918, 2649, 2404, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 2652, 0, 0, 2653, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 2842, 0, 0, 0, 0, 0, 0, 0, 0, 2871, 0, 0, 0, 3378, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 920, 0, 2909, 0, 0, 0, 0, 0, 2921, 2921, 0, 0, 2921, 2648, 0, 0, 0, 0, 2649, 0, 2404, 0, 0, 0, 0, 2939, 0, 0, 2942, 0, 0, 0, 0, 0, 0, 2652, 0, 918, 2653, 2654, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 920, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 2644, 920, 0, 4158, 0, 0, 0, 0, 0, 2995, 2645, 0, 0, 981, 981, 0, 0, 2646, 0, 0, 0, 0, 0, 3015, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 981, 2404, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 2654, 0, 0, 0, 0, 3612, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 920, 0, 0, 0, 4126, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 1834, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3037, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 3040, 0, 0, 0, 0, 0, 2654, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 2648, 981, 4090, 2603, 0, 2649, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 981, 0, 3084, 2921, 0, 2650, 2337, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3761, 0, 0, 3764, 0, 0, 3119, 0, 0, 0, 0, 0, 2651, 3132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 2404, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 981, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3193, 0, 0, 0, 0, 0, 3859, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3872, 0, 0, 0, 0, 0, 0, 0, 3881, 0, 0, 1834, 0, 0, 1416, 1416, 0, 981, 0, 981, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 981, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 3925, 0, 2145, 2146, 2147, 0, 0, 3251, 0, 0, 3253, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 2644, 3949, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 916, 0, 2646, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 920, 0, 2145, 2146, 2147, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 4004, 0, 4006, 2644, 0, 0, 4170, 0, 2143, 0, 0, 2144, 0, 2645, 0, 2145, 2146, 2147, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 2647, 0, 0, 0, 2646, 981, 0, 0, 0, 981, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 2647, 0, 0, 981, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4064, 0, 0, 0, 4163, 0, 0, 4071, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 980, 0, 0, 2648, 980, 0, 0, 0, 2649, 0, 0, 0, 2651, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 980, 0, 2650, 2337, 2648, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 2651, 0, 2650, 2337, 980, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 0, 980, 980, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 920, 0, 0, 0, 0, 920, 920, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1392, 1392, 0, 0, 2652, 1833, 980, 2653, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 2652, 1833, 0, 2653, 0, 980, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 980, 2654, 0, 0, 0, 0, 0, 980, 0, 0, 980, 0, 0, 0, 2644, 0, 980, 4791, 0, 0, 1392, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 981, 0, 0, 0, 980, 0, 0, 0, 0, 0, 980, 0, 0, 920, 0, 0, 2654, 980, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 2654, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 0, 1834, 0, 1834, 0, 0, 0, 0, 0, 2603, 920, 0, 4335, 4336, 0, 0, 4715, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1744, 1748, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 3436, 981, 0, 2648, 981, 0, 0, 0, 2649, 0, 3441, 0, 2603, 0, 0, 0, 0, 0, 1486, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 0, 1486, 1486, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 2143, 0, 0, 2144, 0, 2646, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 981, 981, 0, 0, 0, 1416, 0, 0, 2404, 0, 2644, 981, 0, 0, 0, 0, 2647, 0, 0, 0, 2645, 0, 0, 2652, 0, 0, 2653, 2646, 981, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 980, 0, 0, 0, 980, 2143, 0, 0, 2144, 0, 0, 980, 2145, 2146, 2147, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 2644, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 2645, 4519, 0, 0, 0, 0, 0, 2646, 0, 0, 2644, 0, 0, 981, 0, 0, 1834, 0, 0, 0, 2645, 0, 2614, 0, 2654, 0, 0, 2646, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 2087, 2648, 0, 0, 0, 0, 2649, 3657, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 5241, 0, 0, 3679, 0, 0, 0, 0, 0, 0, 2650, 2337, 1833, 0, 0, 0, 0, 0, 1833, 2648, 0, 0, 0, 2113, 2649, 3707, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 2132, 2133, 2134, 0, 2136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5249, 0, 0, 0, 0, 2603, 2651, 5247, 2621, 0, 0, 0, 2404, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 2648, 2652, 0, 0, 2653, 2649, 0, 0, 0, 0, 4672, 0, 0, 0, 0, 0, 3787, 3788, 0, 0, 2648, 5231, 0, 2404, 0, 2649, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2696, 0, 0, 2651, 2708, 2713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 2654, 2404, 0, 0, 0, 0, 0, 920, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 3913, 2404, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 2652, 2654, 0, 2653, 980, 980, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 981, 0, 0, 0, 2645, 0, 0, 980, 0, 0, 980, 2646, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 2614, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 2654, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2603, 0, 1833, 1833, 1833, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 0, 0, 5248, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 980, 0, 0, 2649, 0, 0, 0, 0, 2603, 0, 0, 1744, 1744, 1744, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2650, 2337, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 2143, 0, 2651, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 980, 0, 0, 0, 2646, 0, 2143, 2404, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 2647, 2644, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 2645, 0, 0, 2145, 2146, 2147, 1833, 2646, 0, 0, 0, 0, 980, 0, 980, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 5824, 0, 4224, 980, 0, 980, 0, 2645, 0, 2647, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 981, 0, 981, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 2614, 0, 0, 5077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 5079, 0, 0, 0, 0, 0, 0, 2648, 0, 2614, 0, 0, 2649, 3335, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 0, 0, 5807, 0, 2614, 2614, 2614, 971, 2614, 0, 0, 2650, 2337, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 0, 0, 0, 0, 2649, 980, 0, 0, 0, 980, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 0, 971, 0, 0, 2650, 2337, 0, 2648, 0, 2603, 980, 0, 2649, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 2404, 2651, 0, 0, 2650, 2337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 0, 3279, 0, 0, 0, 0, 0, 0, 2651, 0, 3296, 3296, 3296, 3296, 3306, 3312, 3296, 3315, 3296, 3296, 2404, 0, 0, 0, 3322, 0, 3323, 0, 3325, 0, 0, 3339, 3342, 3347, 0, 2652, 0, 0, 2653, 3356, 0, 0, 3361, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 3368, 3369, 3370, 0, 0, 0, 1833, 0, 0, 2652, 0, 0, 2653, 0, 0, 0, 0, 0, 3371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4439, 2654, 0, 0, 0, 0, 0, 0, 0, 0, 2921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 0, 2145, 2146, 2147, 0, 0, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 0, 0, 2654, 0, 0, 0, 0, 5619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3379, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 4570, 4571, 4572, 0, 0, 0, 0, 0, 0, 2603, 0, 0, 0, 0, 0, 0, 3398, 4581, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 2648, 0, 1833, 1834, 1833, 2649, 0, 0, 0, 0, 4606, 4608, 0, 0, 0, 4613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2337, 1833, 0, 3400, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5417, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5421, 0, 0, 0, 0, 0, 720, 980, 0, 0, 980, 721, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 981, 0, 2652, 0, 0, 2653, 722, 0, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5479, 0, 2614, 0, 0, 0, 725, 0, 0, 980, 980, 0, 0, 0, 2614, 0, 0, 0, 0, 2614, 980, 0, 0, 0, 0, 0, 671, 0, 0, 0, 726, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 727, 672, 0, 0, 0, 0, 0, 0, 2654, 728, 0, 0, 0, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 729, 3416, 0, 0, 673, 0, 730, 0, 0, 0, 0, 0, 1392, 731, 1744, 0, 0, 674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 981, 3371, 0, 732, -888, 3379, 0, 0, 3398, 0, 3400, 0, 0, 3450, 971, 0, 0, 0, 0, 0, 0, 0, 675, 980, 0, 0, 1833, 981, 676, 0, 0, 0, 0, 0, 0, 4823, 4824, 4825, 0, 0, 0, 0, 0, 0, 0, 0, 677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, 0, 0, 2603, 733, 0, 0, 2133, 2134, 679, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 0, 680, 0, 0, 0, 0, 0, 971, 971, 0, 681, 0, 0, 0, 682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 734, 0, 0, 0, 0, 0, 0, -1094, 0, 0, 0, 0, 0, 735, 0, 0, 0, 0, 0, 0, 5638, 0, 5640, 0, 0, 0, 0, 736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 737, 0, 3590, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 683, 981, 0, 0, 0, 0, 0, 0, 0, 0, -623, 0, 739, 0, 0, 740, 0, 0, 0, 741, 0, 0, 742, 0, 0, 0, 0, 0, 0, 743, 0, 0, 744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 745, 0, 684, 0, 0, 685, 0, 0, 746, 0, 0, 0, 0, 0, 0, 747, 0, 0, 748, 0, 0, 0, 0, 749, 0, 0, 0, 0, 0, 686, 0, 750, 0, 751, 0, 0, 0, 0, 752, 0, 980, 0, 0, 687, 0, 0, 0, 0, 0, 5764, 0, -473, 753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 754, 0, 0, 0, 0, 0, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, 0, 0, 0, 0, 0, -473, 0, 0, 690, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 980, 0, 691, 0, 0, 0, 0, 0, 0, 0, 692, 0, 0, 0, 0, 0, 0, -473, 0, 0, 693, 0, 694, 0, 695, 696, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 0, 0, 0, 0, 697, 0, 5090, 0, 0, 0, 0, 0, 698, 0, 0, 699, 0, 0, 700, 0, 0, 1834, 0, 0, 0, 0, 3845, 3846, 1744, 0, 0, -473, 3850, 0, 971, 971, 0, 0, 5122, 0, 0, 0, 0, 0, 0, 0, 1834, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3132, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 5896, 0, 5898, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 720, 0, 0, 0, 0, 2801, 0, 0, 5180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3193, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2802, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 723, 0, 0, 2614, 0, 0, 0, 0, 0, 2614, 0, 0, 2614, 0, 0, 0, 0, 724, 0, 2614, 2614, 0, 2614, 0, 0, 0, 0, 3335, 3335, 980, 4149, 0, 3335, 0, 0, 1064, 2614, 0, 0, 2614, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 2614, 2803, 0, 0, 0, 0, 0, 2614, 2614, 2614, 2614, 0, 0, 0, 727, 3335, 3335, 0, 2614, 0, 0, 0, 0, 728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 729, 2614, 0, 2614, 0, 0, 2804, 0, 0, 0, 2614, 2614, 2614, 2614, 2614, 2614, 2614, 2614, 2614, 2614, 0, 5284, 5285, 5286, 5287, 4077, 0, 0, 0, 0, 4083, 0, 0, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 0, 980, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2136, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 3347, 733, 3347, 3347, 0, 0, 0, 0, 0, 0, 0, 6107, 0, 0, 0, 0, 4173, 0, 6, 4176, 0, 4178, 980, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 0, 0, 0, 2805, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 4203, 0, 4206, 0, 4208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 14, 0, 0, 15, 0, 0, 0, 0, 0, 214, 2806, 0, 0, 738, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 2614, 0, 0, 5773, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1071, 21, 0, 2807, 0, 0, 0, 0, 22, 0, 742, 0, 0, 0, 0, 0, 0, 743, 0, 0, 744, 0, 0, 0, 0, 0, 23, 0, 0, 0, 6211, 0, 0, 0, 0, 0, 0, 0, 0, 4275, 745, 0, 0, 24, 2696, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 747, 0, 0, 1074, 2713, 0, 0, 0, 749, 0, 0, 0, 0, 0, 0, 0, 2808, 0, 0, 0, 0, 0, 0, 2809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 0, 27, 0, 754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 4325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6301, 0, 5501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5511, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 4360, 31, 0, 0, 0, 0, 0, 1122, 1122, 0, 0, 0, 980, 0, 0, 0, 32, 0, 0, 0, 0, 0, 33, 34, 0, 35, 980, 0, 0, 0, 36, 0, 0, 4644, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, 1833, 2614, 2614, 0, 42, 0, 2614, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 1122, 0, 48, 0, 0, 0, 1833, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, -136, 0, 0, 0, 1744, 0, 0, 0, 0, 0, 1744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 980, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5718, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4593, 0, 0, 0, 0, 2614, 0, 5748, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4149, 4149, 0, 0, 3335, 3335, 3335, 3335, 0, 0, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 4149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 980, 2614, 0, 2614, 0, 0, 4149, 4149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 980, 2614, 3335, 3335, 2614, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4716, 0, 0, 0, 0, 0, 0, 0, 0, 4720, 0, 0, 0, 0, 0, 0, 5872, 0, 0, 0, 0, 0, 0, 3296, 0, 0, 0, 4733, 3296, 3296, 0, 0, 0, 0, 3312, 0, 0, 4741, 0, 0, 4743, 0, 0, 0, 0, 0, 4745, 0, 4746, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4768, 4769, 4770, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3356, 0, 0, 0, 0, 0, 0, 2614, 4794, 0, 0, 4797, 0, 4799, 0, 0, 0, 0, 0, 0, 5948, 0, 980, 0, 0, 0, 0, 0, 0, 4803, 0, 0, 0, 0, 0, 0, 0, 4810, 4811, 0, 0, 0, 2614, 0, 4816, 0, 0, 0, 5970, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3335, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 2614, 0, 2614, 2614, 0, 0, 0, 0, 4149, 4149, 4149, 4149, 0, 0, 0, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 2614, 2614, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 5168, 5169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5176, 0, 0, 0, 2614, 0, 0, 2614, 0, 2614, 0, 0, 0, 2614, 0, 0, 4149, 4149, 0, 0, 2614, 2614, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5220, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 2696, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5262, 5264, 0, 0, 0, 0, 0, 5268, 5269, 0, 0, 0, 5270, 0, 0, 0, 0, 5271, 0, 0, 5274, 5275, 0, 0, 0, 0, 0, 5280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 0, 0, 0, 5328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 5407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 2614, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 5442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 3335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 2614, 0, 0, 0, 2614, 2614, 2614, 2614, 0, 0, 2614, 2614, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5548, 0, 0, 0, 0, 0, 5552, 5553, 5554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5567, 5568, 0, 0, 5569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5577, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 5589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 4149, 3335, 2614, 2614, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 2614, 2614, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 3335, 0, 0, 4149, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5797, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5876, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4149, 0, 5888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4149, 0, 3335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6005, 0, 0, 0, 0, 0, 0, 0, 0, 6012, 6012, 6012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6045, 2614, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3335, 3335, 0, 0, 3335, 0, 0, 0, 5607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 6235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4149, 4149, 0, 4149, 0, 0, 0, 0, 0, 6260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6012, 0, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 6347, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1738, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 1739, 0, 325, 326, 892, 328, 329, 1744, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 1740, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 1741, 0, 0, 0, 0, 0, 0, 1379, 1742, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 1211, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 0, 0, 0, 0, 1379, 5843, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 0, 0, 0, 0, 1379, 3337, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 0, 0, 0, 0, 1379, 4747, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 0, 0, 0, 0, 1379, 4813, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4252, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, -1838, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, -1838, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, -1838, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, -1838, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, -1838, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1838, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, -1838, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1479, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2739, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2740, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2742, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 2744, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 2836, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2739, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2740, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2742, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 2744, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 646, 647, 648, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 3968, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 3298, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 1211, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 1211, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 3343, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 3344, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 3345, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 3346, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2269, 245, 246, 247, 0, 0, 0, -2269, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, -2269, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2267, 245, 246, 247, 0, 0, 0, -2267, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, -2267, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 0, 0, 2084, 3272, 1379, 235, 0, 1295, 715, 0, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 1378, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2706, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 3298, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 3847, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 3344, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 3401, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2709, 2710, 0, 0, 0, 235, 0, 3517, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 4868, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 5251, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 5263, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 5597, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 5598, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 5599, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 5600, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 6009, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6010, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 6011, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6010, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 6011, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 1375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 5582, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3329, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3330, 3331, 0, 0, 0, 235, 0, 1295, 715, 3332, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, -2992, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6010, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 1319, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, -2992, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 0, 0, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, -2992, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 1346, 460, 461, 0, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1354, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, -2992, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 6011, 607, 608, 609, 0, 1364, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, -2992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1376, 1377, 0, 0, 0, 235, 0, 1295, 715, 1379, 1296, 1297, 1298, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1350, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3329, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3330, 3331, 235, 0, 1295, 715, 0, 1296, 1297, 3332, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3506, 3507, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3508, 3509, 235, 0, 1295, 715, 0, 1296, 1297, 3332, 776, 1299, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3329, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 1295, 715, 0, 1296, 1297, 0, 776, 1299, 0, 0, 0, 0, 0, 0, 3332, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 4778, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3329, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 1295, 715, 0, 1296, 1297, 0, 776, 1299, 0, 0, 0, 0, 0, 0, 3332, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1300, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 1304, 1305, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1320, 343, 344, 345, 346, 1321, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 1325, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 1347, 1348, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3329, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 1361, 599, 1362, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 4837, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3332, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 3478, 1338, 412, 413, 414, 415, 416, 417, 418, 3479, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3480, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 1211, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 3481, 646, 647, 648, 0, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3482, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 3478, 1338, 412, 413, 414, 415, 416, 417, 418, 3479, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3480, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 3481, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3482, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3926, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 3478, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3480, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 3481, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4923, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 972, 0, 1616, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 0, 0, 0, 6117, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 5903, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 972, 0, 0, 0, 0, 0, 0, 1617, 1618, 5904, 0, 0, 0, 0, 0, 0, 5905, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 3, 4, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 1211, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1051, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5654, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 45, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 1211, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 51, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2915, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2916, 2917, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1873, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1427, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3540, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4217, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2142, 0, 0, 0, 0, 0, 0, 2143, 0, 0, 2144, 0, 0, 4854, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 0, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 0, 0, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 0, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 0, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 0, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 0, 0, 2287, 2288, 2289, 2290, 0, 2291, 2292, 2293, 2294, 2295, 0, 2296, 2297, 2298, 2299, 2300, 0, 2301, 2302, 0, 2303, 2304, 2305, 0, 2306, 2307, 0, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 0, 2334, 0, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 0, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 0, 2382, 2383, 0, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 0, 2413, 2414, 2415, 0, 2416, 2417, 2418, 2419, 2420, 0, 2421, 2422, 2423, 2424, 0, 0, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 0, 2437, 2438, 2439, 2440, 2441, 2442, 0, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 0, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 0, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 0, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 0, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 0, 2579, 2580, 2581, 2582, 2583, 2584, 0, 2585, 0, 0, 0, 0, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 0, 2601, 2602, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 884, 0, 1616, 715, 0, 0, 0, 987, 776, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 888, 889, 275, 1763, 276, 277, 278, 279, 0, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 890, 891, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 892, 328, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 1782, 348, 1783, 349, 350, 351, 893, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 0, 1788, 0, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 0, 389, 390, 391, 392, 894, 895, 1792, 896, 1793, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 0, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 4537, 0, 459, 1799, 460, 461, 462, 463, 1800, 0, 465, 900, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 4538, 474, 475, 1804, 1805, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 0, 498, 0, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 904, 905, 1817, 1818, 596, 597, 0, 599, 0, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 0, 906, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 4539, 4540, 998, 999, 1000, 1001, 884, 0, 1616, 715, 0, 0, 0, 987, 776, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 888, 889, 275, 1763, 276, 277, 278, 279, 0, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 890, 891, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 892, 328, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 1782, 348, 1783, 349, 350, 351, 893, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 0, 1788, 0, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 0, 389, 390, 391, 392, 894, 895, 1792, 896, 1793, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 0, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 4994, 0, 459, 1799, 460, 461, 462, 463, 1800, 0, 465, 900, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 4538, 474, 475, 1804, 1805, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 0, 498, 0, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 904, 905, 1817, 1818, 596, 597, 0, 599, 0, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 0, 906, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 4539, 4540, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 991, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 992, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1108, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1109, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1174, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1175, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1176, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1856, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1857, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 3605, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 3606, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 656, 0, 0, 0, 0, 0, 0, 987, 0, 0, 0, 0, 0, 0, 988, 989, 990, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 5636, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 1750, 0, 0, 0, 0, 0, 0, 0, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 273, 274, 275, 1763, 276, 277, 278, 279, 280, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 327, 328, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1782, 348, 1783, 349, 350, 351, 352, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 364, 1788, 365, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1792, 395, 1793, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 420, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 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, 1799, 460, 461, 462, 463, 1800, 464, 465, 466, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 473, 474, 475, 1804, 1805, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 594, 595, 1817, 1818, 596, 597, 598, 599, 600, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 620, 621, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1829, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6085, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6087, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6214, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2739, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2740, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 2741, 476, 477, 2742, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 2744, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 3963, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2745, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2739, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2740, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 2741, 476, 477, 2742, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 2744, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 972, 0, 1616, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 0, 0, 2745, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2056, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 1616, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 1617, 1618, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2061, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 1616, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 1617, 1618, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 3572, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 1616, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 1617, 1618, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 776, 0, 0, 0, 0, 1617, 1618, 0, 0, 236, 237, 777, 239, 240, 241, 242, 243, 244, 778, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 779, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 780, 352, 353, 0, 354, 0, 355, 781, 0, 782, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 783, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 784, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 785, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 786, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 787, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, 789, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 3, 4, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1051, 1750, 0, 6403, 715, 0, 0, 0, 0, 776, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 273, 274, 275, 1763, 276, 277, 278, 279, 280, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 327, 328, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1782, 348, 1783, 349, 350, 351, 352, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 364, 1788, 365, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1792, 395, 1793, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 420, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 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, 1799, 460, 461, 462, 463, 1800, 464, 465, 466, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 473, 474, 475, 1804, 1805, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 594, 595, 1817, 1818, 596, 597, 598, 599, 600, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 620, 621, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 273, 274, 275, 1763, 276, 277, 278, 279, 280, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 327, 328, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1782, 348, 1783, 349, 350, 351, 352, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 364, 1788, 365, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1792, 395, 1793, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 420, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 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, 1799, 460, 461, 462, 463, 1800, 464, 465, 466, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 473, 474, 475, 1804, 1805, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 594, 595, 1817, 1818, 596, 597, 598, 599, 600, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 620, 621, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 3680, 242, 243, 244, 1751, 245, 246, 247, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 248, 249, 250, 1759, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1760, 264, 265, 266, 267, 268, 269, 270, 1761, 1762, 271, 272, 273, 274, 275, 1763, 276, 277, 278, 279, 280, 1764, 281, 1765, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1766, 293, 294, 295, 296, 297, 298, 1767, 299, 300, 301, 302, 1768, 1769, 1770, 303, 1771, 1772, 1773, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1774, 313, 1775, 314, 315, 316, 317, 318, 319, 320, 1776, 321, 322, 323, 324, 1777, 1778, 325, 326, 327, 3681, 329, 1779, 330, 331, 332, 333, 1780, 334, 335, 336, 337, 1781, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1782, 348, 1783, 349, 350, 351, 352, 353, 1784, 354, 1785, 355, 356, 357, 1786, 358, 359, 360, 361, 362, 1787, 363, 364, 1788, 365, 366, 367, 1789, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1790, 378, 379, 380, 381, 382, 383, 384, 385, 1791, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1792, 395, 1793, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1794, 1795, 419, 420, 421, 422, 423, 1796, 424, 425, 426, 1797, 1798, 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, 1799, 460, 461, 462, 463, 1800, 464, 465, 466, 467, 468, 469, 1801, 470, 471, 472, 1802, 1803, 473, 474, 475, 1804, 1805, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1806, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1807, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1808, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1809, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1810, 551, 552, 553, 554, 555, 1811, 3682, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1812, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1813, 583, 584, 1814, 1815, 585, 586, 587, 588, 589, 590, 591, 592, 1816, 593, 594, 595, 1817, 1818, 596, 597, 598, 599, 600, 1819, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1820, 1821, 610, 611, 612, 613, 614, 1822, 1823, 615, 616, 617, 618, 619, 620, 621, 1824, 622, 623, 624, 625, 626, 627, 1825, 1826, 628, 1827, 1828, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1305, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1308, 0, 1309, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1321, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1324, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3477, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 410, 1338, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1339, 421, 422, 423, 0, 424, 425, 426, 1340, 1341, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1342, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1345, 459, 0, 460, 461, 462, 463, 0, 1348, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1351, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1352, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1355, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1357, 582, 0, 583, 584, 1358, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1361, 599, 1362, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1365, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1367, 1368, 1369, 1370, 640, 1371, 1372, 1373, 1374, 645, 646, 647, 648, 235, 0, 1295, 715, 0, 1296, 1297, 0, 776, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1301, 261, 1302, 1303, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 1306, 1307, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 1317, 1318, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1322, 348, 0, 349, 350, 351, 1323, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1326, 1327, 0, 1328, 0, 396, 397, 398, 399, 400, 6377, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 1343, 447, 1344, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 462, 463, 1347, 464, 465, 1349, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1353, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 1356, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1359, 1360, 0, 0, 596, 597, 598, 599, 600, 1363, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 1366, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1011, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1032, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1033, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3009, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 4034, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1839, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1840, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1841, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1127, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1169, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1182, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 973, 303, 0, 0, 974, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1194, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1195, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 975, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2041, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1153, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1166, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1180, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1184, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2843, 276, 277, 278, 279, 280, 0, 0, 2844, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2845, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2846, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2847, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 2848, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2849, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2850, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2843, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2845, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2846, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2847, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 3897, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2849, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2850, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 795, 245, 796, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 797, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 842, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 798, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 799, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 795, 245, 796, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 797, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 3579, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 798, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 799, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2843, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2845, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2846, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2847, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2849, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2850, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 795, 245, 796, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 797, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 798, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 799, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3085, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2915, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2916, 2917, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2017, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 2018, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 2019, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2020, 355, 356, 0, 0, 0, 2021, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 2022, 2023, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 2024, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 2025, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 2026, 539, 540, 541, 542, 543, 544, 2027, 546, 547, 548, 549, 550, 0, 2028, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2029, 585, 0, 2030, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 2031, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 796, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 797, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 798, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 799, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2915, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2916, 2917, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1025, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1026, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3661, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3662, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3674, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3675, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 657, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 706, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 707, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 835, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 836, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 837, 595, 0, 0, 838, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 861, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 862, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 863, 595, 0, 0, 864, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 927, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 982, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 983, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1145, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 835, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1259, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1413, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 1255, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 1419, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1417, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 858, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1560, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 867, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1621, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1622, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 3429, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 3430, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 3431, 585, 0, 587, 588, 3432, 590, 3433, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 3434, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 776, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4252, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4266, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4412, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4935, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 5008, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 5367, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 814, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 817, 0, 818, 557, 558, 559, 819, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 821, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 827, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 833, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 854, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 855, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 856, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 858, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 879, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1007, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1017, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1020, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1036, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1093, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1098, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1115, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1118, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1120, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1158, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1186, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1188, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1198, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1201, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1204, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 1256, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1417, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 858, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1882, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1916, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1918, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1958, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1960, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1962, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 2078, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 2731, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 0, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1417, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 2766, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 858, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2828, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 817, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 821, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2912, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 817, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 821, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2936, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 817, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 821, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3130, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3134, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3192, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3584, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 812, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 813, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 815, 536, 537, 538, 539, 540, 541, 542, 543, 544, 816, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 817, 0, 857, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 820, 595, 0, 0, 821, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 822, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3642, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3664, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3666, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3816, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 3858, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 5121, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 6342, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 0, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 0, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 0, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2739, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2740, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2742, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 2744, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 2824, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 4638, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 2902, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 4434, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 6029, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 6385, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 1160, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 1192, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 902, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2743, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 885, 261, 886, 887, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 888, 889, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 890, 891, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 892, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 893, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 894, 895, 0, 896, 0, 396, 397, 398, 399, 400, 897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 898, 447, 899, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 900, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 901, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 0, 559, 560, 561, 562, 563, 903, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 904, 905, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 906, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 0, 261, 0, 0, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 0, 0, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 0, 0, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 0, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 0, 0, 0, 0, 0, 396, 397, 398, 399, 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 0, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 0, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 0, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 0, 559, 560, 561, 562, 563, 0, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 0, 0, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 0, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648 }; static const yytype_int16 yycheck[] = { 6, 947, 0, 0, 0, 0, 1055, 0, 0, 45, 0, 0, 57, 0, 0, 0, 0, 23, 1046, 25, 0, 0, 0, 29, 30, 0, 21, 212, 21, 35, 36, 37, 0, 39, 1608, 684, 42, 43, 0, 45, 212, 47, 1172, 190, 1018, 1673, 852, 1233, 54, 55, 56, 797, 798, 799, 8, 1592, 854, 803, 46, 1050, 921, 15, 1035, 207, 6, 902, 22, 941, 985, 943, 663, 215, 28, 2850, 218, 2076, 1019, 2725, 757, 1592, 890, 891, 0, 878, 1585, 37, 1044, 3438, 872, 3440, 900, 1299, 1517, 198, 2726, 1286, 3078, 1912, 959, 845, 1121, 3257, 858, 716, 3143, 30, 217, 761, 871, 1597, 36, 905, 3948, 3932, 3530, 3618, 2683, 43, 3734, 1740, 231, 1272, 1095, 716, 2066, 1276, 1099, 2103, 1279, 1280, 23, 1104, 665, 1707, 1708, 1638, 1639, 2084, 1055, 1642, 3680, 1114, 3682, 984, 37, 3043, 3981, 3045, 3046, 4281, 2102, 2996, 3050, 3051, 3052, 1128, 3054, 3055, 3056, 3090, 1585, 3488, 4838, 3884, 3540, 2974, 3959, 4324, 1009, 1984, 763, 176, 762, 1014, 4303, 1048, 737, 4603, 1474, 740, 752, 1925, 3652, 3105, 3654, 5232, 1159, 2141, 4571, 4365, 226, 2, 198, 199, 200, 2747, 2748, 203, 36, 4626, 5322, 207, 815, 209, 5362, 4609, 212, 970, 4410, 215, 5452, 192, 218, 1701, 4614, 221, 3504, 223, 2117, 4741, 226, 4743, 815, 1110, 230, 2626, 232, 192, 5488, 2630, 4613, 5102, 4854, 5159, 4856, 2642, 42, 3482, 831, 1126, 1728, 51, 3300, 5151, 2710, 3392, 3550, 2712, 5500, 944, 2098, 2099, 2100, 2101, 5146, 944, 2104, 3946, 2106, 2107, 5353, 5753, 4928, 6, 6, 3487, 3397, 3489, 3490, 6, 0, 38, 21, 0, 0, 1558, 54, 3086, 5737, 5150, 11, 11, 2689, 876, 13, 4779, 6, 78, 6, 6, 6, 0, 968, 3538, 29, 0, 1059, 15, 16, 29, 63, 888, 889, 4463, 5416, 5417, 148, 21, 0, 47, 6, 95, 899, 6, 37, 6, 5409, 120, 37, 11, 35, 72, 15, 16, 15, 16, 85, 1018, 2072, 6, 6, 171, 6, 1009, 13, 120, 1027, 29, 1014, 43, 43, 23, 157, 1089, 1261, 938, 1037, 184, 1265, 1266, 6, 6, 122, 6, 6, 80, 5, 47, 47, 6, 122, 222, 11, 113, 177, 63, 45, 115, 3, 88, 80, 6, 3, 177, 5, 6, 177, 120, 89, 739, 11, 15, 92, 177, 184, 80, 37, 6, 1891, 11, 125, 21, 5441, 753, 11, 37, 63, 92, 63, 78, 5, 5639, 153, 6, 308, 177, 11, 6134, 3620, 4705, 4706, 4707, 1207, 4709, 4710, 4711, 4712, 4713, 80, 92, 13, 132, 173, 6134, 206, 4627, 179, 324, 92, 21, 309, 171, 818, 188, 177, 92, 346, 6009, 63, 1430, 309, 667, 293, 351, 322, 193, 179, 177, 135, 63, 177, 177, 64, 384, 112, 63, 226, 1111, 395, 29, 72, 168, 1055, 120, 1422, 1486, 36, 179, 177, 5961, 367, 201, 177, 155, 201, 201, 184, 5369, 13, 25, 115, 216, 13, 359, 447, 177, 402, 1478, 124, 120, 360, 177, 201, 5952, 384, 5755, 201, 434, 120, 684, 447, 324, 6340, 124, 386, 402, 472, 1317, 1318, 201, 45, 99, 354, 4939, 45, 482, 80, 332, 80, 152, 6247, 6383, 292, 271, 80, 5380, 274, 172, 25, 32, 384, 179, 389, 759, 1894, 1636, 6247, 322, 3105, 1349, 363, 478, 4941, 78, 367, 5, 173, 78, 297, 734, 4949, 11, 1653, 6002, 1914, 5, 59, 310, 193, 5652, 184, 11, 419, 208, 418, 213, 1360, 534, 534, 5424, 452, 682, 6410, 13, 6436, 538, 283, 688, 37, 402, 470, 5489, 80, 297, 1379, 355, 63, 223, 372, 700, 221, 538, 6, 344, 140, 183, 1587, 534, 310, 354, 478, 1474, 223, 534, 29, 292, 29, 477, 484, 267, 373, 36, 491, 36, 272, 348, 327, 1380, 177, 470, 253, 847, 538, 1213, 534, 256, 534, 496, 532, 369, 385, 6123, 536, 5871, 5449, 292, 271, 534, 1024, 274, 243, 6368, 1255, 140, 256, 393, 1563, 1410, 178, 399, 1445, 5700, 434, 447, 491, 534, 1573, 6368, 664, 37, 395, 120, 1255, 125, 670, 1475, 672, 297, 674, 422, 177, 677, 1265, 1266, 136, 373, 669, 538, 684, 1292, 669, 3893, 669, 689, 142, 691, 23, 125, 5310, 4410, 669, 697, 534, 478, 534, 1668, 6268, 512, 1671, 1292, 5960, 538, 384, 462, 447, 297, 373, 669, 373, 447, 1738, 1739, 474, 332, 465, 721, 1511, 4438, 763, 1306, 1307, 524, 447, 405, 730, 538, 430, 430, 734, 440, 534, 737, 447, 534, 740, 470, 1679, 447, 538, 477, 6232, 532, 461, 1660, 481, 536, 1663, 1664, 373, 534, 756, 669, 447, 4882, 538, 1642, 534, 1344, 393, 373, 1439, 509, 767, 4582, 5258, 373, 538, 534, 538, 762, 23, 6230, 495, 809, 23, 538, 495, 23, 1736, 452, 4940, 524, 1623, 447, 5896, 447, 4622, 477, 477, 538, 532, 4951, 534, 536, 536, 525, 526, 534, 2081, 1745, 947, 530, 533, 809, 4623, 1692, 1693, 537, 814, 1504, 537, 537, 818, 819, 534, 1504, 534, 534, 534, 1179, 6312, 777, 1659, 779, 538, 781, 2012, 833, 537, 4445, 538, 787, 537, 525, 526, 4451, 872, 791, 534, 5747, 538, 534, 412, 534, 495, 537, 852, 853, 854, 855, 856, 530, 538, 495, 6114, 314, 1986, 534, 534, 5751, 534, 867, 515, 516, 1451, 1452, 872, 6359, 515, 516, 1561, 538, 878, 538, 509, 6127, 525, 526, 534, 534, 1240, 534, 534, 447, 1069, 447, 491, 534, 814, 2019, 524, 447, 818, 819, 525, 526, 373, 1069, 532, 4369, 6142, 2031, 536, 525, 526, 402, 4627, 1583, 525, 526, 515, 1271, 3479, 538, 538, 3482, 952, 4244, 5214, 925, 525, 526, 1066, 301, 538, 262, 1070, 1287, 1072, 25, 538, 967, 1623, 939, 527, 528, 529, 530, 1855, 937, 937, 937, 937, 63, 937, 937, 952, 937, 937, 447, 937, 937, 937, 937, 935, 1060, 6049, 937, 937, 937, 1636, 967, 937, 3530, 3862, 961, 5632, 3776, 3777, 937, 935, 3538, 3781, 470, 6234, 937, 4123, 1653, 6071, 538, 986, 1630, 4113, 4114, 4673, 991, 992, 412, 3919, 412, 525, 526, 527, 528, 529, 530, 527, 528, 529, 530, 1873, 3553, 6451, 3555, 534, 1892, 420, 421, 470, 262, 388, 4256, 4316, 262, 6463, 4260, 262, 1023, 1024, 937, 32, 4243, 32, 4245, 4246, 1558, 25, 10, 4531, 487, 13, 538, 470, 5959, 17, 18, 19, 29, 4096, 163, 1046, 1047, 3449, 3509, 140, 3510, 5472, 23, 5956, 855, 856, 6311, 389, 5868, 1060, 51, 1062, 177, 5873, 5874, 1066, 538, 4532, 1069, 1070, 524, 1072, 4198, 5939, 879, 127, 1077, 125, 532, 2102, 534, 535, 536, 114, 538, 6238, 6239, 201, 194, 5955, 525, 526, 527, 528, 529, 530, 1538, 2083, 113, 156, 1101, 5479, 1023, 1024, 477, 437, 10, 1108, 1109, 13, 6152, 63, 3916, 17, 18, 19, 125, 6205, 171, 6043, 329, 155, 23, 186, 37, 23, 177, 120, 22, 1130, 1131, 1132, 113, 1134, 28, 1136, 468, 1138, 1139, 115, 125, 389, 3, 170, 256, 3541, 140, 5689, 389, 5691, 25, 113, 2138, 5695, 5696, 4438, 31, 10, 113, 379, 4658, 493, 6399, 2932, 17, 18, 19, 35, 216, 6, 296, 1172, 189, 1174, 1175, 206, 6293, 309, 266, 120, 1921, 177, 165, 4594, 389, 288, 5383, 5358, 120, 437, 1023, 384, 311, 437, 386, 6, 437, 488, 367, 308, 6417, 6449, 534, 6124, 292, 27, 1207, 216, 6361, 177, 1639, 5828, 6115, 1642, 308, 265, 23, 193, 6466, 103, 468, 312, 6439, 201, 468, 1213, 125, 468, 50, 89, 91, 216, 1233, 201, 1235, 2028, 2029, 178, 1239, 171, 1241, 434, 292, 155, 3013, 493, 224, 538, 23, 493, 1838, 471, 493, 72, 10, 63, 189, 13, 52, 268, 452, 17, 18, 19, 367, 140, 1267, 1216, 6, 1218, 253, 1220, 132, 1222, 389, 1224, 1225, 1226, 447, 35, 371, 372, 1231, 409, 145, 1286, 534, 6, 156, 1290, 534, 262, 2082, 534, 2084, 271, 3245, 2165, 274, 288, 2090, 120, 186, 1304, 297, 6422, 2096, 2097, 5825, 40, 5141, 402, 339, 5734, 311, 1989, 379, 216, 2108, 6240, 224, 5135, 5743, 54, 5719, 534, 288, 2747, 2118, 534, 324, 2814, 310, 445, 2124, 454, 2844, 3884, 1144, 1379, 5718, 6383, 5172, 5765, 2018, 1346, 5745, 395, 2022, 336, 3089, 314, 293, 2027, 5749, 288, 2030, 3, 389, 491, 5148, 262, 181, 370, 262, 370, 6290, 28, 483, 3316, 5748, 405, 5793, 367, 1375, 1376, 1377, 2135, 1379, 384, 111, 386, 1949, 374, 10, 99, 314, 13, 301, 6310, 2681, 17, 18, 19, 6436, 217, 447, 1953, 259, 1400, 6321, 432, 196, 434, 288, 119, 310, 201, 402, 35, 397, 1996, 1968, 2896, 1981, 1971, 3032, 393, 389, 434, 472, 373, 470, 25, 538, 534, 1427, 3974, 534, 31, 487, 92, 4897, 1875, 1434, 152, 3330, 3331, 491, 6360, 5982, 3335, 156, 23, 1445, 91, 25, 452, 4365, 324, 1630, 447, 439, 434, 441, 262, 4921, 310, 252, 476, 297, 470, 1891, 324, 23, 2021, 437, 327, 224, 2025, 2026, 2115, 6393, 292, 5626, 1506, 89, 1508, 297, 434, 288, 475, 3376, 3377, 215, 470, 297, 262, 389, 3, 1491, 389, 367, 405, 1495, 1496, 5620, 468, 6169, 3122, 146, 3, 156, 220, 6425, 1506, 1507, 1508, 1509, 4880, 1511, 76, 120, 1489, 1490, 299, 1492, 4839, 179, 132, 5941, 510, 493, 491, 26, 344, 314, 402, 524, 1489, 1490, 472, 1492, 509, 1535, 143, 437, 534, 140, 437, 536, 149, 361, 476, 522, 523, 524, 525, 526, 527, 528, 529, 530, 2081, 310, 163, 455, 288, 534, 297, 444, 140, 208, 534, 5099, 373, 189, 468, 288, 1570, 468, 470, 535, 302, 1575, 538, 437, 1578, 297, 440, 440, 120, 389, 369, 87, 329, 178, 6, 122, 91, 1591, 1592, 493, 309, 402, 493, 156, 314, 224, 1600, 329, 1956, 1603, 4843, 2627, 4639, 120, 30, 4848, 389, 538, 4851, 302, 407, 389, 1970, 434, 136, 522, 523, 524, 525, 526, 527, 528, 529, 530, 4520, 1983, 1630, 437, 1632, 4525, 534, 1635, 125, 534, 1638, 1639, 329, 309, 1642, 68, 2629, 146, 3141, 465, 5478, 133, 363, 140, 1652, 72, 1644, 1655, 1575, 189, 1658, 1649, 144, 391, 468, 437, 122, 167, 288, 1697, 5383, 193, 522, 523, 524, 525, 526, 527, 528, 529, 530, 4595, 1680, 5851, 395, 262, 177, 310, 331, 493, 348, 472, 297, 6111, 42, 226, 468, 4256, 122, 1697, 216, 4260, 201, 375, 324, 5490, 262, 171, 491, 208, 201, 1709, 1710, 1711, 1712, 1713, 72, 327, 1635, 183, 3137, 493, 271, 434, 3141, 324, 6120, 6121, 386, 1727, 534, 2772, 515, 182, 1722, 1652, 92, 201, 1726, 328, 1738, 1739, 1740, 305, 395, 239, 5870, 367, 324, 271, 464, 180, 205, 538, 25, 538, 292, 534, 288, 476, 168, 292, 534, 323, 343, 4602, 152, 478, 367, 522, 523, 524, 525, 526, 527, 528, 529, 530, 491, 165, 491, 292, 312, 434, 402, 171, 297, 1964, 1965, 4558, 165, 367, 450, 534, 452, 4596, 171, 217, 456, 372, 323, 1965, 226, 402, 515, 402, 4365, 256, 534, 324, 6228, 535, 389, 307, 538, 487, 2681, 266, 1954, 408, 463, 332, 180, 534, 355, 491, 402, 478, 471, 402, 440, 474, 331, 389, 220, 288, 240, 245, 395, 1837, 491, 297, 324, 135, 393, 137, 1943, 534, 39, 454, 1848, 199, 367, 389, 341, 266, 476, 402, 1856, 1857, 437, 466, 242, 2772, 515, 288, 4410, 253, 292, 140, 449, 393, 122, 2660, 1872, 292, 29, 434, 253, 402, 379, 437, 403, 534, 288, 367, 777, 402, 779, 6307, 781, 468, 1890, 1891, 4438, 122, 787, 788, 789, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1906, 1907, 1908, 1909, 468, 377, 2743, 494, 493, 1915, 304, 6313, 538, 478, 4836, 302, 1922, 5736, 29, 1925, 314, 304, 6054, 355, 431, 2723, 491, 5763, 292, 493, 2115, 130, 10, 538, 1940, 13, 171, 1943, 476, 17, 18, 19, 329, 355, 15, 16, 383, 1953, 1954, 534, 515, 240, 210, 390, 80, 534, 463, 35, 1964, 1965, 397, 5754, 1968, 302, 471, 1971, 92, 474, 2942, 534, 534, 779, 780, 781, 135, 210, 784, 785, 786, 411, 1986, 1987, 439, 349, 441, 538, 794, 1993, 10, 1995, 329, 13, 292, 405, 402, 17, 18, 19, 435, 288, 201, 10, 2038, 1996, 13, 534, 2012, 2880, 17, 18, 19, 468, 482, 2019, 5517, 2021, 38, 383, 2024, 2025, 2026, 458, 2028, 2029, 135, 2031, 35, 4594, 4595, 2946, 288, 397, 2038, 2906, 292, 449, 3166, 2954, 4039, 384, 2957, 386, 324, 534, 1998, 324, 2000, 323, 2002, 5205, 2004, 524, 2006, 288, 2099, 165, 2010, 292, 470, 4060, 120, 5306, 2068, 536, 534, 2071, 2072, 6243, 2074, 435, 464, 2077, 2078, 2066, 323, 4627, 2082, 2066, 2084, 2066, 3026, 3027, 3028, 2089, 2090, 367, 985, 2066, 367, 120, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 763, 2066, 2992, 2112, 452, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 405, 5953, 2124, 5101, 2126, 2127, 2074, 402, 2130, 3550, 402, 402, 159, 4076, 538, 3759, 333, 3006, 3635, 3560, 4112, 5972, 532, 2145, 2146, 2147, 536, 253, 472, 4097, 224, 534, 2066, 178, 4102, 2842, 13, 402, 2995, 3363, 1055, 2163, 5140, 2922, 5511, 5954, 324, 194, 0, 5063, 367, 5065, 5066, 5067, 371, 831, 69, 70, 2920, 312, 2922, 5717, 5334, 2772, 5336, 470, 359, 212, 2077, 3158, 165, 324, 6364, 5120, 100, 48, 171, 123, 304, 534, 447, 2203, 227, 3072, 4015, 402, 224, 5125, 322, 367, 534, 13, 324, 371, 3635, 154, 25, 25, 71, 224, 876, 78, 31, 396, 3841, 250, 3109, 3110, 3111, 3112, 3847, 3114, 343, 3732, 367, 491, 310, 314, 359, 4134, 4135, 4136, 4137, 45, 402, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 2942, 3139, 4101, 537, 515, 29, 434, 4106, 4107, 203, 292, 322, 538, 538, 33, 34, 197, 178, 4836, 123, 396, 78, 524, 253, 324, 4843, 395, 938, 91, 5089, 4848, 5091, 123, 4851, 536, 402, 5790, 310, 2980, 491, 2970, 4234, 2972, 491, 3783, 80, 2976, 5768, 3216, 324, 310, 212, 112, 2310, 4204, 4205, 484, 92, 434, 83, 392, 35, 86, 515, 100, 434, 227, 367, 58, 93, 133, 324, 6116, 3015, 304, 5742, 140, 140, 3246, 10, 99, 144, 13, 449, 395, 3544, 17, 18, 19, 250, 538, 3830, 367, 197, 100, 483, 5698, 121, 378, 1644, 119, 491, 402, 346, 1649, 3229, 197, 2364, 484, 478, 371, 1261, 172, 333, 367, 1265, 1266, 367, 279, 152, 432, 452, 491, 434, 6389, 515, 6391, 402, 494, 413, 3955, 439, 165, 441, 449, 3132, 367, 156, 171, 129, 484, 402, 178, 4242, 534, 292, 515, 308, 208, 402, 297, 371, 402, 5326, 438, 1214, 491, 181, 1217, 471, 1219, 491, 1221, 2420, 1223, 534, 491, 478, 1227, 208, 194, 402, 178, 301, 6244, 94, 212, 1722, 217, 494, 491, 1726, 402, 207, 6051, 5358, 3091, 220, 6453, 6233, 515, 227, 231, 522, 523, 524, 525, 526, 527, 528, 529, 530, 355, 538, 515, 352, 212, 267, 538, 447, 392, 6438, 272, 538, 250, 368, 182, 378, 137, 452, 253, 227, 171, 534, 27, 6452, 2674, 2675, 2676, 2840, 3354, 324, 10, 38, 472, 13, 3360, 33, 34, 17, 18, 19, 3439, 279, 250, 398, 195, 50, 5850, 522, 523, 524, 525, 526, 527, 528, 529, 530, 384, 385, 171, 324, 522, 523, 524, 525, 526, 527, 528, 529, 530, 304, 308, 279, 367, 1013, 81, 171, 491, 243, 5429, 314, 5, 3213, 195, 3299, 3332, 533, 11, 282, 256, 532, 538, 224, 1032, 536, 19, 1035, 3344, 1449, 363, 195, 515, 152, 367, 515, 516, 5125, 1458, 534, 1460, 472, 533, 306, 1464, 38, 165, 538, 515, 516, 270, 1471, 171, 527, 534, 5, 6396, 5500, 532, 534, 534, 11, 536, 529, 3380, 6056, 6057, 534, 534, 402, 536, 532, 378, 534, 363, 536, 409, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 527, 2614, 439, 529, 441, 532, 392, 534, 534, 536, 536, 2624, 2625, 2805, 2627, 220, 378, 384, 385, 5654, 395, 2634, 3424, 310, 5659, 5660, 2805, 143, 294, 2642, 3788, 2644, 369, 149, 2647, 2648, 266, 359, 2651, 419, 2653, 2643, 422, 2656, 4550, 22, 3246, 2660, 253, 308, 5579, 28, 266, 2804, 313, 2806, 2807, 1563, 96, 434, 3461, 3462, 206, 308, 1009, 92, 270, 1573, 313, 1014, 2683, 3621, 534, 195, 536, 464, 2689, 2690, 4686, 3442, 452, 535, 535, 3551, 538, 538, 532, 2700, 534, 2801, 284, 285, 286, 287, 87, 4703, 2709, 2710, 3343, 304, 3345, 3346, 535, 478, 59, 538, 3656, 482, 484, 314, 2723, 1617, 1618, 534, 392, 536, 491, 439, 2731, 441, 2733, 2839, 6199, 535, 5770, 3495, 538, 535, 535, 395, 538, 538, 5306, 535, 2683, 535, 538, 3735, 538, 535, 515, 243, 538, 3399, 3561, 535, 468, 4382, 538, 534, 2763, 3944, 5326, 535, 1660, 182, 538, 1663, 1664, 534, 11, 2774, 484, 2776, 535, 482, 535, 538, 434, 538, 2813, 395, 535, 4732, 432, 538, 310, 2790, 534, 206, 4739, 4740, 4604, 535, 5358, 308, 538, 535, 2801, 152, 538, 2804, 2805, 2806, 2807, 535, 538, 2810, 538, 4380, 2813, 4382, 165, 2728, 535, 389, 535, 538, 171, 538, 434, 535, 478, 2931, 538, 2774, 48, 2776, 5634, 2832, 535, 3, 6299, 538, 5383, 491, 5642, 5643, 6186, 256, 2763, 2844, 439, 411, 441, 522, 523, 524, 525, 526, 527, 528, 529, 530, 2857, 2858, 439, 4367, 441, 515, 535, 2864, 4347, 538, 478, 535, 311, 220, 538, 464, 2873, 4059, 535, 293, 294, 538, 534, 491, 534, 535, 511, 537, 535, 2916, 535, 538, 6415, 538, 535, 6418, 535, 538, 2895, 538, 4316, 6048, 313, 682, 5365, 5366, 253, 515, 3578, 688, 3012, 535, 535, 3925, 538, 538, 2832, 535, 59, 2916, 538, 700, 48, 3887, 535, 91, 534, 538, 535, 511, 1161, 538, 2929, 0, 535, 226, 1167, 538, 5851, 4418, 3622, 535, 5500, 484, 538, 535, 1177, 311, 538, 535, 1181, 491, 538, 493, 1185, 2952, 1187, 304, 2955, 308, 5503, 535, 1193, 535, 538, 1855, 538, 314, 1199, 535, 535, 1202, 538, 538, 535, 171, 43, 538, 38, 145, 535, 395, 536, 538, 2981, 2982, 535, 535, 5611, 538, 538, 535, 308, 3730, 538, 3599, 515, 516, 3735, 2996, 60, 2998, 2999, 3881, 522, 523, 524, 525, 526, 527, 528, 529, 530, 535, 535, 3599, 538, 538, 60, 3883, 434, 5579, 2969, 6365, 535, 3707, 38, 538, 439, 135, 441, 137, 99, 3030, 3031, 3032, 491, 535, 493, 3036, 538, 452, 491, 535, 493, 5958, 538, 3044, 60, 48, 535, 4616, 112, 538, 465, 535, 226, 468, 538, 152, 3057, 491, 535, 493, 478, 538, 3063, 535, 3065, 511, 538, 535, 165, 535, 538, 527, 538, 491, 171, 535, 176, 3078, 538, 4611, 535, 152, 3083, 538, 535, 5817, 5818, 538, 3089, 259, 535, 3092, 534, 538, 165, 6441, 112, 515, 4301, 535, 171, 538, 538, 3104, 3105, 535, 177, 535, 538, 491, 538, 493, 183, 464, 3115, 186, 534, 2128, 535, 190, 2131, 538, 481, 220, 3125, 3264, 3127, 3266, 3267, 535, 340, 535, 538, 6110, 538, 535, 4632, 534, 538, 535, 204, 535, 538, 535, 538, 535, 538, 535, 538, 220, 538, 222, 384, 385, 324, 4067, 253, 535, 37, 535, 538, 3261, 538, 333, 535, 3166, 537, 3168, 3105, 3170, 59, 535, 3913, 535, 538, 535, 538, 535, 538, 537, 5742, 535, 253, 535, 538, 4366, 538, 4368, 204, 535, 4371, 4177, 538, 363, 4228, 534, 4230, 367, 2092, 2093, 534, 371, 3203, 267, 5847, 535, 535, 304, 272, 538, 6127, 3124, 4632, 384, 385, 2109, 2110, 314, 535, 3399, 3575, 3576, 535, 535, 288, 538, 538, 535, 535, 177, 538, 538, 402, 304, 222, 535, 535, 308, 538, 538, 222, 535, 535, 314, 538, 538, 2140, 535, 495, 535, 538, 267, 538, 6015, 6016, 535, 272, 3931, 538, 323, 3261, 3262, 38, 3264, 4043, 3266, 3267, 437, 3269, 534, 440, 535, 288, 535, 538, 3276, 538, 534, 4231, 535, 3281, 3889, 538, 3891, 60, 4826, 536, 4828, 4274, 5851, 5237, 5238, 3332, 1506, 4261, 1508, 4263, 534, 5288, 72, 5290, 3889, 4170, 3891, 375, 78, 10, 323, 372, 13, 55, 56, 534, 367, 201, 157, 534, 536, 157, 92, 6237, 491, 6, 308, 3504, 4311, 6243, 201, 367, 3330, 3331, 3332, 396, 4956, 3335, 308, 112, 157, 157, 4129, 3380, 45, 3343, 3344, 3345, 3346, 201, 120, 52, 122, 5244, 157, 308, 417, 4028, 171, 372, 6129, 3359, 430, 367, 3362, 157, 3364, 122, 3973, 251, 464, 10, 3724, 472, 13, 308, 4163, 78, 3376, 3377, 534, 301, 3380, 396, 171, 535, 72, 54, 3973, 292, 10, 38, 292, 13, 3746, 495, 464, 534, 308, 5958, 292, 3399, 48, 3401, 417, 3403, 45, 3405, 181, 292, 48, 181, 457, 52, 292, 91, 4381, 4922, 324, 484, 488, 484, 490, 491, 87, 45, 3424, 4214, 452, 3427, 171, 204, 52, 3431, 101, 347, 157, 157, 532, 78, 210, 535, 536, 534, 512, 3482, 157, 157, 495, 150, 6364, 3449, 3432, 3433, 3434, 157, 538, 157, 78, 126, 157, 157, 157, 157, 157, 157, 171, 535, 157, 537, 538, 308, 157, 157, 535, 157, 434, 4655, 145, 10, 157, 3479, 13, 150, 3482, 3483, 4339, 103, 534, 3487, 3488, 3489, 3490, 125, 267, 196, 0, 3534, 3496, 272, 201, 38, 251, 3501, 308, 172, 171, 171, 534, 176, 6, 4313, 6, 534, 45, 288, 534, 198, 3516, 171, 534, 52, 292, 534, 191, 534, 207, 297, 0, 4438, 150, 534, 3530, 5526, 215, 534, 3534, 218, 534, 3537, 3538, 6, 3540, 6, 4409, 3479, 4411, 78, 3482, 21, 323, 252, 3904, 534, 3906, 6, 534, 196, 534, 534, 534, 534, 201, 4528, 6, 534, 534, 534, 6127, 534, 534, 4506, 4437, 534, 344, 534, 196, 534, 4516, 10, 534, 201, 13, 3581, 534, 57, 17, 18, 19, 320, 534, 361, 534, 6362, 534, 99, 3530, 534, 534, 372, 534, 299, 534, 534, 3538, 534, 534, 3605, 3606, 310, 135, 534, 137, 252, 45, 534, 534, 534, 492, 150, 166, 52, 222, 396, 538, 538, 135, 38, 137, 251, 297, 38, 252, 534, 37, 445, 445, 532, 163, 532, 447, 447, 447, 3641, 417, 534, 447, 78, 152, 177, 538, 171, 171, 304, 163, 402, 68, 302, 447, 447, 5551, 165, 389, 447, 483, 196, 447, 171, 536, 447, 201, 310, 389, 177, 389, 447, 253, 79, 6237, 183, 447, 371, 186, 447, 6243, 352, 190, 447, 92, 524, 310, 5582, 248, 157, 308, 465, 447, 447, 389, 297, 3698, 128, 447, 228, 437, 471, 407, 3884, 329, 308, 4062, 394, 384, 302, 534, 447, 220, 447, 194, 228, 192, 252, 534, 92, 3722, 157, 201, 1959, 128, 324, 538, 447, 472, 472, 3732, 1967, 128, 114, 447, 447, 447, 447, 128, 447, 447, 59, 59, 276, 447, 253, 312, 329, 47, 329, 5171, 351, 538, 351, 351, 284, 285, 286, 287, 539, 535, 196, 291, 292, 407, 447, 201, 4680, 297, 447, 447, 284, 285, 286, 287, 310, 2671, 2672, 291, 437, 224, 447, 2677, 407, 297, 447, 447, 447, 447, 224, 225, 224, 308, 447, 447, 447, 304, 224, 224, 447, 308, 6364, 447, 224, 224, 224, 314, 224, 513, 308, 224, 224, 447, 457, 2709, 2710, 534, 252, 38, 4688, 525, 526, 527, 528, 529, 530, 157, 308, 157, 292, 120, 472, 157, 157, 157, 308, 483, 259, 292, 3841, 292, 292, 38, 171, 38, 3847, 243, 391, 157, 157, 534, 534, 157, 472, 157, 534, 3858, 472, 301, 447, 295, 177, 296, 538, 487, 535, 276, 375, 13, 534, 513, 276, 407, 447, 538, 310, 186, 2772, 319, 449, 194, 194, 525, 526, 527, 528, 529, 530, 4875, 513, 511, 393, 532, 3895, 3896, 3897, 534, 534, 511, 274, 534, 525, 526, 527, 528, 529, 530, 535, 535, 488, 3912, 405, 38, 535, 220, 309, 472, 472, 535, 535, 240, 535, 317, 59, 3926, 454, 434, 538, 5110, 538, 3962, 483, 389, 297, 535, 297, 297, 466, 534, 1723, 447, 454, 3944, 3945, 3946, 534, 447, 171, 3950, 297, 447, 5484, 308, 466, 308, 240, 464, 534, 4791, 292, 3962, 240, 2857, 251, 251, 251, 384, 308, 270, 447, 128, 10, 407, 437, 13, 538, 308, 538, 513, 201, 488, 308, 490, 491, 367, 491, 4777, 308, 4858, 195, 525, 526, 527, 528, 529, 530, 399, 447, 447, 4674, 4675, 4676, 4677, 4678, 512, 355, 45, 314, 535, 402, 38, 4043, 224, 52, 472, 243, 4018, 157, 302, 472, 350, 524, 171, 484, 532, 38, 2683, 535, 536, 537, 4032, 4033, 173, 4946, 435, 157, 721, 157, 534, 78, 351, 4043, 399, 534, 3958, 730, 157, 302, 472, 491, 292, 2946, 737, 38, 292, 740, 308, 4059, 27, 2954, 308, 243, 2957, 302, 192, 192, 171, 38, 4870, 4212, 5640, 172, 243, 399, 2969, 171, 4078, 308, 513, 292, 3994, 59, 201, 62, 201, 4087, 201, 522, 523, 524, 525, 526, 527, 528, 529, 530, 495, 201, 201, 4101, 538, 538, 5071, 4105, 4106, 4107, 538, 536, 538, 447, 4112, 150, 1896, 4115, 177, 491, 4118, 273, 308, 98, 1904, 301, 4124, 177, 4126, 534, 538, 4129, 1912, 314, 512, 477, 4134, 4135, 4136, 4137, 538, 535, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 535, 535, 535, 4153, 4154, 4155, 538, 535, 375, 196, 535, 538, 538, 4163, 201, 535, 535, 535, 4168, 535, 534, 4210, 4172, 538, 535, 1957, 320, 535, 535, 535, 4180, 135, 330, 4183, 161, 4185, 535, 177, 447, 534, 488, 511, 534, 291, 10, 669, 534, 13, 266, 534, 533, 4201, 1984, 535, 4204, 4205, 177, 186, 470, 4209, 4210, 261, 488, 478, 4214, 252, 4216, 4217, 4861, 515, 533, 198, 4576, 4577, 534, 4225, 4226, 4227, 308, 45, 524, 4410, 534, 59, 514, 534, 52, 308, 4220, 4221, 4222, 4223, 4242, 4243, 4244, 4245, 4246, 4234, 4248, 4249, 308, 4234, 4252, 4234, 311, 157, 4256, 538, 447, 4438, 4260, 4234, 78, 447, 214, 447, 4266, 297, 160, 292, 447, 248, 157, 310, 534, 206, 534, 534, 4234, 6172, 6173, 422, 394, 6176, 157, 157, 402, 394, 762, 763, 394, 251, 206, 4293, 160, 308, 524, 447, 472, 62, 160, 389, 488, 331, 253, 469, 331, 160, 4308, 419, 4310, 288, 447, 389, 447, 292, 447, 447, 263, 263, 4256, 263, 4234, 3216, 4260, 447, 447, 389, 447, 389, 389, 128, 402, 447, 150, 98, 447, 292, 157, 447, 47, 447, 447, 5283, 47, 535, 533, 324, 325, 224, 5090, 3244, 5771, 3246, 447, 447, 333, 5030, 5031, 535, 5033, 224, 535, 535, 189, 4365, 4366, 4367, 4368, 312, 407, 4371, 535, 4373, 457, 3, 5316, 1060, 538, 171, 196, 48, 113, 1066, 535, 201, 538, 1070, 171, 1072, 367, 4391, 534, 38, 371, 535, 157, 157, 161, 376, 447, 524, 171, 302, 189, 534, 472, 2641, 385, 472, 157, 389, 399, 155, 389, 389, 389, 394, 155, 389, 224, 224, 224, 224, 224, 402, 224, 147, 224, 4365, 224, 224, 532, 228, 465, 198, 252, 308, 415, 535, 535, 538, 59, 465, 308, 535, 4446, 424, 4627, 308, 3105, 308, 429, 1136, 13, 1138, 1139, 538, 320, 483, 535, 935, 535, 937, 177, 227, 535, 291, 535, 318, 6092, 535, 227, 538, 436, 315, 513, 533, 59, 10, 535, 534, 13, 444, 535, 248, 534, 375, 525, 526, 527, 528, 529, 530, 310, 534, 190, 477, 534, 90, 457, 4501, 4452, 171, 38, 243, 472, 472, 38, 486, 447, 59, 214, 4463, 45, 437, 157, 86, 419, 472, 181, 52, 457, 447, 394, 288, 160, 447, 447, 292, 60, 389, 447, 389, 4534, 447, 535, 535, 535, 367, 534, 534, 59, 491, 437, 478, 171, 78, 4548, 308, 4550, 5675, 78, 5677, 157, 113, 86, 4557, 224, 457, 224, 324, 325, 4563, 4918, 3458, 224, 5434, 224, 240, 333, 535, 209, 447, 4574, 534, 534, 495, 534, 308, 38, 329, 112, 113, 535, 308, 538, 305, 3, 4589, 120, 407, 538, 534, 4594, 4595, 457, 44, 538, 447, 534, 183, 4602, 535, 367, 184, 113, 177, 371, 399, 224, 4611, 535, 376, 241, 3508, 3509, 145, 241, 150, 297, 4621, 385, 297, 535, 535, 5299, 297, 297, 159, 535, 394, 177, 4633, 4634, 535, 59, 5310, 489, 402, 535, 538, 5822, 5686, 4644, 489, 535, 320, 329, 535, 227, 181, 415, 534, 538, 4655, 4656, 534, 4594, 4595, 490, 424, 444, 302, 177, 196, 429, 5021, 457, 5461, 201, 447, 524, 4673, 204, 208, 491, 78, 297, 534, 195, 195, 4861, 38, 297, 524, 59, 5867, 437, 447, 72, 538, 538, 447, 447, 157, 160, 513, 535, 224, 534, 447, 127, 179, 120, 38, 201, 302, 4620, 525, 526, 527, 528, 529, 530, 4715, 5359, 534, 38, 399, 472, 252, 173, 486, 292, 491, 302, 399, 59, 437, 84, 4731, 38, 5913, 5914, 491, 177, 267, 171, 1213, 362, 308, 272, 534, 211, 311, 177, 222, 535, 4749, 538, 535, 5395, 477, 535, 534, 416, 535, 288, 59, 392, 38, 292, 81, 5118, 535, 534, 534, 5557, 92, 136, 308, 447, 202, 361, 5686, 38, 4777, 535, 310, 4780, 157, 5571, 157, 534, 447, 171, 38, 4788, 4789, 534, 534, 297, 323, 534, 4795, 4796, 399, 534, 534, 4800, 534, 534, 264, 5593, 4805, 534, 472, 4808, 4809, 535, 5600, 157, 38, 113, 4815, 535, 177, 312, 4819, 4820, 4821, 4822, 535, 3479, 414, 1300, 3482, 457, 414, 171, 38, 538, 205, 308, 535, 4836, 535, 112, 4839, 38, 534, 372, 4843, 534, 534, 1320, 538, 4848, 35, 538, 4851, 4852, 477, 4854, 534, 4856, 437, 534, 4859, 194, 4861, 5905, 472, 10, 437, 396, 13, 171, 288, 4870, 17, 18, 19, 4874, 3530, 407, 534, 4878, 206, 4880, 5670, 5671, 3538, 308, 535, 6, 417, 164, 419, 495, 534, 422, 385, 385, 4895, 72, 311, 72, 45, 4836, 537, 136, 491, 6084, 1379, 52, 4843, 491, 141, 149, 476, 4848, 487, 308, 4851, 477, 5590, 168, 535, 535, 3155, 4922, 4923, 168, 330, 3160, 538, 3162, 5796, 534, 402, 78, 534, 443, 265, 177, 4937, 3172, 443, 437, 3175, 208, 3177, 3178, 358, 297, 3181, 437, 4895, 308, 3185, 308, 3187, 2736, 5923, 3190, 399, 38, 534, 4872, 4873, 38, 311, 311, 5832, 202, 179, 179, 156, 534, 534, 2754, 495, 495, 353, 2758, 384, 353, 81, 2762, 153, 513, 315, 6164, 6165, 59, 59, 38, 368, 4940, 3884, 59, 535, 525, 526, 527, 528, 529, 530, 59, 4951, 447, 5003, 534, 2787, 5679, 125, 535, 6, 5010, 423, 399, 470, 3907, 1489, 1490, 141, 1492, 308, 308, 35, 534, 495, 3258, 495, 297, 535, 534, 293, 5384, 534, 5032, 402, 293, 5902, 534, 24, 384, 2821, 308, 384, 538, 316, 388, 538, 388, 5047, 81, 534, 196, 5840, 478, 5842, 447, 201, 177, 2839, 425, 149, 425, 534, 156, 6, 414, 414, 477, 120, 315, 538, 478, 491, 535, 491, 332, 179, 179, 472, 5078, 534, 477, 534, 81, 535, 534, 5672, 5510, 937, 1725, 3246, 977, 1266, 2980, 2889, 5094, 2877, 3656, 4409, 4384, 5686, 6075, 5101, 3007, 3061, 3875, 5437, 252, 5902, 6213, 4574, 5110, 5484, 4382, 4382, 5080, 5460, 3644, 3582, 3203, 6055, 5358, 6202, 2904, 5933, 5932, 5125, 6096, 6237, 2910, 3649, 5125, 4595, 5872, 4621, 4606, 4564, 5875, 3075, 5138, 3075, 5140, 4404, 2924, 3923, 3681, 4590, 5467, 3967, 5119, 2931, 1019, 4657, 2934, 5783, 6322, 6455, 6430, 5451, 2940, 3883, 4629, 6108, 5397, 5657, 310, 1885, 5166, 5885, 5400, 18, 6213, 28, 4685, 5625, 4067, 665, 4032, 5177, 2960, 4688, 5359, 6318, 3091, 1929, 2966, 2748, 4632, 1241, 3560, 5125, 1926, 2973, 1940, 5510, 3978, 5771, 750, 1964, 717, 3815, 4437, 3006, 3732, 6134, 5383, 2987, 6368, 866, 1542, 3037, 4661, 1838, 2690, 4663, 4874, 6295, 5395, 4308, 5620, 3001, 5623, 41, 1438, 6, 41, 5137, 5869, 4731, 1499, 5395, 3012, 5231, 1411, 6034, 3501, 1498, 3516, 2700, 5844, 4244, 1501, 5241, 1496, 3482, 5244, 4262, 5307, 5247, 5248, 5249, 5579, 3479, 5578, 3479, 4309, 6346, 5394, 1940, 6028, 6177, 1943, 407, 5831, 3479, 6384, 5555, 4172, 5845, 3422, 52, 1953, 1954, 5272, 5273, 1455, 2619, 5276, 2620, 5846, 2119, 3404, 3036, 3277, 5795, 3402, 1968, 6386, 3313, 1971, 3392, 4104, 2625, 5292, -1, 925, -1, 5296, -1, 2688, -1, -1, 5439, 5302, -1, -1, -1, 5306, -1, -1, -1, 5310, -1, -1, 5313, -1, 5315, -1, -1, 5905, -1, -1, -1, -1, -1, -1, -1, 5326, -1, -1, 5329, -1, -1, -1, -1, -1, -1, -1, -1, 2021, -1, -1, -1, 2025, 2026, -1, -1, -1, -1, -1, -1, -1, 3585, -1, -1, -1, -1, -1, -1, 5358, 5359, 5360, -1, 5362, -1, -1, -1, -1, 513, -1, -1, 5306, 5319, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 6409, -1, -1, 5326, -1, -1, -1, 5394, 5395, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, -1, 5358, -1, 207, 208, -1, -1, -1, -1, -1, 3665, 215, 3667, 217, 218, -1, -1, -1, 5439, -1, -1, -1, -1, -1, 3227, -1, -1, 231, -1, -1, 5451, -1, -1, -1, -1, 5456, -1, -1, -1, -1, 5461, -1, -1, -1, -1, -1, -1, 3250, 5499, 5470, -1, -1, -1, 10, 3257, -1, 13, -1, -1, 5480, 17, 18, 19, 5484, -1, -1, 5487, 6075, -1, -1, 6431, -1, -1, -1, -1, -1, -1, 5498, 5499, 5500, -1, -1, -1, 6371, -1, -1, -1, -1, 45, -1, -1, -1, 6302, -1, -1, 52, 4410, 5510, 5510, 5510, 5510, 1996, 5510, 5510, -1, 5510, 5510, -1, 5510, 5510, 5510, 5510, -1, 5534, -1, 5510, 5510, 5510, -1, -1, 5510, 78, -1, -1, 4438, -1, -1, 5510, -1, -1, 5551, -1, 5465, 5510, 5555, -1, 5557, -1, 4452, -1, 5600, 6351, 6430, 5500, 6305, 6306, -1, -1, -1, 4463, 5571, -1, -1, -1, -1, -1, 3811, -1, 5579, -1, -1, 5582, 3817, 5496, -1, 5586, -1, 6455, 25, -1, -1, 2066, 5593, -1, 31, -1, -1, 5510, -1, 5600, 4256, -1, -1, -1, 4260, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2099, 6213, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 5641, -1, 5579, -1, -1, 4539, 4540, 5648, 2123, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 5664, 201, -1, -1, -1, -1, 5670, 5671, -1, -1, -1, 5675, 5676, 5677, 5678, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, 5869, -1, -1, -1, -1, 131, 25, 133, -1, -1, -1, -1, 31, -1, 140, -1, 5706, -1, 144, -1, 4365, -1, -1, -1, 5714, -1, 252, 46, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4627, -1, 172, -1, -1, 5739, -1, -1, 5742, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 5767, -1, 4003, -1, 4005, 208, 4007, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4680, -1, -1, -1, -1, -1, -1, -1, 5795, -1, -1, -1, -1, -1, -1, 131, -1, 133, -1, 5742, 5807, -1, -1, -1, 140, -1, -1, 3596, 144, 5816, 5817, 5818, -1, -1, -1, 5822, -1, -1, -1, -1, -1, 5828, -1, -1, 5831, 5744, -1, -1, -1, -1, -1, -1, -1, 5840, 2315, 5842, 172, 5844, 5845, -1, -1, 2102, 2103, -1, 5851, 288, -1, 0, -1, 292, -1, 5858, -1, -1, -1, -1, 2117, -1, -1, 302, 5867, -1, 5869, -1, 407, 2126, -1, -1, -1, 312, 5877, -1, 208, 663, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 682, -1, -1, -1, -1, -1, 688, -1, -1, -1, -1, -1, -1, -1, 5913, 5914, 5851, -1, 700, -1, -1, -1, -1, -1, 3705, 6062, -1, -1, -1, -1, -1, -1, 367, -1, 716, 370, 371, 5848, -1, 721, 4594, 4595, -1, -1, 726, 5944, -1, -1, 730, 731, -1, -1, -1, -1, 99, 737, -1, 739, 740, 5958, 288, -1, -1, -1, 292, -1, -1, 402, -1, -1, 752, 753, -1, -1, 302, -1, -1, -1, 513, -1, -1, 763, -1, -1, 312, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 324, -1, 6135, 6136, -1, 2683, -1, -1, -1, -1, -1, 152, -1, -1, 6009, -1, -1, -1, -1, -1, -1, -1, -1, -1, 165, -1, -1, 5958, -1, 6024, 171, -1, -1, 6028, -1, -1, 177, 815, -1, 6034, -1, -1, 183, 367, 475, 186, 370, 371, 6043, 190, -1, -1, 4940, 831, -1, -1, -1, -1, 4946, 3836, -1, -1, -1, 4951, -1, -1, -1, 6062, -1, -1, -1, -1, -1, -1, 852, 853, -1, -1, 402, 220, -1, -1, 6077, -1, -1, -1, -1, -1, -1, 6084, 4978, 4979, -1, -1, -1, 4983, 4984, -1, 876, -1, 878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, -1, -1, 6110, -1, -1, -1, -1, -1, -1, 6117, 2801, 902, -1, 2804, -1, 2806, 2807, -1, -1, 6127, -1, -1, -1, -1, -1, -1, -1, 6135, 6136, 6137, -1, -1, -1, 6141, 925, -1, -1, -1, 475, 6134, -1, -1, -1, -1, -1, 6134, -1, 938, -1, -1, 304, -1, -1, 6134, 308, -1, 6164, 6165, 6166, -1, 314, -1, -1, -1, 6172, 6173, -1, 2649, 6176, -1, 6134, 6179, -1, 4836, -1, -1, -1, -1, -1, -1, 4843, -1, -1, 6127, -1, 4848, -1, -1, 4851, 6109, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6207, 6247, 2683, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6134, -1, -1, -1, -1, -1, -1, 375, -1, -1, -1, 4015, -1, -1, -1, 6237, 6238, 6239, -1, -1, -1, 6243, -1, -1, -1, -1, -1, -1, -1, -1, 4034, -1, 2728, -1, 4038, -1, -1, -1, 6247, 6261, -1, 1046, 1047, 1048, 6247, -1, 6268, -1, -1, -1, 1055, -1, 6247, -1, 6276, 1060, -1, -1, -1, -1, 1065, 1066, 6284, -1, -1, 1070, 434, 1072, 6290, 6247, -1, 1076, -1, 6295, -1, -1, -1, -1, -1, 6237, 6302, -1, -1, 6443, 6444, 6243, -1, 1092, -1, -1, -1, -1, -1, -1, -1, -1, 464, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6247, -1, -1, 6338, 6339, 6340, 6341, 488, -1, 490, 491, 6346, -1, -1, -1, -1, 6351, -1, 1136, -1, 1138, 1139, -1, -1, -1, -1, 6361, -1, -1, 6364, -1, 512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6368, -1, -1, 6384, -1, 532, 6368, -1, 535, 536, 537, -1, 726, -1, 6368, 1179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6409, 6410, -1, 6368, -1, -1, -1, -1, -1, -1, 752, -1, -1, 3105, 99, 1207, -1, 6426, -1, 6364, -1, -1, -1, -1, -1, -1, 4669, -1, -1, 4672, -1, -1, -1, -1, 6443, 6444, -1, 2700, 6447, -1, 6449, -1, -1, -1, -1, -1, -1, 6368, 1240, -1, -1, -1, -1, -1, -1, -1, -1, 6466, -1, 4702, -1, 5125, -1, 1255, -1, -1, -1, 152, -1, -1, -1, -1, -1, 1265, 1266, -1, -1, 1269, 25, 1271, 165, 5383, -1, -1, 31, -1, 171, -1, -1, -1, -1, -1, 177, -1, -1, 1287, -1, -1, 183, 46, 1292, 186, -1, -1, -1, 190, -1, -1, -1, -1, -1, -1, 1304, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, 220, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 4342, -1, -1, 1346, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, 3261, -1, -1, 3264, -1, 3266, 3267, -1, -1, -1, -1, -1, -1, 78, 1375, 1376, 1377, 133, 1379, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1400, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, -1, -1, -1, 308, -1, 172, -1, -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3124, 5306, -1, -1, 23, -1, -1, -1, -1, 28, -1, -1, 1445, -1, -1, -1, -1, -1, -1, 4903, 208, 5326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1474, -1, -1, -1, -1, -1, -1, -1, 375, -1, 4483, -1, 5358, 4486, -1, -1, -1, 1491, 196, 79, 80, 1495, 1496, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4959, 4960, 96, 1511, -1, -1, -1, 1065, -1, 1517, -1, -1, 224, 225, -1, -1, -1, -1, 1076, -1, 114, -1, -1, 10, -1, 288, 13, -1, -1, 292, 17, 18, 19, 434, 1092, -1, -1, -1, -1, 302, 252, -1, -1, -1, 138, -1, -1, -1, 35, 312, -1, -1, -1, -1, -1, -1, -1, 151, 45, -1, -1, 324, -1, 464, -1, 52, 160, -1, 5686, -1, -1, 3479, -1, -1, 3482, -1, -1, 1585, -1, 173, 4587, -1, -1, 295, -1, 179, -1, 488, -1, 490, 491, 78, -1, -1, 5053, 5054, -1, 4604, 310, -1, -1, 313, -1, -1, 367, -1, -1, 370, 371, -1, -1, 512, 206, -1, -1, -1, -1, -1, 1626, -1, 5500, -1, 3530, -1, -1, -1, -1, -1, -1, -1, 3538, 532, -1, 3332, 535, 536, 537, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 244, 1659, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 266, -1, -1, -1, -1, -1, 4685, -1, -1, 3380, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 407, -1, -1, -1, 5579, 52, -1, -1, -1, -1, 3404, -1, -1, -1, 196, -1, 1269, 475, -1, 201, 1723, -1, -1, -1, -1, -1, 3420, -1, -1, 5183, -1, 78, 5186, 5187, -1, 1738, 1739, 1740, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5207, -1, -1, -1, -1, 347, 348, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5894, -1, -1, -1, 3479, -1, -1, 3482, -1, 379, 25, -1, 382, -1, -1, -1, 31, -1, -1, 389, -1, -1, -1, -1, -1, 513, 396, -1, -1, 399, -1, -1, 295, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 310, -1, 419, 313, 539, -1, -1, 1838, 3530, -1, 427, -1, 3534, -1, 76, -1, 3538, 434, -1, 1850, 437, 196, -1, -1, -1, 442, 201, -1, 3330, 3331, 1861, -1, -1, 3335, -1, -1, -1, -1, -1, 5742, 457, -1, 1873, -1, -1, -1, 1877, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1896, -1, 484, -1, -1, -1, 133, -1, 1904, 3376, 3377, -1, 252, 140, -1, -1, 1912, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 407, -1, -1, 1931, -1, -1, -1, -1, -1, -1, -1, -1, 1940, 172, -1, 1943, -1, -1, 1946, -1, -1, 1949, 1950, 295, -1, 1953, 1954, -1, 1956, 1957, -1, -1, 98, -1, -1, -1, -1, -1, 310, -1, 1968, 313, 1970, 1971, -1, -1, -1, -1, 4975, 208, -1, 5851, 1980, 1981, -1, 1983, 1984, -1, -1, -1, 4987, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2021, -1, 161, -1, 2025, 2026, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 288, -1, 538, 198, 292, -1, 407, -1, -1, -1, -1, 38, -1, -1, 302, -1, -1, -1, -1, 1626, -1, -1, -1, -1, 312, 2082, -1, 2084, -1, 5958, -1, -1, 2089, 2090, -1, 62, 324, -1, -1, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, -1, 248, -1, 2112, -1, 2114, -1, 2116, 2117, 2118, 2119, 2120, 2121, -1, -1, 2124, -1, 2126, 2127, 98, -1, 2130, -1, -1, -1, -1, -1, 367, -1, -1, 370, 371, -1, -1, -1, 2144, 2145, 2146, 2147, -1, -1, 25, -1, -1, -1, 292, -1, 31, -1, -1, -1, -1, -1, -1, 2163, -1, 2165, -1, -1, -1, 513, -1, 402, -1, -1, -1, -1, 5627, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 325, -1, -1, -1, 161, -1, -1, 538, 333, -1, -1, -1, -1, 17, 76, -1, -1, 10, -1, 5205, 13, -1, 26, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 198, 35, 5681, -1, -1, 371, -1, 373, -1, -1, 376, 45, -1, -1, -1, -1, 475, -1, 52, 385, -1, -1, -1, -1, -1, -1, -1, 6127, 394, -1, 133, -1, -1, 6371, -1, -1, 402, 140, -1, 3958, -1, 144, -1, -1, 78, 243, -1, -1, -1, 415, 248, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, 172, -1, 10, 1850, -1, 13, 3994, -1, -1, 17, 18, 19, -1, 2310, 1861, -1, -1, -1, -1, -1, -1, -1, -1, 6430, -1, 292, -1, 35, -1, -1, 1877, -1, -1, -1, -1, -1, 208, 45, 5334, -1, 5336, -1, -1, -1, 52, -1, 5794, -1, 6455, -1, -1, 486, -1, -1, -1, -1, -1, -1, 325, 4256, -1, -1, -1, 4260, -1, -1, 333, 2364, 6237, -1, 78, -1, -1, -1, 6243, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1931, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 1946, -1, -1, 1949, 1950, 371, -1, -1, -1, -1, 376, -1, -1, -1, -1, -1, -1, 288, -1, 385, -1, 292, 224, 225, 2420, -1, -1, -1, 394, -1, -1, 302, -1, -1, 1980, 1981, 402, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, 415, 252, -1, -1, 324, -1, -1, -1, -1, 424, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, 4365, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 450, -1, -1, -1, -1, 196, -1, -1, -1, 295, 201, -1, 6364, -1, -1, 370, 371, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, 224, 225, -1, 486, -1, -1, 4210, 490, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 4234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, 4260, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 295, 17, 18, 19, -1, -1, -1, -1, -1, -1, 2144, -1, -1, -1, -1, 310, 475, 407, 313, 35, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 45, 2614, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 2625, -1, 2627, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4112, -1, -1, 2644, -1, 78, -1, 2648, -1, -1, 2651, -1, 2653, -1, -1, 2656, -1, -1, -1, 2660, -1, -1, 4134, 4135, 4136, 4137, -1, -1, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, -1, -1, 2681, -1, 2683, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4594, 4595, 407, 4168, -1, -1, 2700, -1, -1, -1, -1, -1, -1, 513, -1, 2709, 2710, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, 538, 4204, 4205, -1, 2736, -1, -1, -1, -1, -1, -1, 2743, -1, 6196, -1, 2747, 2748, -1, -1, -1, -1, -1, 2754, -1, -1, -1, 2758, -1, -1, -1, 2762, -1, 196, -1, -1, -1, -1, 201, -1, -1, 2772, -1, -1, -1, -1, 4248, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2787, -1, -1, 2790, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, 2801, 513, 2803, 2804, -1, 2806, 2807, -1, 2809, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 252, 2821, 25, 38, 535, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2839, 2840, -1, -1, -1, -1, -1, -1, 62, -1, 666, -1, -1, -1, -1, 2854, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, 2876, 2877, 310, -1, 2880, 313, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 716, 717, -1, -1, 4594, 2904, -1, 2906, -1, -1, -1, 2910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2924, -1, -1, -1, -1, 4620, 133, 2931, -1, -1, 2934, -1, 4836, 140, -1, -1, 2940, 144, -1, 4843, -1, -1, 161, -1, 4848, -1, -1, 4851, 4852, -1, -1, -1, -1, -1, -1, -1, 2960, -1, -1, -1, -1, -1, 2966, -1, -1, 172, -1, -1, -1, 2973, -1, 407, -1, -1, -1, -1, -1, -1, -1, 198, -1, -1, -1, 2987, -1, -1, -1, -1, -1, -1, -1, 812, 813, -1, 815, 816, -1, 3001, -1, -1, -1, 208, 3006, -1, -1, -1, 827, -1, 3012, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 243, 846, 3030, 3031, 3032, 248, -1, -1, 3036, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6048, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, 3063, 3064, -1, -1, -1, -1, -1, -1, -1, 3072, -1, -1, -1, -1, 292, -1, 4550, -1, 513, -1, -1, -1, 288, -1, -1, -1, 292, 522, 523, 524, 525, 526, 527, 528, 529, 530, 302, -1, 76, -1, 535, -1, 3105, -1, -1, 10, 312, 325, 13, -1, -1, -1, 17, 18, 19, 333, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 3137, -1, -1, -1, 3141, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 4843, -1, -1, -1, 371, 4848, 133, -1, 4851, 376, -1, -1, 367, 140, -1, 370, 371, 144, 385, -1, -1, -1, -1, -1, 78, -1, -1, 394, -1, 4872, 4873, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, 5094, -1, -1, 172, -1, 402, 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5125, -1, 3227, -1, 3229, -1, -1, -1, 208, -1, 450, -1, -1, 1055, -1, -1, -1, -1, -1, -1, -1, 3246, -1, 3248, -1, 3250, -1, -1, 2803, -1, -1, -1, 3257, -1, 2809, -1, 3261, -1, 3263, 3264, -1, 3266, 3267, 3268, -1, -1, 486, 475, -1, -1, 490, 3276, -1, -1, -1, -1, 3281, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 3298, 201, -1, -1, -1, -1, 2854, -1, -1, -1, -1, 4780, -1, -1, -1, 288, -1, -1, -1, 292, -1, -1, 25, -1, 224, 225, -1, -1, 31, 302, -1, -1, 3330, 3331, 3332, 38, -1, 3335, -1, 312, -1, -1, -1, -1, -1, 3343, 3344, 3345, 3346, -1, -1, 324, 252, -1, -1, -1, 3354, 60, -1, -1, -1, 3359, 3360, -1, 3362, -1, 3364, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, 3376, 3377, -1, -1, 3380, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 367, 295, -1, 370, 371, -1, -1, -1, -1, 3401, -1, 3403, -1, 3405, 5306, 112, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3424, -1, 5326, 402, 133, 1246, -1, -1, -1, -1, -1, 140, -1, -1, 1255, 144, -1, -1, -1, -1, 1261, 1262, 5137, -1, 1265, 1266, -1, -1, -1, -1, -1, -1, -1, -1, 5358, -1, -1, -1, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, 1292, -1, -1, -1, 3479, -1, -1, 3482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5394, -1, 3496, -1, -1, 204, 475, 3501, -1, 208, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, 3064, -1, 3516, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, 3530, -1, -1, -1, -1, -1, -1, -1, 3538, 5439, 25, -1, -1, -1, -1, -1, 31, -1, -1, -1, 3550, -1, -1, 3553, -1, 3555, -1, -1, -1, -1, 3560, -1, 267, -1, 1381, -1, -1, 272, -1, -1, -1, -1, 76, 1390, -1, 3575, 3576, -1, -1, -1, -1, 3581, -1, 288, -1, -1, -1, 292, -1, 1406, -1, 76, -1, -1, -1, -1, 3596, 302, -1, 3599, 5500, -1, 3602, -1, -1, -1, -1, 312, -1, -1, 3610, 513, -1, -1, -1, 5306, -1, -1, 323, 324, 522, 523, 524, 525, 526, 527, 528, 529, 530, 133, -1, -1, -1, 535, -1, 3635, 140, -1, -1, -1, 144, 3641, -1, -1, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, 367, -1, -1, 370, 371, 372, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5579, 3680, 3681, 3682, -1, -1, -1, -1, 172, -1, -1, -1, 396, -1, -1, -1, -1, -1, 402, 3248, -1, -1, -1, -1, -1, 208, 3705, -1, -1, -1, -1, -1, -1, 417, 3263, 3714, -1, 3716, -1, 3268, -1, -1, -1, -1, 208, 3724, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3746, -1, 3298, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 475, -1, -1, 5244, 5465, -1, -1, -1, -1, -1, 35, -1, -1, -1, 288, -1, -1, -1, 292, -1, 45, -1, -1, -1, -1, -1, -1, 52, 302, -1, -1, -1, -1, 288, -1, 5496, -1, 292, 312, -1, -1, -1, 3812, -1, 5714, -1, -1, 302, -1, 5510, 324, -1, -1, 78, -1, 5296, -1, 312, -1, -1, -1, -1, -1, -1, -1, -1, 3836, -1, -1, 324, -1, 3841, 5742, -1, -1, -1, -1, 3847, -1, -1, -1, -1, -1, -1, -1, -1, 3856, -1, -1, -1, 1677, -1, -1, 367, -1, -1, 370, 371, 1685, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 367, 3883, 3884, 370, 371, -1, -1, 3889, -1, 3891, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, 3904, -1, 3906, -1, -1, 5600, -1, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, 3926, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, 5851, 3952, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, 475, -1, 3973, 3974, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 475, -1, -1, -1, -1, -1, 3996, 252, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 4015, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, 4034, -1, -1, -1, 4038, 45, 295, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 5742, 3602, 5744, -1, 310, -1, -1, 5958, -1, 3610, -1, 4062, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 4078, -1, 5551, 4081, 1899, -1, -1, -1, 1903, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4101, -1, -1, -1, 4105, 4106, 4107, -1, -1, -1, 5582, 4112, -1, -1, 4115, -1, -1, 4118, -1, -1, -1, -1, -1, 4124, -1, 4126, -1, -1, 4129, -1, -1, -1, 4133, 4134, 4135, 4136, 4137, -1, -1, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, -1, -1, 407, 4153, 4154, 4155, -1, 5848, 4158, -1, -1, -1, 6062, 4163, 3714, -1, 3716, -1, 4168, -1, 4170, -1, 4172, -1, -1, -1, -1, -1, -1, -1, 4180, -1, -1, 4183, -1, 4185, -1, -1, -1, -1, 196, -1, -1, 25, -1, 201, -1, -1, -1, 31, -1, 4201, -1, -1, 4204, 4205, -1, -1, -1, 4209, 4210, -1, -1, -1, 4214, -1, 4216, -1, 224, 225, -1, -1, -1, -1, -1, -1, 2043, 6127, -1, -1, -1, -1, 2049, -1, -1, 6135, 6136, -1, -1, -1, -1, -1, 4242, -1, 76, -1, 252, -1, 4248, -1, -1, -1, -1, -1, -1, -1, 4256, -1, 513, -1, 4260, -1, 3812, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 2095, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, 295, -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, 133, -1, -1, 310, -1, 3856, 313, 140, -1, 4310, -1, 144, -1, -1, -1, 4316, -1, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, 172, -1, 4342, 6243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5831, 6261, -1, -1, -1, 4365, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 208, -1, 17, 18, 19, -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, 407, 3952, -1, 4404, -1, 45, 52, -1, 4409, 4410, 4411, -1, 52, -1, -1, -1, -1, 6109, 198, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 4437, 4438, 78, 6340, -1, -1, 6134, -1, -1, 3996, -1, 35, -1, -1, -1, -1, -1, -1, -1, 288, -1, 45, -1, 292, -1, -1, -1, 6364, 52, -1, -1, -1, 248, 302, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 4483, -1, -1, 4486, -1, -1, -1, -1, 78, 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, 288, 6410, -1, -1, 292, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 6426, -1, -1, 535, -1, 4081, -1, -1, -1, 367, -1, -1, 370, 371, -1, -1, -1, 6443, 6444, 324, 325, -1, -1, -1, 4550, -1, -1, 6024, 333, -1, 6247, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, 25, -1, -1, 402, -1, -1, 31, -1, -1, 4576, 4577, -1, -1, 4580, -1, -1, 4133, -1, 224, 225, 4587, 367, -1, -1, -1, 371, -1, 4594, 4595, -1, 376, -1, -1, -1, -1, -1, -1, 4604, -1, 385, -1, 4158, 196, -1, -1, -1, 252, 201, 394, -1, -1, 76, -1, -1, -1, -1, 402, -1, -1, -1, 4627, -1, -1, -1, -1, 4632, 4633, 4634, -1, 415, 224, 225, -1, -1, -1, -1, 475, 4644, 424, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, 310, -1, -1, 313, 133, -1, 6368, -1, -1, -1, -1, 140, -1, -1, 4685, 144, -1, 4688, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6172, 6173, -1, -1, 6176, -1, 486, 295, -1, -1, -1, -1, -1, 172, 4715, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, 4731, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4749, 208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, 4777, -1, -1, 4780, -1, -1, -1, -1, -1, -1, -1, 4788, 4789, -1, 4791, -1, -1, -1, 4795, 4796, -1, -1, -1, 4800, -1, -1, -1, -1, 4805, -1, -1, 4808, 4809, -1, -1, -1, -1, -1, 4815, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, -1, -1, 292, -1, 4836, -1, -1, -1, -1, -1, -1, 4843, 302, -1, -1, -1, 4848, -1, -1, 4851, 4852, -1, 312, -1, -1, -1, -1, 4859, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, 4870, -1, -1, -1, 513, -1, -1, -1, 4878, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, -1, 4905, -1, -1, -1, 367, -1, -1, 370, 371, -1, -1, -1, -1, 4918, -1, -1, -1, -1, 4923, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 402, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, 2772, -1, -1, 4958, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 4975, -1, -1, -1, -1, 4980, -1, -1, -1, -1, -1, -1, 4987, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 5003, -1, -1, -1, 52, -1, -1, 5010, 2828, -1, -1, -1, -1, -1, 475, -1, -1, -1, 5021, -1, -1, -1, -1, -1, -1, -1, -1, 4580, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5052, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5078, -1, -1, 726, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 5094, 2912, 17, 18, 19, 5099, -1, -1, -1, -1, -1, -1, -1, 752, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 5118, 2936, -1, -1, -1, -1, 45, 5125, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5171, -1, 5173, -1, -1, -1, -1, -1, 224, 225, -1, -1, 3000, -1, -1, -1, 3004, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5205, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3041, -1, 3043, -1, 3045, 3046, -1, 5231, -1, 3050, 3051, 3052, -1, 3054, 3055, 3056, -1, 5241, -1, -1, 5244, -1, -1, 5247, 5248, 5249, 295, -1, -1, -1, -1, -1, -1, 902, -1, -1, -1, -1, -1, 52, -1, 310, -1, -1, 313, -1, -1, -1, 5272, 5273, -1, 196, 5276, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3108, 5292, -1, -1, -1, 5296, -1, -1, -1, -1, -1, 5302, 224, 225, -1, 5306, -1, -1, -1, -1, -1, 5312, 5313, -1, -1, 3133, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5326, -1, -1, 5329, -1, 252, -1, 8, 5334, -1, 5336, -1, -1, 14, 15, -1, -1, -1, -1, 20, -1, 22, -1, -1, -1, -1, -1, 28, -1, 4905, 31, -1, 5358, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, 50, 51, -1, -1, -1, -1, -1, -1, 5383, 5384, -1, -1, -1, -1, 310, -1, -1, 313, -1, 5394, -1, -1, -1, -1, -1, -1, 1046, -1, -1, -1, -1, -1, -1, 4958, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, -1, 3246, 4980, 1076, -1, -1, 5434, -1, -1, -1, -1, 5439, -1, -1, -1, -1, -1, -1, -1, 1092, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 407, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5500, -1, 5052, 5503, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 201, -1, -1, -1, 205, -1, -1, -1, 5534, -1, -1, -1, 213, -1, -1, 216, -1, -1, 219, 220, -1, 222, -1, 224, -1, 5551, 227, -1, 229, 5555, -1, 5557, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5571, 23, -1, -1, -1, -1, 28, -1, 5579, -1, -1, 5582, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 5593, -1, -1, -1, -1, -1, -1, 5600, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 66, -1, -1, -1, -1, -1, -1, -1, 5173, 1269, -1, -1, -1, 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, -1, -1, -1, 96, -1, -1, 5648, -1, -1, -1, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, -1, 114, 5664, -1, 10, -1, -1, 13, 5670, 5671, 5672, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5686, 138, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, 151, 45, -1, -1, -1, -1, 5706, -1, 52, 160, -1, -1, -1, -1, 5714, -1, -1, 5717, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, 179, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, 5742, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 206, -1, -1, -1, -1, 52, -1, 5312, -1, -1, -1, -1, -1, -1, -1, -1, 5771, 5772, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 244, -1, 5795, 5796, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5807, -1, -1, -1, -1, -1, -1, -1, 266, 5816, 5817, 5818, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5831, 5832, -1, -1, 5835, -1, -1, -1, -1, 5840, -1, 5842, -1, 5844, -1, -1, -1, -1, -1, -1, 5851, 196, -1, -1, -1, -1, 201, 5858, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3686, -1, -1, 1517, -1, -1, -1, -1, 5877, -1, -1, 224, 225, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 347, 348, -1, -1, 351, 52, 5902, -1, -1, 5905, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3744, 379, -1, -1, 382, -1, -1, -1, 386, -1, 726, 389, -1, 1585, -1, -1, -1, -1, 396, -1, -1, 399, -1, -1, 295, -1, -1, -1, -1, -1, -1, 5958, -1, -1, -1, -1, 752, -1, -1, 310, -1, 419, 313, -1, -1, -1, -1, -1, -1, 427, -1, -1, -1, -1, 1626, -1, 434, -1, -1, 437, -1, 52, 664, -1, 442, -1, -1, -1, -1, -1, 3814, -1, 450, 675, 452, -1, -1, 679, -1, 457, -1, -1, 6009, -1, 686, 687, -1, 1659, 690, -1, 692, 693, -1, -1, -1, -1, -1, 6024, -1, -1, -1, -1, -1, -1, -1, 707, 484, 6034, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3862, -1, -1, 6048, -1, 725, -1, -1, -1, -1, -1, -1, 3874, 3875, -1, -1, -1, 6062, 407, -1, -1, -1, 3884, -1, -1, -1, 746, 3889, 748, 3891, 6075, -1, -1, 28, -1, -1, -1, -1, 758, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1738, 1739, 1740, -1, -1, -1, -1, -1, -1, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, -1, 902, -1, -1, 791, 6117, -1, -1, 3937, -1, -1, -1, -1, -1, -1, 6127, -1, 79, -1, -1, -1, -1, -1, 6135, 6136, -1, -1, -1, -1, 6141, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, 3972, 3973, -1, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, -1, 513, 120, -1, 6172, 6173, -1, -1, 6176, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 138, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 151, -1, -1, 879, 1850, -1, -1, -1, -1, 160, -1, -1, 6213, -1, -1, 1861, -1, -1, -1, -1, -1, 5772, 173, -1, -1, -1, -1, -1, 179, -1, -1, 1877, -1, -1, -1, 186, 6237, -1, -1, -1, -1, -1, 6243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 206, -1, -1, -1, -1, 6261, -1, -1, -1, -1, -1, -1, 6268, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, 6284, 5835, 1931, 1076, -1, 964, -1, -1, -1, -1, 244, -1, -1, -1, -1, -1, -1, 1946, 6302, 1092, 1949, 1950, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 266, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1980, 1981, 35, -1, -1, 6340, -1, -1, -1, -1, 6345, -1, 45, -1, -1, -1, 6351, -1, -1, 52, -1, -1, -1, -1, -1, 310, -1, 4179, 1038, 6364, -1, -1, -1, -1, -1, -1, 6371, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 337, 1063, -1, -1, -1, -1, -1, -1, -1, -1, 347, 348, -1, -1, 351, -1, 1078, -1, 1080, -1, -1, -1, 6409, 6410, -1, -1, -1, -1, 1090, -1, -1, -1, -1, -1, -1, 1097, -1, -1, -1, 6426, -1, -1, 379, 6430, -1, 382, -1, 726, -1, 386, -1, -1, 389, -1, -1, -1, 6443, 6444, -1, 396, -1, -1, 399, -1, -1, -1, -1, -1, 6455, -1, 2102, -1, -1, 752, -1, -1, -1, -1, 1140, -1, 1142, -1, 419, -1, 2116, 1261, -1, 2119, -1, -1, 427, -1, -1, 1269, -1, 432, -1, 434, -1, -1, 437, -1, -1, -1, -1, 442, -1, -1, -1, -1, -1, 196, 2144, -1, -1, 452, 201, -1, -1, -1, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 471, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, -1, 1216, -1, 1218, -1, 1220, -1, 1222, -1, 1224, 1225, 1226, -1, -1, 252, -1, 1231, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1243, -1, -1, -1, -1, -1, -1, 726, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, 33, 34, 4410, -1, -1, -1, 295, -1, -1, -1, 752, -1, -1, -1, -1, -1, -1, -1, 51, 902, -1, 310, -1, -1, 313, -1, -1, -1, 61, -1, 4438, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, -1, 75, 76, -1, 4453, -1, -1, 4456, 82, 4458, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, 99, -1, -1, -1, -1, 726, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4504, 752, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, -1, 4520, -1, 147, -1, -1, 4525, 407, -1, -1, -1, -1, 156, -1, 158, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, 1517, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 902, -1, -1, -1, -1, -1, -1, 200, -1, -1, -1, -1, 1438, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6345, 1585, -1, -1, -1, 1092, -1, -1, -1, -1, -1, -1, 4624, -1, -1, 4627, -1, 254, 255, -1, 513, -1, -1, 260, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 275, -1, 533, -1, 1626, 902, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 294, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1659, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, 1559, -1, -1, 4704, 4705, 4706, 4707, 333, 4709, 4710, 4711, 4712, 4713, -1, -1, -1, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1065, 357, -1, -1, -1, -1, -1, 363, 364, -1, 366, 1076, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, -1, -1, 380, -1, -1, 1092, -1, -1, -1, 387, -1, -1, -1, -1, -1, -1, 394, 395, -1, -1, 1631, -1, -1, -1, 402, -1, -1, -1, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 417, -1, 1269, -1, -1, -1, -1, 2627, -1, -1, -1, -1, -1, -1, -1, -1, -1, 434, -1, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, -1, 4827, -1, 1076, 455, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 467, -1, -1, 1092, -1, -1, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 491, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1850, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1861, 515, -1, 517, 518, 519, 520, 521, -1, -1, -1, -1, -1, -1, -1, -1, 1877, -1, -1, -1, 534, -1, -1, 537, -1, -1, 2743, -1, -1, -1, 2747, 2748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1931, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1946, 2803, -1, 1949, 1950, -1, -1, 2809, -1, -1, -1, -1, -1, -1, 1846, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1980, 1981, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1269, 1881, -1, -1, 2854, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1517, -1, -1, -1, -1, -1, -1, -1, 5050, 5051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5063, -1, 5065, 5066, 5067, -1, 1927, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1947, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1585, -1, -1, -1, -1, 1973, 0, 1975, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5131, 1990, -1, 1992, -1, 20, -1, -1, -1, 1998, -1, 2000, -1, 2002, -1, 2004, 31, 2006, 33, 34, 1626, 2010, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, 5170, -1, 2144, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, 1517, 1659, -1, -1, -1, -1, 73, -1, 75, 76, -1, 52, -1, -1, -1, 82, -1, 84, -1, -1, -1, 3032, -1, -1, -1, -1, -1, -1, -1, 2070, 97, 5214, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, 119, 3064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 134, 1585, 136, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, 147, -1, -1, -1, -1, -1, -1, 1517, -1, 156, -1, 158, 10, -1, -1, 13, -1, -1, 165, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, 1626, -1, -1, -1, -1, -1, -1, 183, 35, -1, -1, -1, -1, -1, -1, -1, -1, 3137, 45, -1, -1, 3141, -1, -1, 200, 52, -1, -1, -1, -1, -1, -1, -1, 1659, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1585, 10, -1, -1, 13, 78, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, 254, 255, -1, -1, 45, 1850, 260, -1, -1, 1626, -1, 52, -1, 5383, -1, -1, 1861, -1, -1, -1, -1, 275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1877, -1, -1, -1, -1, 78, -1, -1, 294, -1, 1659, -1, -1, -1, -1, -1, -1, -1, 3248, -1, -1, -1, -1, -1, -1, -1, -1, 5429, -1, -1, -1, 52, -1, 3263, -1, -1, 5438, -1, 3268, -1, -1, -1, -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, -1, -1, 1931, -1, 342, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, 3298, 1946, -1, 357, 1949, 1950, -1, -1, -1, 363, 364, -1, 366, -1, -1, -1, -1, 371, -1, 224, 225, -1, -1, 377, -1, -1, 380, -1, -1, -1, -1, -1, -1, 387, -1, 1980, 1981, -1, -1, -1, 394, 395, -1, -1, -1, -1, 1850, 252, 402, -1, -1, -1, 406, -1, -1, 196, -1, 1861, -1, -1, 201, -1, -1, 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1877, -1, -1, -1, -1, -1, -1, 434, -1, -1, 224, 225, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 455, -1, -1, -1, 310, -1, 52, 313, -1, -1, 252, -1, 467, -1, -1, -1, -1, -1, 473, -1, -1, -1, -1, 478, -1, -1, 1931, -1, -1, -1, -1, -1, 1850, -1, -1, -1, 491, -1, -1, -1, -1, 1946, -1, 1861, 1949, 1950, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, 1877, 515, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, 1980, 1981, -1, -1, 534, -1, -1, 537, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 2144, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 1931, -1, 5686, -1, -1, -1, 5690, -1, -1, 45, -1, -1, -1, -1, -1, 1946, 52, -1, 1949, 1950, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3550, -1, -1, 3553, 78, 3555, -1, -1, -1, -1, 3560, 1980, 1981, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2743, -1, -1, 3602, 2747, 2748, -1, 513, -1, -1, -1, 3610, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, 3635, -1, -1, 2144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2803, -1, -1, -1, -1, -1, 2809, -1, -1, -1, -1, 513, -1, 196, -1, -1, -1, -1, 201, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, 726, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, 2737, 2738, -1, 2854, -1, -1, -1, 3714, -1, 3716, -1, -1, -1, -1, -1, 752, -1, -1, 2144, 2756, 2757, 252, 2759, 2760, -1, -1, 5905, -1, 2765, 2766, 5909, -1, 5911, -1, -1, -1, 5915, 5916, -1, -1, -1, -1, -1, 2780, -1, -1, -1, 2784, -1, -1, -1, 2788, 2789, -1, -1, 2792, 2793, -1, -1, -1, -1, -1, 2799, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2811, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, 2823, -1, -1, -1, -1, 2828, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2841, 3812, -1, -1, 2845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2856, -1, -1, 2859, -1, 2861, 2862, 2863, -1, -1, -1, -1, 2868, 2869, -1, 3841, -1, -1, -1, -1, -1, 3847, 2878, -1, -1, -1, -1, -1, 2884, -1, 3856, -1, 2888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2900, 2901, 902, -1, -1, 2905, -1, -1, -1, -1, -1, 2911, 2912, 407, 3884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2925, -1, -1, 2928, -1, -1, -1, -1, -1, -1, 2935, 2936, -1, -1, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, 3064, -1, -1, 2953, -1, -1, 2956, -1, -1, -1, -1, 2961, -1, -1, -1, 726, -1, 2967, 2968, -1, -1, -1, -1, -1, -1, 2975, -1, -1, -1, 2979, -1, -1, 3952, 2983, 2984, 2985, 2986, -1, 2988, -1, -1, 752, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3002, 3003, 3974, 3005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3016, 3017, 3018, 513, -1, -1, -1, 3137, -1, -1, 3996, 3141, 522, 523, 524, 525, 526, 527, 528, 529, 530, 10, -1, -1, 13, 535, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, 1065, -1, -1, -1, -1, -1, 6213, 45, 3073, -1, -1, 1076, -1, -1, 52, -1, 3081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1092, -1, -1, -1, -1, -1, -1, -1, 3100, -1, -1, -1, -1, 78, -1, -1, -1, 726, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2743, -1, -1, -1, 2747, 2748, -1, -1, 3248, 752, -1, -1, -1, -1, -1, 902, -1, -1, -1, -1, -1, -1, -1, 3263, 3150, -1, -1, -1, 3268, -1, -1, -1, -1, -1, -1, -1, -1, 4133, -1, -1, -1, -1, -1, 3169, 10, 3171, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 3298, -1, 2803, -1, 4158, -1, -1, -1, 2809, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 6371, -1, -1, -1, -1, -1, -1, 6378, 2854, 78, -1, 6382, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, 2743, -1, 1269, 3270, 2747, 2748, -1, 6416, -1, -1, -1, -1, 252, -1, -1, -1, 10, -1, 902, 13, -1, 6430, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, 35, -1, -1, -1, -1, 6455, -1, 1076, 6458, -1, 45, -1, -1, -1, 295, -1, -1, 52, -1, 2803, -1, -1, -1, 1092, -1, 2809, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, 78, -1, -1, 2743, -1, 196, -1, 2747, 2748, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2854, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 2803, -1, -1, -1, -1, -1, 2809, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, 3550, -1, -1, 3553, 4410, 3555, -1, -1, -1, -1, 3560, 3064, 1065, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, 1076, -1, -1, -1, -1, -1, 2854, -1, -1, 4438, 196, 310, -1, -1, 313, 201, 1092, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3602, -1, -1, -1, -1, -1, -1, -1, 3610, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, 1517, -1, -1, 3137, 3635, -1, -1, 3141, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, 407, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, 1585, 313, -1, 3064, -1, -1, -1, -1, -1, -1, -1, -1, 3597, -1, -1, 3714, -1, 3716, -1, -1, -1, -1, -1, -1, -1, 4580, -1, -1, -1, 3614, -1, -1, -1, 3618, -1, -1, -1, -1, 3623, 3624, 3625, 1626, -1, 25, -1, -1, 3248, -1, -1, 31, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, 3645, 3263, -1, -1, -1, -1, 3268, 1269, -1, -1, -1, -1, 4627, -1, 1659, -1, 3137, 4632, 60, -1, 3141, -1, -1, 3668, 3669, 3670, 3671, -1, 513, -1, 3064, -1, -1, -1, 76, 407, 3298, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, 3812, -1, -1, -1, -1, -1, -1, -1, 3706, -1, 3708, 3709, 3710, -1, -1, -1, -1, 112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, 3856, 140, -1, -1, -1, 144, 3137, -1, -1, -1, 3141, -1, -1, -1, 1517, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3884, -1, 3248, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 3263, -1, -1, -1, -1, 3268, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 204, 535, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4791, 3298, -1, 1585, -1, -1, -1, 3828, -1, -1, -1, -1, -1, -1, -1, -1, 3837, 3952, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1850, -1, -1, -1, -1, -1, -1, -1, -1, 3248, 3974, 1861, -1, 3863, 3864, 1626, -1, -1, 3868, -1, 267, -1, -1, -1, 3263, 272, -1, 1877, -1, 3268, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, 3890, 288, -1, -1, -1, 292, -1, -1, 1659, -1, 1517, -1, -1, -1, -1, 302, -1, -1, -1, 3298, -1, -1, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, 324, -1, -1, -1, 1931, -1, 3550, -1, 4905, 3553, -1, 3555, 726, -1, -1, 3942, 3560, -1, -1, 1946, 3947, -1, 1949, 1950, -1, -1, 3953, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 752, -1, 4081, 1585, -1, 367, -1, -1, 370, 371, 372, -1, -1, -1, -1, 1980, 1981, -1, 3983, -1, 3602, -1, -1, 4958, -1, -1, -1, -1, 3610, -1, -1, -1, -1, -1, 396, -1, -1, -1, -1, -1, 402, -1, -1, -1, 1626, 4980, -1, 4012, -1, 4014, -1, -1, -1, 3635, 4133, 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1659, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3550, -1, -1, 3553, 475, 3555, -1, -1, 5052, -1, 3560, -1, -1, -1, -1, 1850, -1, -1, -1, -1, -1, -1, -1, 3714, -1, 3716, 1861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 902, 1877, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3602, -1, -1, -1, -1, -1, 10, -1, 3610, 13, -1, -1, -1, 17, 18, 19, -1, -1, 2144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, 3635, -1, 3550, -1, -1, 3553, -1, 3555, 45, -1, -1, 1931, 3560, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1946, -1, -1, 1949, 1950, -1, -1, -1, -1, -1, 3812, -1, -1, -1, -1, 78, 5171, 4316, 5173, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3602, -1, -1, -1, -1, -1, 1980, 1981, 3610, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1850, -1, -1, -1, -1, 3714, 3856, 3716, -1, -1, -1, 1861, -1, 3635, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1877, -1, -1, -1, -1, -1, -1, 3884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1065, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1076, -1, -1, -1, 171, -1, -1, 4410, -1, -1, 177, -1, -1, -1, -1, -1, 1092, -1, -1, -1, -1, -1, -1, -1, -1, 1931, -1, -1, -1, 196, -1, -1, -1, -1, 201, 4438, 3714, -1, 3716, 4328, 1946, 4330, -1, 1949, 1950, -1, 3952, 3812, -1, -1, -1, -1, -1, 5312, 4343, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, 4355, -1, 3974, -1, 4359, -1, -1, -1, 1980, 1981, -1, -1, -1, 10, -1, 4370, 13, -1, -1, 252, 17, 18, 19, -1, 3996, 3856, -1, -1, 2144, -1, -1, -1, -1, -1, 4389, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, 4407, 3884, -1, 52, -1, -1, 5383, -1, 4415, -1, 295, -1, -1, -1, -1, -1, 3812, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, 78, -1, -1, -1, 4440, -1, -1, -1, 4444, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4459, 4460, 4461, 4462, -1, 4081, -1, 4580, 3856, -1, 4469, 4470, 4471, 4472, -1, -1, -1, 3952, -1, 4478, 4479, -1, -1, 1269, -1, 4484, 4485, -1, 4487, 4488, 4489, 4490, 4491, 4492, 4493, -1, 3884, -1, -1, 3974, -1, -1, -1, -1, 4503, -1, -1, -1, 4507, 4508, 4509, 4510, -1, -1, 4627, -1, -1, 4133, -1, 4632, -1, 3996, -1, -1, -1, -1, -1, -1, 2144, -1, 407, -1, 4531, -1, 5503, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, 4549, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, 3952, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 3974, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 4081, 52, 3996, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4625, -1, -1, -1, -1, -1, -1, 78, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 295, -1, -1, -1, 4133, 4658, -1, -1, -1, -1, -1, -1, 4665, -1, 4667, 310, -1, -1, 313, -1, -1, -1, -1, -1, 4791, -1, -1, -1, -1, 4158, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, 4081, -1, -1, 4695, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, 1517, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 2743, 4133, -1, -1, 2747, 2748, 45, 196, -1, -1, -1, -1, 201, 52, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 4905, -1, 4410, -1, -1, -1, -1, 1585, -1, -1, 5771, 5772, 2803, -1, -1, 252, -1, -1, 2809, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4438, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 207, 208, 1626, 4316, -1, -1, -1, 4958, 215, -1, 217, 218, 295, -1, -1, -1, -1, 2854, -1, -1, -1, -1, -1, -1, 231, -1, -1, 310, 5835, 4980, 313, -1, -1, -1, 513, 1659, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 4906, 4907, 4908, -1, -1, -1, 4912, 4913, 4914, 4915, -1, -1, -1, 4919, -1, -1, -1, -1, -1, -1, -1, 4316, 224, 225, -1, -1, -1, -1, 4410, -1, -1, -1, 5052, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, 407, 4438, 4580, -1, -1, -1, -1, -1, -1, 4970, 4971, 4972, 4973, 4974, -1, 4976, 4977, -1, -1, -1, -1, 2743, -1, -1, -1, 2747, 2748, 4988, 4989, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4627, -1, -1, -1, 310, 4632, -1, 313, -1, -1, -1, 4410, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2803, -1, -1, -1, -1, -1, 2809, 4438, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5173, -1, -1, -1, 1850, 3064, -1, -1, 513, -1, -1, -1, -1, -1, -1, 1861, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 1877, -1, -1, 2854, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4580, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5124, -1, 2743, -1, -1, -1, 2747, 2748, -1, -1, -1, -1, -1, 3137, -1, -1, -1, 3141, -1, -1, 1931, -1, -1, -1, -1, -1, -1, 4627, -1, -1, -1, -1, 4632, -1, -1, 1946, -1, -1, 1949, 1950, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4791, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2803, -1, -1, 5189, -1, 4580, 2809, 1980, 1981, -1, -1, -1, 5312, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, 5222, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 2854, 4627, 535, -1, -1, -1, 4632, -1, -1, -1, -1, 3248, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3263, -1, -1, -1, -1, 3268, 5383, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4905, -1, -1, -1, -1, 663, -1, -1, -1, -1, 3298, -1, -1, -1, -1, 3064, -1, -1, -1, -1, -1, -1, -1, -1, 682, -1, -1, 4791, -1, -1, 688, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 700, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4958, -1, -1, -1, -1, 716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2144, -1, -1, 730, 731, -1, 4980, -1, -1, -1, 737, -1, 739, 740, -1, -1, -1, -1, 6345, 3137, -1, -1, -1, 3141, -1, -1, 753, -1, 5385, -1, -1, -1, 5503, -1, -1, -1, 763, -1, -1, -1, -1, -1, -1, -1, -1, 4791, -1, 5404, -1, -1, -1, -1, -1, 5410, 5411, -1, -1, -1, -1, -1, -1, -1, -1, 5420, -1, -1, -1, -1, -1, -1, 5427, -1, 4905, -1, -1, -1, -1, -1, 5052, -1, -1, -1, 6409, -1, -1, -1, -1, -1, 815, -1, 3064, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 831, 5462, 5463, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5475, 35, 5477, -1, -1, -1, -1, 4958, -1, -1, -1, 45, 3248, -1, -1, -1, -1, 5492, 52, -1, -1, -1, -1, -1, -1, -1, -1, 3263, -1, 4980, -1, 876, 3268, -1, -1, -1, -1, -1, -1, -1, -1, 4905, 5517, -1, 78, 3137, -1, -1, -1, 3141, 5525, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3298, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, -1, -1, 3550, -1, -1, 3553, -1, 3555, 5173, -1, -1, -1, 3560, -1, -1, -1, -1, -1, -1, -1, 938, 4958, -1, -1, -1, -1, -1, -1, 5052, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3602, -1, -1, -1, -1, -1, -1, -1, 3610, -1, -1, -1, -1, 5615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5629, -1, 3248, -1, -1, -1, 3635, -1, 196, -1, -1, -1, -1, 201, -1, 199, 200, 3263, -1, 203, -1, -1, 3268, -1, 5653, -1, -1, -1, -1, 5772, -1, -1, -1, -1, 5052, -1, 224, 225, -1, 223, -1, -1, -1, -1, -1, -1, 230, -1, -1, 1048, -1, -1, 3298, -1, -1, -1, 1055, -1, -1, -1, -1, -1, -1, -1, 252, -1, 5312, 1066, 5173, -1, -1, 1070, -1, 1072, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3714, -1, 3716, -1, -1, -1, 5720, 5835, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5383, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5173, -1, -1, -1, -1, 3550, 5790, -1, 3553, -1, 3555, -1, -1, -1, -1, 3560, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1179, -1, -1, 3812, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5824, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 5312, -1, -1, -1, -1, 3602, -1, -1, -1, -1, -1, -1, 407, 3610, -1, 35, -1, -1, -1, -1, 3856, -1, -1, -1, -1, 45, -1, -1, -1, 5865, -1, -1, 52, -1, 1240, -1, -1, -1, 3635, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3884, 1255, 5503, -1, -1, 5889, -1, -1, -1, -1, 78, 1265, 1266, -1, -1, -1, -1, 1271, -1, -1, -1, -1, -1, 5383, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1287, -1, -1, -1, -1, 1292, 5312, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3550, -1, -1, 3553, -1, 3555, -1, -1, -1, -1, 3560, -1, -1, -1, -1, -1, 5949, -1, -1, 3952, 3714, 513, 3716, 2743, -1, -1, -1, 2747, 2748, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 3974, -1, 535, -1, -1, 10, -1, -1, 13, -1, -1, 3602, 17, 18, 19, -1, -1, -1, -1, 3610, 5383, -1, 3996, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 196, -1, 45, -1, 2803, 201, 3635, -1, -1, 52, 2809, -1, -1, -1, -1, 5503, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5654, -1, -1, 224, 225, 5659, 5660, -1, -1, -1, 78, -1, -1, -1, 3812, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6061, -1, -1, -1, -1, -1, 2854, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6094, 3856, -1, 3714, -1, 3716, -1, -1, -1, -1, 1474, 6105, -1, -1, -1, -1, -1, 295, -1, -1, 5503, -1, -1, 672, -1, 674, -1, -1, 677, 3884, -1, -1, 310, -1, -1, 313, -1, -1, -1, 4133, -1, -1, 691, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5772, -1, -1, 4158, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, -1, -1, -1, -1, -1, 3952, -1, 224, 225, 3812, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3974, -1, -1, -1, -1, 5835, -1, -1, 252, -1, 407, 208, -1, -1, 6227, -1, -1, -1, 6345, -1, 217, -1, 3996, -1, -1, -1, 3856, -1, -1, -1, -1, -1, -1, -1, 231, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, 5654, -1, 3884, -1, -1, 5659, 5660, -1, -1, -1, -1, -1, 3064, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5772, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, 3952, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 3137, 535, -1, 1723, 3141, -1, -1, 3974, -1, 5835, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, 4133, -1, -1, -1, 407, -1, -1, 3996, -1, 10, -1, 5772, 13, 35, -1, -1, 17, 18, 19, -1, -1, -1, -1, 45, -1, 4158, -1, -1, -1, -1, 52, -1, -1, -1, 35, -1, -1, -1, 4410, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 78, -1, -1, -1, -1, 6433, -1, -1, 991, 992, 4438, -1, -1, -1, -1, -1, -1, -1, 5835, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3248, -1, -1, 4081, -1, -1, -1, 1838, -1, -1, -1, -1, -1, -1, -1, 3263, -1, -1, -1, -1, 3268, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 1873, 535, -1, -1, 1062, -1, -1, -1, 3298, -1, -1, -1, -1, 4133, -1, -1, -1, -1, -1, 1077, -1, -1, -1, 1896, -1, -1, -1, -1, -1, -1, -1, 1904, -1, -1, -1, -1, -1, -1, 4158, 1912, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, 1108, 1109, 4316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, 224, 225, -1, -1, -1, 1134, 4580, -1, -1, 1953, 1954, -1, 1956, 1957, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 1968, -1, 1970, 1971, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1983, 1984, -1, -1, -1, -1, 1174, 1175, -1, -1, 252, -1, -1, -1, 4627, -1, -1, -1, -1, 4632, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, 4410, -1, 2021, -1, -1, -1, 2025, 2026, -1, -1, -1, 310, -1, -1, 313, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4438, -1, 663, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 682, 4316, -1, -1, -1, -1, 688, -1, -1, -1, -1, 221, -1, -1, -1, -1, -1, -1, 700, -1, 10, -1, 232, 13, -1, -1, -1, 17, 18, 19, 6345, -1, -1, -1, 716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 731, -1, -1, -1, -1, -1, 45, -1, 739, -1, 407, -1, -1, 52, -1, -1, 3550, -1, -1, 3553, -1, 3555, 753, -1, -1, -1, 3560, -1, -1, -1, -1, 407, 763, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 4791, -1, 4410, -1, 2165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3602, -1, -1, -1, 4580, -1, 4438, -1, 3610, -1, -1, -1, -1, -1, -1, -1, 815, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 831, 3635, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, 4627, -1, -1, 6345, -1, 4632, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 513, 535, -1, -1, -1, -1, -1, -1, 876, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 196, 4905, 535, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3714, -1, 3716, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 938, -1, 6345, -1, 4958, -1, 252, -1, -1, 4580, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, 4627, -1, -1, -1, -1, 4632, -1, -1, 310, -1, -1, 313, -1, 1578, -1, 3812, -1, -1, -1, -1, 4791, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1603, -1, -1, -1, 5052, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1048, -1, -1, -1, -1, 3856, -1, 1055, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1680, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4905, -1, -1, -1, -1, -1, -1, -1, 664, -1, 1709, 1710, 1711, 1712, 670, -1, -1, -1, -1, -1, -1, 3952, -1, -1, -1, -1, -1, -1, -1, 5173, 4791, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3974, -1, -1, -1, -1, -1, -1, -1, 1179, -1, 4958, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4980, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1255, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1265, 1266, -1, -1, -1, -1, 1271, 4905, -1, -1, 5052, -1, -1, 4081, -1, -1, 10, -1, -1, 13, 1856, 1857, 1287, 17, 18, 19, -1, 1292, -1, -1, 2681, 5312, -1, -1, -1, -1, 1872, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 4958, 854, -1, -1, -1, 4133, -1, -1, -1, -1, 1906, 1907, 1908, 1909, 867, -1, -1, -1, -1, -1, -1, -1, 4980, -1, 78, 2736, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5383, 2754, -1, -1, -1, 2758, -1, -1, -1, 2762, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2772, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5173, -1, -1, -1, -1, 2787, -1, -1, -1, -1, -1, -1, -1, -1, -1, 939, -1, -1, -1, -1, 1987, -1, 2804, 5052, 2806, 2807, 1993, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 2821, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2839, 2840, -1, 35, -1, 986, -1, 39, -1, -1, -1, -1, -1, 45, 196, -1, -1, -1, -1, 201, 52, 1474, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5503, -1, -1, 2876, 2877, -1, -1, 2880, 224, 225, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, 2904, -1, 2906, -1, 10, 252, 2910, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 5312, -1, -1, 2924, -1, 5173, -1, -1, -1, -1, 2931, -1, 35, 2934, -1, -1, 130, -1, -1, 2940, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 295, -1, -1, -1, -1, -1, -1, 1101, 2960, -1, -1, -1, -1, -1, 2966, 310, -1, -1, 313, -1, -1, 2973, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2987, 1130, 1131, 1132, -1, 5383, 4410, -1, -1, -1, -1, 341, -1, -1, 3001, -1, 196, -1, -1, 3006, -1, 201, -1, -1, -1, 3012, -1, -1, -1, -1, -1, 2203, -1, -1, 4438, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, 407, 5312, -1, -1, 170, -1, -1, -1, 3072, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, 1239, -1, 201, -1, -1, 295, -1, -1, -1, -1, -1, -1, 1723, -1, -1, 5503, -1, -1, -1, -1, 310, -1, -1, 313, -1, 224, 225, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 5383, 17, 18, 19, -1, -1, 5772, -1, 1286, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, 4580, -1, 45, -1, -1, -1, -1, 513, -1, 52, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 5835, -1, -1, 310, -1, 4627, 313, -1, -1, 407, 4632, -1, -1, -1, -1, -1, -1, -1, 10, 1838, -1, 13, 3227, -1, 3229, 17, 18, 19, -1, -1, -1, -1, 339, -1, -1, -1, -1, -1, -1, -1, -1, 3246, -1, 35, -1, 3250, -1, -1, -1, -1, -1, 5503, 3257, 45, 1873, -1, -1, -1, 5654, 3264, 52, 3266, 3267, 5659, 5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, 472, -1, -1, 1896, -1, -1, 1427, -1, -1, -1, -1, 1904, 78, -1, -1, -1, -1, -1, -1, 1912, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 196, -1, 13, -1, 513, 201, 17, 18, 19, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 35, -1, 1956, 1957, 224, 225, -1, -1, -1, -1, 45, -1, -1, -1, 3354, -1, 1970, 52, -1, -1, 3360, -1, -1, -1, -1, 1507, -1, -1, -1, 1983, 1984, -1, 252, -1, 4791, -1, -1, -1, -1, -1, -1, 5772, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5654, -1, 196, -1, 513, 5659, 5660, 201, 295, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 310, -1, -1, 313, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, 5835, -1, -1, -1, -1, 1591, -1, -1, -1, -1, -1, -1, -1, -1, 1600, -1, -1, -1, 2647, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4905, -1, 1632, -1, -1, -1, -1, -1, 1638, 1639, -1, -1, 1642, 196, -1, -1, -1, -1, 201, -1, 295, -1, -1, -1, -1, 1655, -1, -1, 1658, -1, -1, -1, -1, -1, -1, 310, -1, 5772, 313, 407, -1, 224, 225, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 4958, -1, -1, 17, 18, 19, -1, -1, -1, -1, 2165, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, 35, 4980, -1, 38, -1, -1, -1, -1, -1, 1713, 45, -1, -1, 3575, 3576, -1, -1, 52, -1, -1, -1, -1, -1, 1727, -1, -1, 5835, -1, -1, -1, -1, -1, -1, -1, 3596, -1, -1, 3599, 295, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, 407, -1, -1, -1, -1, 2810, -1, -1, -1, -1, -1, -1, -1, 513, -1, 5052, -1, -1, -1, 334, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3680, 3681, 3682, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1837, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3705, 1848, -1, -1, -1, -1, -1, 407, -1, -1, 6345, -1, -1, -1, -1, -1, -1, -1, 196, 3724, 512, 513, -1, 201, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 3746, -1, 1890, 1891, -1, 224, 225, -1, -1, -1, 5173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2952, -1, -1, 2955, -1, -1, 1915, -1, -1, -1, -1, -1, 252, 1922, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, 295, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3836, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1995, -1, -1, -1, -1, -1, 3044, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3057, -1, -1, -1, -1, -1, -1, -1, 3065, -1, -1, 3883, -1, -1, 2028, 2029, -1, 3889, -1, 3891, -1, -1, -1, 5312, -1, -1, -1, -1, -1, -1, -1, -1, 3904, -1, 3906, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 3104, -1, 17, 18, 19, -1, -1, 2068, -1, -1, 2071, -1, -1, -1, -1, 407, -1, -1, -1, -1, 35, 3125, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, 6345, -1, 52, -1, -1, -1, -1, 10, -1, -1, 13, -1, 5383, -1, 17, 18, 19, -1, -1, 3973, -1, -1, -1, -1, -1, -1, -1, -1, 78, 3168, -1, 3170, 35, -1, -1, 38, -1, 10, -1, -1, 13, -1, 45, -1, 17, 18, 19, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4015, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 78, -1, -1, -1, 52, 4034, -1, -1, -1, 4038, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 78, -1, -1, 4062, -1, -1, -1, -1, 2681, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3262, -1, -1, -1, 177, -1, -1, 3269, -1, 5503, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6345, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2736, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2754, -1, -1, -1, 2758, -1, -1, 196, 2762, -1, -1, -1, 201, -1, -1, -1, 252, -1, 2772, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4170, -1, -1, 2787, -1, 224, 225, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, 252, -1, 224, 225, 2821, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, 2839, 2840, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, 5654, -1, -1, -1, -1, 5659, 5660, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 852, 853, -1, -1, 310, 2876, 2877, 313, -1, 2880, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2904, 310, 2906, -1, 313, -1, 2910, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 2924, 407, -1, -1, -1, -1, -1, 2931, -1, -1, 2934, -1, -1, -1, 35, -1, 2940, 38, -1, -1, 925, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 4342, -1, -1, -1, 2960, -1, -1, -1, -1, -1, 2966, -1, -1, 5772, -1, -1, 407, 2973, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 2987, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3001, 407, -1, -1, -1, 3006, -1, -1, -1, -1, -1, 3012, -1, -1, -1, -1, -1, 4404, -1, -1, -1, -1, 4409, -1, 4411, -1, -1, -1, -1, -1, 513, 5835, -1, 3605, 3606, -1, -1, 443, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 4437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1046, 1047, -1, -1, -1, -1, -1, 3072, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 2624, 4483, -1, 196, 4486, -1, -1, -1, 201, -1, 2634, -1, 513, -1, -1, -1, -1, -1, 2642, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, 2689, 2690, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 10, -1, -1, 13, -1, 52, -1, 17, 18, 19, -1, -1, -1, -1, -1, 4576, 4577, -1, -1, -1, 2723, -1, -1, 295, -1, 35, 4587, -1, -1, -1, -1, 78, -1, -1, -1, 45, -1, -1, 310, -1, -1, 313, 52, 4604, -1, -1, -1, -1, -1, -1, -1, -1, 3227, -1, 3229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, 3246, -1, -1, -1, 3250, 10, -1, -1, 13, -1, -1, 3257, 17, 18, 19, -1, -1, -1, -1, 1392, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 35, -1, 17, 18, 19, -1, -1, -1, -1, -1, 45, 3858, -1, -1, -1, -1, -1, 52, -1, -1, 35, -1, -1, 4685, -1, -1, 4688, -1, -1, -1, 45, -1, 1435, -1, 407, -1, -1, 52, -1, -1, -1, -1, -1, 78, -1, -1, -1, 1304, 196, -1, -1, -1, -1, 201, 2858, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, 177, -1, -1, 2873, -1, -1, -1, -1, -1, -1, 224, 225, 3354, -1, -1, -1, -1, -1, 3360, 196, -1, -1, -1, 1346, 201, 2895, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, 1375, 1376, 1377, -1, 1379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 150, -1, -1, -1, -1, 513, 252, 177, 1400, -1, -1, -1, 295, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 196, 310, -1, -1, 313, 201, -1, -1, -1, -1, 4018, -1, -1, -1, -1, -1, 2981, 2982, -1, -1, 196, 330, -1, 295, -1, 201, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1491, -1, -1, 252, 1495, 1496, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4918, -1, -1, 407, 295, -1, -1, -1, -1, -1, 6345, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, 3083, 295, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 310, 407, -1, 313, 3575, 3576, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, 4975, -1, -1, -1, 45, -1, -1, 3596, -1, -1, 3599, 52, 4987, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1744, -1, -1, -1, 1748, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 5021, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, 407, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, 3680, 3681, 3682, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3705, -1, -1, -1, -1, -1, -1, -1, 5099, -1, -1, -1, -1, -1, 171, -1, -1, -1, -1, 3724, -1, -1, -1, -1, -1, -1, -1, 5118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, 3746, -1, -1, 201, -1, -1, -1, -1, 513, -1, -1, 1738, 1739, 1740, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 224, 225, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, 10, -1, 252, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5205, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 3836, -1, -1, -1, 52, -1, 10, 295, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, 78, 35, -1, -1, -1, -1, -1, 10, -1, -1, 13, 45, -1, -1, 17, 18, 19, 3883, 52, -1, -1, -1, -1, 3889, -1, 3891, -1, -1, -1, -1, -1, -1, 35, -1, -1, 38, -1, 3431, 3904, -1, 3906, -1, 45, -1, 78, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, 3449, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 5334, -1, 5336, -1, -1, -1, -1, 407, -1, -1, -1, -1, 2087, -1, -1, 4534, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3973, -1, -1, -1, 4548, -1, -1, -1, -1, -1, -1, 196, -1, 2113, -1, -1, 201, 2117, -1, -1, -1, -1, -1, -1, -1, 5384, -1, -1, -1, -1, 171, -1, 2132, 2133, 2134, 5394, 2136, -1, -1, 224, 225, -1, 4015, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 4034, -1, -1, -1, 4038, -1, 252, -1, -1, -1, -1, -1, -1, -1, 5434, -1, -1, -1, -1, 5439, -1, -1, 224, 225, -1, 196, -1, 513, 4062, -1, 201, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 295, 252, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, 2089, -1, -1, -1, -1, -1, -1, 252, -1, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 295, -1, -1, -1, 2112, -1, 2114, -1, 2116, -1, -1, 2119, 2120, 2121, -1, 310, -1, -1, 313, 2127, -1, -1, 2130, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, 2145, 2146, 2147, -1, -1, -1, 4170, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, 2163, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3722, 407, -1, -1, -1, -1, -1, -1, -1, -1, 3732, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, 487, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5672, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5686, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2310, -1, 5717, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4342, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 3895, 3896, 3897, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, 2364, 3912, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4404, -1, -1, 196, -1, 4409, 5796, 4411, 201, -1, -1, -1, -1, 3945, 3946, -1, -1, -1, 3950, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, 4437, -1, 2420, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5032, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5047, -1, -1, -1, -1, -1, 23, 4483, -1, -1, 4486, 28, -1, -1, -1, -1, -1, -1, 2621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5902, -1, -1, 5905, -1, 310, -1, -1, 313, 66, -1, -1, -1, -1, -1, 4059, -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5138, -1, 2696, -1, -1, -1, 114, -1, -1, 4576, 4577, -1, -1, -1, 2708, -1, -1, -1, -1, 2713, 4587, -1, -1, -1, -1, -1, 23, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, 4604, -1, -1, -1, -1, -1, 151, 41, -1, -1, -1, -1, -1, -1, 407, 160, -1, -1, -1, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 173, 2614, -1, -1, 66, -1, 179, -1, -1, -1, -1, -1, 2625, 186, 2627, -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6048, 2644, -1, 206, 96, 2648, -1, -1, 2651, -1, 2653, -1, -1, 2656, 6062, -1, -1, -1, -1, -1, -1, -1, 114, 4685, -1, -1, 4688, 6075, 120, -1, -1, -1, -1, -1, -1, 4225, 4226, 4227, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 151, -1, -1, 513, 266, -1, -1, 2709, 2710, 160, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 173, -1, -1, -1, -1, -1, 6135, 6136, -1, 182, -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, -1, -1, 206, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, 5360, -1, 5362, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 347, 348, -1, 2790, 351, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, 6213, -1, -1, -1, -1, -1, -1, -1, -1, 266, -1, 379, -1, -1, 382, -1, -1, -1, 386, -1, -1, 389, -1, -1, -1, -1, -1, -1, 396, -1, -1, 399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 419, -1, 310, -1, -1, 313, -1, -1, 427, -1, -1, -1, -1, -1, -1, 434, -1, -1, 437, -1, -1, -1, -1, 442, -1, -1, -1, -1, -1, 337, -1, 450, -1, 452, -1, -1, -1, -1, 457, -1, 4918, -1, -1, 351, -1, -1, -1, -1, -1, 5498, -1, 359, 471, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, -1, 396, -1, -1, 399, -1, -1, -1, -1, -1, 4975, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6371, -1, 4987, -1, 419, -1, -1, -1, -1, -1, -1, -1, 427, -1, -1, -1, -1, -1, -1, 434, -1, -1, 437, -1, 439, -1, 441, 442, -1, -1, -1, -1, -1, -1, -1, -1, 5021, -1, -1, -1, -1, -1, 457, -1, 4557, -1, -1, -1, -1, -1, 465, -1, -1, 468, -1, -1, 471, -1, -1, 6430, -1, -1, -1, -1, 3030, 3031, 3032, -1, -1, 484, 3036, -1, 6443, 6444, -1, -1, 4589, -1, -1, -1, -1, -1, -1, -1, 6455, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3063, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, 5099, -1, -1, -1, -1, -1, 5676, -1, 5678, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5118, -1, 23, -1, -1, -1, -1, 28, -1, -1, 4656, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4673, -1, -1, -1, -1, -1, -1, 3279, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, 3296, -1, -1, -1, -1, -1, -1, 79, -1, -1, 3306, -1, -1, -1, -1, -1, 3312, -1, -1, 3315, -1, -1, -1, -1, 96, -1, 3322, 3323, -1, 3325, -1, -1, -1, -1, 3330, 3331, 5205, 3333, -1, 3335, -1, -1, 114, 3339, -1, -1, 3342, -1, -1, -1, -1, 3347, -1, -1, -1, -1, -1, -1, -1, -1, 3356, -1, -1, -1, -1, 3361, 138, -1, -1, -1, -1, -1, 3368, 3369, 3370, 3371, -1, -1, -1, 151, 3376, 3377, -1, 3379, -1, -1, -1, -1, 160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, 3398, -1, 3400, -1, -1, 179, -1, -1, -1, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, -1, 4819, 4820, 4821, 4822, 3276, -1, -1, -1, -1, 3281, -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5334, -1, 5336, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, 3332, 33, 34, -1, -1, -1, -1, -1, -1, -1, -1, 3343, 266, 3345, 3346, -1, -1, -1, -1, -1, -1, -1, 5944, -1, -1, -1, -1, 3359, -1, 61, 3362, -1, 3364, 5384, -1, -1, -1, -1, -1, -1, -1, 73, -1, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, -1, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, 99, -1, 3401, -1, 3403, -1, 3405, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5434, 116, -1, -1, 119, -1, -1, -1, -1, -1, 347, 348, -1, -1, 351, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, 3590, -1, -1, 147, -1, -1, -1, -1, -1, -1, -1, -1, 156, 379, 158, -1, 382, -1, -1, -1, -1, 165, -1, 389, -1, -1, -1, -1, -1, -1, 396, -1, -1, 399, -1, -1, -1, -1, -1, 183, -1, -1, -1, 6077, -1, -1, -1, -1, -1, -1, -1, -1, 3496, 419, -1, -1, 200, 3501, -1, -1, -1, 427, -1, -1, -1, -1, -1, -1, 434, -1, -1, 437, 3516, -1, -1, -1, 442, -1, -1, -1, -1, -1, -1, -1, 450, -1, -1, -1, -1, -1, -1, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, 255, -1, -1, -1, -1, 260, -1, 484, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, -1, -1, -1, -1, -1, 3581, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 294, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6207, -1, 5166, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5177, -1, -1, 333, -1, -1, -1, -1, -1, -1, -1, 3641, 342, -1, -1, -1, -1, -1, 6238, 6239, -1, -1, -1, 5672, -1, -1, -1, 357, -1, -1, -1, -1, -1, 363, 364, -1, 366, 5686, -1, -1, -1, 371, -1, -1, 374, -1, -1, 377, -1, -1, 380, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, -1, -1, -1, 394, 395, -1, -1, 5717, 3845, 3846, -1, 402, -1, 3850, -1, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3879, 434, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 455, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 467, -1, -1, -1, 6361, -1, 473, -1, -1, -1, 5796, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 491, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, -1, -1, 537, -1, -1, -1, 3841, -1, -1, -1, -1, -1, 3847, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5902, -1, -1, 5905, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5456, -1, -1, -1, -1, 5461, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3926, -1, -1, -1, -1, 4077, -1, 5480, -1, -1, -1, 4083, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4130, 4131, -1, -1, 4134, 4135, 4136, 4137, -1, -1, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4173, -1, 6048, 4176, -1, 4178, -1, -1, 4181, 4182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, 4203, 4204, 4205, 4206, -1, 4208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4078, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, 5641, -1, -1, -1, -1, -1, -1, 4101, -1, -1, -1, 4105, 4106, 4107, -1, -1, -1, -1, 4112, -1, -1, 4115, -1, -1, 4118, -1, -1, -1, -1, -1, 4124, -1, 4126, -1, -1, 4275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4153, 4154, 4155, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4172, -1, -1, -1, -1, -1, -1, 4325, 4180, -1, -1, 4183, -1, 4185, -1, -1, -1, -1, -1, -1, 5739, -1, 6213, -1, -1, -1, -1, -1, -1, 4201, -1, -1, -1, -1, -1, -1, -1, 4209, 4210, -1, -1, -1, 4360, -1, 4216, -1, -1, -1, 5767, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4242, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6371, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4550, -1, -1, -1, -1, -1, -1, 6430, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6455, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4593, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4716, -1, -1, -1, 4720, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4733, -1, -1, -1, -1, -1, -1, -1, 4741, -1, 4743, -1, 4745, 4746, -1, -1, -1, -1, 4751, 4752, 4753, 4754, -1, -1, -1, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, -1, -1, -1, -1, -1, -1, -1, -1, 4633, 4634, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4644, -1, -1, -1, 4794, -1, -1, 4797, -1, 4799, -1, -1, -1, 4803, -1, -1, 4806, 4807, -1, -1, 4810, 4811, -1, -1, -1, -1, 4816, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4715, -1, -1, -1, -1, -1, -1, -1, 4869, -1, -1, -1, -1, -1, -1, -1, 4731, -1, -1, -1, -1, -1, 4883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4749, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4788, 4789, -1, -1, -1, -1, -1, 4795, 4796, -1, -1, -1, 4800, -1, -1, -1, -1, 4805, -1, -1, 4808, 4809, -1, -1, -1, -1, -1, 4815, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4870, -1, -1, -1, -1, -1, -1, -1, 4878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4923, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5003, -1, -1, -1, -1, -1, -1, 5010, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5168, 5169, -1, -1, -1, -1, -1, -1, 5176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5220, -1, -1, -1, 5078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5243, 5244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5262, -1, 5264, -1, -1, -1, 5268, 5269, 5270, 5271, -1, -1, 5274, 5275, -1, -1, -1, -1, 5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5296, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5231, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5241, -1, -1, -1, -1, -1, 5247, 5248, 5249, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5405, -1, 5407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5272, 5273, -1, -1, 5276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5292, -1, -1, -1, 5442, -1, -1, -1, -1, -1, 5302, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5329, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5548, -1, 5550, 5551, 5552, 5553, 5554, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5567, 5568, 5569, -1, -1, -1, -1, -1, -1, -1, 5577, -1, -1, -1, -1, 5582, -1, -1, 5585, -1, -1, -1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5607, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5600, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5648, -1, -1, 5797, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5808, -1, 5664, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5829, -1, 5831, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5706, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5876, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5925, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5795, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5807, -1, -1, -1, -1, -1, -1, -1, -1, 5816, 5817, 5818, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5844, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5858, 6005, -1, -1, -1, -1, -1, -1, 6012, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5877, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6060, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6009, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6172, 6173, -1, -1, 6176, -1, -1, -1, 6034, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6260, -1, -1, 6117, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6278, 6279, -1, 6281, -1, -1, -1, -1, -1, 6141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6268, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, 6284, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, 135, -1, 137, 138, 139, 140, 141, 6409, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, -1, -1, 254, 255, 256, -1, -1, 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, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 535, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, 535, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, 509, 510, 511, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, 535, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 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, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, 247, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 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, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 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, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, 532, 533, 534, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 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, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, 447, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 3, -1, 5, 6, -1, 8, 9, 534, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 3, -1, 5, 6, -1, 8, 9, 534, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 534, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, 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, -1, -1, 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, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, -1, 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, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, -1, 167, 168, 169, 170, -1, 172, 173, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, -1, 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, -1, 221, -1, 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, -1, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, -1, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, 313, -1, 315, 316, 317, 318, -1, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 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, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, 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, -1, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, -1, 482, 483, 484, 485, 486, 487, -1, 489, -1, -1, -1, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, -1, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, 5, 6, -1, -1, -1, 10, 11, -1, -1, -1, -1, -1, 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, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 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, -1, 158, 159, 160, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, -1, 186, -1, 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, -1, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, -1, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, 337, -1, 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, 381, 382, 383, -1, 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, -1, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, -1, 452, -1, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, 5, 6, -1, -1, -1, 10, 11, -1, -1, -1, -1, -1, 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, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 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, -1, 158, 159, 160, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, -1, 186, -1, 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, -1, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, -1, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, 337, -1, 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, 381, 382, 383, -1, 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, -1, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, -1, 452, -1, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, 314, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 527, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, 314, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, 177, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, 8, 9, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, 186, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, 183, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, 183, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, -1, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, -1, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, -1, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, 171, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, 171, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, -1, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, 54, -1, -1, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, -1, -1, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, -1, -1, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, -1, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, -1, -1, -1, -1, -1, 223, 224, 225, 226, 227, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, -1, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, -1, 405, 406, 407, 408, 409, -1, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, -1, -1, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, -1, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 20, 31, 33, 34, 51, 61, 73, 75, 76, 82, 84, 97, 99, 116, 119, 134, 136, 140, 147, 156, 158, 165, 183, 200, 254, 255, 260, 275, 294, 333, 342, 357, 363, 364, 366, 371, 377, 380, 387, 394, 395, 402, 406, 417, 434, 455, 467, 473, 478, 491, 515, 517, 518, 519, 520, 521, 534, 541, 542, 543, 544, 549, 550, 556, 557, 559, 560, 561, 562, 564, 567, 579, 584, 585, 588, 589, 590, 610, 613, 614, 629, 680, 683, 684, 687, 690, 691, 692, 700, 707, 709, 710, 713, 716, 717, 721, 730, 734, 735, 736, 739, 741, 742, 743, 744, 752, 754, 774, 778, 780, 781, 791, 793, 800, 801, 804, 805, 806, 807, 808, 817, 819, 821, 824, 828, 829, 839, 840, 845, 850, 861, 893, 896, 897, 898, 903, 906, 908, 910, 912, 913, 917, 918, 921, 923, 924, 928, 929, 930, 933, 934, 935, 936, 937, 944, 946, 947, 948, 949, 955, 957, 958, 964, 965, 966, 969, 970, 971, 972, 974, 975, 977, 978, 980, 981, 983, 995, 997, 1000, 1002, 1003, 1012, 1014, 1019, 1024, 1034, 1038, 1039, 1040, 1041, 1042, 1043, 1049, 1085, 449, 494, 950, 28, 79, 96, 114, 120, 138, 151, 160, 173, 179, 186, 206, 244, 266, 310, 337, 347, 348, 351, 379, 382, 386, 389, 396, 399, 419, 427, 432, 434, 437, 442, 452, 457, 471, 484, 706, 950, 3, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 100, 101, 102, 103, 107, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 123, 124, 125, 126, 127, 128, 129, 131, 132, 133, 134, 137, 138, 139, 140, 141, 143, 144, 145, 146, 148, 149, 150, 151, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 164, 166, 167, 168, 169, 170, 172, 174, 175, 176, 178, 179, 180, 181, 182, 184, 185, 187, 188, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207, 208, 209, 211, 212, 213, 214, 215, 216, 217, 218, 219, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 248, 249, 250, 251, 252, 254, 255, 256, 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, 293, 294, 295, 296, 298, 299, 300, 301, 302, 303, 305, 306, 307, 310, 311, 312, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 337, 338, 339, 340, 341, 342, 343, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 396, 397, 398, 399, 400, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 431, 432, 435, 436, 437, 438, 439, 440, 441, 442, 444, 445, 446, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 466, 467, 468, 469, 470, 473, 474, 475, 476, 477, 478, 479, 481, 482, 483, 484, 485, 486, 489, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 1153, 1246, 1258, 1259, 1263, 1264, 1265, 3, 29, 1035, 1243, 1258, 1263, 482, 534, 988, 308, 343, 950, 54, 534, 621, 23, 41, 66, 79, 114, 120, 138, 151, 160, 173, 182, 186, 256, 310, 313, 337, 351, 379, 389, 399, 419, 427, 437, 439, 441, 442, 457, 465, 468, 471, 630, 689, 796, 851, 862, 29, 342, 1243, 1035, 29, 336, 397, 439, 441, 6, 243, 904, 905, 1249, 23, 28, 66, 79, 96, 114, 138, 151, 160, 173, 179, 186, 206, 266, 310, 323, 337, 348, 351, 379, 382, 386, 389, 396, 399, 419, 427, 434, 437, 442, 450, 452, 457, 471, 484, 706, 809, 811, 812, 950, 1243, 99, 482, 534, 684, 687, 690, 983, 996, 1000, 1003, 1012, 1019, 1024, 1034, 1038, 11, 22, 29, 49, 168, 175, 177, 201, 245, 283, 345, 365, 525, 526, 825, 826, 1035, 1248, 1250, 29, 31, 99, 361, 395, 830, 831, 832, 1258, 173, 1258, 1245, 1249, 434, 1052, 825, 1258, 67, 277, 371, 379, 389, 400, 402, 406, 445, 449, 497, 569, 570, 571, 1258, 449, 1243, 323, 266, 534, 916, 387, 1258, 29, 400, 445, 449, 571, 580, 581, 183, 830, 831, 1258, 343, 950, 1258, 242, 29, 135, 1054, 1055, 93, 256, 400, 402, 449, 568, 570, 29, 400, 445, 449, 571, 449, 309, 1097, 1098, 1241, 1258, 1052, 527, 1258, 178, 534, 989, 534, 359, 1044, 1045, 1243, 1044, 3, 53, 55, 56, 69, 70, 117, 118, 139, 169, 218, 219, 221, 228, 278, 280, 300, 356, 404, 410, 445, 446, 479, 1126, 1128, 1130, 1132, 1134, 1136, 1137, 1138, 1140, 1141, 1142, 1144, 1145, 1149, 1259, 1263, 1054, 1055, 1056, 1254, 12, 1255, 1256, 1258, 1255, 1255, 1039, 1040, 1043, 0, 537, 534, 988, 152, 220, 314, 464, 1057, 1058, 1039, 1041, 1042, 125, 216, 268, 470, 538, 35, 954, 878, 1246, 814, 1258, 814, 1243, 346, 814, 452, 1243, 113, 434, 866, 1246, 1258, 1265, 3, 106, 110, 401, 1251, 1252, 1260, 1263, 1264, 1265, 29, 195, 1241, 301, 484, 10, 17, 18, 19, 74, 164, 522, 523, 524, 525, 526, 527, 528, 529, 530, 900, 902, 1184, 1185, 1258, 195, 1243, 866, 1243, 29, 1251, 1252, 866, 1243, 1243, 195, 1241, 1243, 195, 814, 1243, 371, 402, 29, 195, 1097, 1243, 392, 1243, 814, 29, 263, 1251, 1252, 195, 1241, 243, 122, 226, 292, 355, 951, 952, 953, 534, 532, 536, 1210, 1212, 512, 982, 983, 984, 985, 1260, 1241, 1243, 1258, 28, 66, 80, 92, 114, 138, 179, 206, 244, 310, 348, 379, 382, 427, 437, 450, 457, 809, 810, 811, 812, 1249, 954, 999, 1003, 1012, 1019, 1024, 1038, 1241, 270, 814, 534, 195, 814, 1243, 814, 452, 195, 1243, 113, 434, 439, 441, 1251, 1252, 439, 441, 74, 164, 900, 369, 1243, 1243, 1251, 195, 545, 1258, 195, 1243, 195, 546, 814, 1243, 1243, 392, 814, 263, 1251, 359, 396, 434, 484, 266, 96, 206, 28, 92, 179, 348, 386, 450, 452, 456, 701, 29, 1243, 1036, 578, 1249, 1260, 905, 270, 195, 878, 879, 195, 909, 195, 1243, 195, 816, 1126, 452, 113, 434, 195, 865, 866, 195, 1252, 1253, 87, 484, 74, 164, 195, 901, 902, 59, 195, 865, 195, 1253, 195, 865, 195, 1243, 195, 1243, 392, 909, 195, 816, 195, 263, 1253, 243, 195, 813, 814, 195, 1242, 1243, 195, 1243, 954, 534, 1001, 630, 996, 478, 982, 988, 1250, 826, 827, 29, 827, 1250, 827, 29, 827, 1250, 827, 827, 827, 1250, 1248, 1248, 1035, 827, 346, 534, 432, 534, 657, 657, 657, 308, 447, 538, 657, 389, 1097, 1099, 538, 945, 1249, 120, 577, 1249, 581, 578, 1249, 48, 60, 569, 571, 29, 571, 511, 411, 311, 177, 447, 524, 536, 1249, 534, 998, 59, 484, 982, 114, 206, 389, 432, 434, 914, 915, 1258, 48, 511, 226, 311, 308, 177, 311, 1249, 447, 954, 171, 822, 308, 5, 8, 9, 10, 12, 37, 53, 55, 56, 65, 66, 69, 70, 77, 79, 104, 105, 106, 107, 108, 109, 110, 117, 118, 120, 157, 162, 163, 169, 185, 187, 218, 219, 221, 228, 229, 230, 231, 232, 233, 234, 235, 236, 238, 249, 257, 258, 269, 278, 280, 290, 292, 297, 298, 300, 310, 321, 338, 356, 384, 401, 410, 428, 433, 445, 446, 451, 453, 454, 465, 471, 479, 499, 500, 501, 502, 504, 505, 506, 507, 513, 525, 526, 527, 534, 1039, 1129, 1132, 1135, 1136, 1137, 1139, 1140, 1141, 1144, 1145, 1149, 1150, 1152, 1153, 1154, 1156, 1180, 1181, 1182, 1186, 1204, 1209, 1235, 1238, 1239, 1246, 1247, 1248, 1249, 1258, 1237, 1238, 29, 586, 1240, 1241, 400, 568, 71, 568, 60, 952, 48, 511, 226, 953, 534, 1241, 527, 1212, 1099, 982, 176, 990, 1150, 1189, 1044, 538, 534, 991, 481, 1143, 1143, 1143, 534, 1131, 1131, 340, 534, 1133, 69, 70, 1143, 1131, 1128, 515, 516, 534, 1146, 534, 1146, 37, 1127, 534, 115, 193, 271, 274, 393, 509, 534, 1147, 1148, 536, 815, 1131, 1237, 1213, 535, 535, 543, 982, 992, 993, 994, 1241, 29, 135, 1053, 1053, 59, 1053, 165, 171, 253, 304, 1061, 1063, 1064, 1079, 1081, 1082, 1083, 1057, 1058, 177, 222, 222, 1097, 1100, 534, 68, 288, 324, 367, 402, 534, 876, 324, 363, 367, 402, 815, 324, 367, 402, 3, 91, 145, 259, 324, 333, 363, 367, 402, 437, 440, 491, 579, 582, 959, 960, 961, 962, 846, 25, 140, 324, 367, 402, 475, 595, 1243, 25, 140, 402, 470, 563, 495, 195, 1097, 62, 98, 161, 198, 248, 288, 292, 324, 325, 367, 376, 385, 394, 402, 415, 424, 429, 486, 579, 583, 882, 894, 922, 534, 863, 1212, 367, 563, 201, 157, 25, 31, 46, 76, 133, 140, 144, 172, 208, 288, 292, 302, 312, 324, 367, 370, 371, 402, 475, 591, 593, 594, 724, 922, 5, 525, 526, 698, 1250, 29, 195, 1241, 814, 814, 534, 899, 324, 402, 536, 157, 308, 324, 367, 402, 894, 922, 25, 140, 324, 367, 402, 201, 558, 367, 491, 515, 551, 558, 324, 367, 402, 894, 922, 308, 324, 367, 157, 38, 60, 112, 204, 267, 272, 288, 323, 367, 372, 396, 402, 417, 591, 695, 696, 324, 367, 483, 724, 732, 157, 324, 367, 402, 25, 91, 133, 140, 144, 324, 363, 367, 402, 409, 581, 569, 201, 157, 46, 131, 288, 367, 402, 591, 592, 324, 367, 371, 402, 89, 132, 327, 440, 308, 25, 31, 140, 324, 367, 402, 611, 612, 558, 171, 367, 551, 558, 157, 367, 402, 591, 1243, 251, 122, 309, 496, 538, 951, 29, 135, 480, 527, 535, 871, 1150, 1190, 1191, 1259, 1150, 1211, 3, 29, 33, 34, 35, 36, 37, 38, 39, 43, 57, 65, 66, 72, 78, 80, 92, 99, 104, 105, 106, 108, 109, 110, 120, 122, 130, 135, 136, 142, 147, 152, 163, 165, 171, 173, 177, 183, 186, 190, 201, 210, 220, 222, 246, 247, 253, 257, 258, 292, 297, 304, 308, 309, 313, 314, 334, 344, 361, 375, 395, 401, 412, 430, 433, 434, 443, 447, 448, 454, 464, 465, 471, 472, 480, 487, 488, 490, 491, 527, 1244, 1261, 1263, 1264, 1265, 1266, 1210, 535, 538, 163, 308, 454, 575, 578, 698, 986, 472, 979, 308, 878, 534, 814, 1243, 1126, 866, 301, 74, 164, 902, 866, 866, 171, 1126, 814, 1243, 1243, 535, 657, 1243, 72, 1126, 292, 177, 534, 782, 551, 38, 973, 1243, 292, 551, 495, 195, 1241, 551, 814, 814, 782, 468, 630, 308, 171, 491, 890, 551, 292, 48, 565, 292, 457, 731, 292, 991, 91, 324, 708, 89, 132, 327, 440, 38, 782, 171, 195, 551, 484, 195, 1241, 195, 685, 1241, 1241, 484, 814, 87, 547, 1246, 452, 1246, 1246, 1243, 171, 1243, 706, 40, 54, 111, 215, 288, 391, 157, 63, 373, 538, 548, 157, 534, 157, 551, 157, 538, 548, 495, 157, 538, 548, 157, 538, 195, 813, 195, 814, 195, 814, 157, 538, 548, 1253, 157, 548, 157, 157, 548, 157, 548, 157, 89, 132, 327, 440, 171, 157, 548, 157, 171, 195, 157, 538, 548, 157, 538, 548, 157, 308, 1189, 434, 535, 996, 827, 1035, 827, 1035, 827, 1035, 827, 1035, 827, 1035, 1035, 1035, 827, 1035, 534, 658, 659, 1258, 658, 29, 114, 138, 173, 179, 243, 244, 326, 348, 382, 389, 396, 434, 437, 457, 835, 1240, 1253, 832, 1243, 201, 538, 1015, 1249, 120, 578, 125, 3, 120, 256, 576, 698, 1145, 1249, 1249, 94, 137, 1162, 103, 120, 572, 573, 575, 698, 120, 572, 1258, 1126, 1193, 38, 1253, 547, 535, 547, 547, 547, 251, 171, 835, 1253, 171, 387, 1258, 578, 308, 534, 1213, 532, 1039, 1194, 1150, 1208, 534, 534, 171, 534, 534, 1039, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 1150, 534, 534, 534, 534, 534, 534, 534, 534, 299, 646, 534, 534, 534, 534, 534, 534, 534, 534, 1150, 1150, 1150, 1039, 1150, 1189, 1212, 1249, 534, 1249, 3, 10, 13, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 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, 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, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 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, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 167, 168, 169, 170, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 184, 185, 187, 188, 189, 191, 192, 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, 221, 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, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 272, 273, 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, 305, 306, 307, 309, 310, 311, 312, 313, 315, 316, 317, 318, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 334, 335, 336, 337, 338, 339, 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, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 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, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 489, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511, 513, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1184, 1186, 1188, 1262, 1267, 492, 1167, 320, 1150, 166, 1168, 222, 538, 1050, 534, 1249, 1212, 1050, 123, 197, 587, 538, 71, 38, 251, 1241, 95, 372, 818, 535, 988, 35, 45, 52, 78, 196, 201, 224, 252, 310, 313, 407, 535, 538, 1045, 1242, 38, 534, 1189, 1248, 1143, 1143, 37, 1127, 445, 445, 1248, 1248, 532, 532, 1248, 447, 447, 447, 534, 447, 1248, 1244, 536, 1131, 177, 1086, 15, 524, 1210, 1257, 535, 538, 991, 1041, 1041, 1059, 1060, 1150, 1041, 168, 283, 1070, 240, 288, 355, 405, 470, 29, 1065, 1150, 525, 526, 1066, 1067, 1150, 1152, 1079, 1080, 1064, 1063, 1061, 1062, 171, 1082, 302, 1084, 1061, 1079, 1100, 1004, 1241, 1100, 38, 1258, 402, 1189, 68, 447, 447, 389, 201, 213, 314, 317, 404, 480, 527, 869, 870, 871, 873, 875, 877, 1126, 1259, 447, 483, 447, 389, 447, 447, 389, 253, 447, 371, 79, 447, 437, 568, 324, 959, 961, 524, 963, 171, 183, 201, 377, 847, 848, 72, 92, 292, 654, 655, 92, 120, 292, 447, 92, 447, 120, 292, 389, 92, 133, 144, 324, 367, 779, 389, 714, 28, 66, 138, 179, 310, 348, 382, 450, 457, 809, 810, 1243, 157, 367, 402, 591, 308, 698, 394, 248, 447, 1258, 447, 297, 698, 124, 223, 389, 570, 814, 373, 402, 882, 895, 128, 535, 864, 869, 447, 471, 437, 1241, 72, 80, 92, 153, 173, 195, 344, 465, 637, 652, 653, 1258, 80, 92, 919, 329, 308, 384, 386, 452, 92, 919, 32, 370, 384, 386, 452, 384, 1241, 172, 208, 302, 814, 534, 447, 447, 194, 534, 599, 23, 262, 437, 468, 493, 599, 92, 538, 128, 5, 5, 324, 201, 157, 367, 402, 591, 922, 472, 472, 289, 1126, 447, 389, 534, 900, 1243, 1241, 447, 447, 389, 895, 128, 107, 434, 435, 931, 932, 1098, 1241, 1258, 932, 447, 447, 782, 932, 114, 402, 582, 447, 553, 582, 447, 447, 389, 895, 128, 1241, 447, 447, 1241, 1128, 698, 59, 697, 698, 698, 112, 267, 272, 59, 447, 551, 276, 389, 551, 288, 696, 447, 447, 297, 1249, 724, 814, 447, 447, 389, 419, 351, 1249, 351, 447, 351, 447, 351, 782, 782, 437, 1097, 329, 329, 92, 447, 919, 389, 447, 447, 599, 599, 814, 814, 814, 814, 1241, 47, 477, 47, 47, 477, 447, 47, 447, 477, 389, 534, 538, 582, 471, 740, 1252, 447, 553, 582, 1241, 447, 919, 389, 324, 367, 355, 368, 398, 574, 951, 1190, 1190, 1191, 535, 15, 16, 538, 1057, 1058, 533, 539, 1241, 984, 1243, 1241, 224, 1126, 224, 308, 224, 224, 698, 814, 814, 224, 224, 224, 1126, 224, 224, 224, 308, 447, 177, 447, 615, 457, 534, 38, 157, 814, 783, 784, 1261, 959, 1126, 308, 157, 711, 1243, 292, 329, 534, 552, 796, 472, 359, 484, 1241, 29, 932, 782, 552, 157, 1252, 99, 183, 566, 629, 691, 754, 828, 850, 955, 157, 1249, 732, 733, 157, 308, 1249, 1252, 259, 814, 814, 814, 814, 148, 354, 534, 740, 292, 552, 1241, 292, 693, 695, 292, 38, 302, 329, 534, 657, 657, 195, 688, 1241, 171, 195, 545, 1258, 534, 786, 876, 1243, 534, 867, 867, 38, 1126, 27, 50, 217, 755, 243, 491, 493, 1037, 391, 879, 878, 1126, 1243, 534, 816, 1126, 865, 866, 1253, 1252, 157, 548, 157, 472, 157, 472, 901, 902, 548, 865, 1253, 865, 1243, 1243, 1126, 816, 1253, 740, 157, 813, 814, 1242, 1243, 1243, 814, 535, 195, 1241, 996, 1035, 1035, 1035, 1035, 1035, 1035, 658, 535, 538, 535, 180, 349, 383, 397, 435, 1242, 813, 113, 399, 865, 1242, 301, 833, 834, 1258, 865, 865, 1242, 1240, 1240, 1242, 813, 447, 184, 491, 844, 152, 253, 737, 738, 23, 155, 384, 405, 1016, 1097, 296, 1017, 1249, 534, 1249, 538, 535, 538, 999, 447, 1241, 1243, 1241, 545, 830, 831, 177, 844, 831, 1258, 28, 80, 138, 179, 244, 348, 382, 457, 809, 810, 1189, 533, 1189, 1194, 1195, 487, 1205, 1206, 1150, 1189, 534, 1248, 1248, 3, 115, 193, 271, 274, 393, 509, 1196, 1197, 1249, 1189, 1189, 1150, 1223, 375, 1039, 1040, 1223, 1227, 1234, 1223, 1223, 1150, 1152, 1190, 1227, 1230, 1231, 1150, 1231, 1223, 1150, 1223, 1223, 1189, 1248, 1248, 535, 1150, 1150, 900, 1150, 1190, 1192, 1199, 384, 525, 526, 534, 1151, 1152, 1186, 1200, 535, 1189, 1150, 1192, 1201, 1150, 57, 177, 247, 448, 1150, 1189, 1202, 135, 292, 1039, 1189, 276, 1152, 1150, 1160, 1161, 1162, 276, 1150, 1162, 535, 538, 1248, 1147, 1126, 1150, 1150, 1150, 1150, 1261, 256, 445, 43, 430, 1214, 814, 1150, 534, 1039, 1203, 135, 137, 163, 228, 284, 285, 286, 287, 291, 292, 297, 454, 466, 1198, 1228, 1150, 534, 1150, 447, 52, 196, 201, 252, 407, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 29, 36, 412, 1183, 186, 1168, 384, 534, 1180, 534, 319, 1172, 182, 256, 434, 439, 441, 468, 1051, 1241, 1239, 1086, 1190, 1086, 1241, 449, 535, 194, 194, 548, 994, 983, 987, 1150, 535, 266, 292, 1046, 1189, 535, 535, 532, 511, 511, 535, 535, 1248, 533, 1248, 535, 193, 271, 1148, 271, 1148, 1148, 1248, 274, 535, 1244, 228, 237, 246, 385, 508, 534, 1039, 1087, 1088, 1089, 1097, 1103, 1113, 1120, 1153, 1155, 1156, 1235, 1258, 488, 1108, 1254, 994, 992, 538, 39, 130, 472, 859, 384, 385, 525, 526, 1067, 1069, 1152, 405, 240, 309, 538, 5, 1068, 1248, 1068, 384, 385, 1069, 1240, 296, 409, 1018, 1080, 1062, 472, 1013, 120, 322, 534, 1005, 1038, 38, 472, 1258, 534, 1020, 1021, 1022, 1258, 535, 1252, 1243, 1243, 317, 59, 1259, 535, 871, 873, 870, 873, 1259, 314, 535, 538, 815, 1252, 1243, 1243, 1252, 1243, 1243, 1252, 483, 1243, 1243, 120, 575, 698, 379, 471, 830, 389, 183, 830, 534, 1243, 297, 195, 1243, 297, 1252, 1243, 1243, 1150, 297, 1243, 1243, 32, 370, 447, 447, 1243, 447, 715, 878, 534, 1126, 866, 74, 164, 902, 866, 866, 171, 1126, 814, 1243, 189, 288, 324, 367, 476, 718, 719, 720, 1097, 447, 919, 389, 297, 124, 223, 1252, 1243, 308, 1243, 308, 535, 538, 1251, 1253, 1243, 367, 591, 534, 195, 637, 1243, 472, 852, 240, 292, 240, 472, 646, 679, 1126, 1243, 1248, 1258, 1241, 1243, 251, 1243, 29, 471, 1243, 195, 1243, 195, 1258, 386, 452, 386, 452, 251, 1243, 29, 471, 1243, 251, 384, 1241, 25, 140, 402, 725, 726, 727, 728, 1261, 1252, 1243, 120, 178, 293, 472, 598, 601, 602, 1261, 270, 1243, 76, 305, 1243, 594, 308, 447, 437, 1241, 447, 919, 389, 128, 1243, 1243, 538, 535, 538, 1252, 1243, 925, 926, 1261, 308, 367, 447, 748, 1252, 1243, 1243, 308, 1097, 201, 538, 657, 657, 1212, 1252, 1243, 1243, 1251, 3, 91, 146, 208, 331, 463, 471, 474, 554, 1252, 1243, 1243, 308, 367, 1252, 1243, 367, 402, 591, 695, 698, 814, 1243, 698, 814, 1243, 698, 1252, 1243, 402, 1252, 1243, 1243, 120, 605, 1250, 1242, 1242, 1252, 890, 1243, 1242, 1243, 367, 402, 591, 592, 1241, 1241, 1243, 1243, 1243, 1243, 1252, 1243, 25, 31, 140, 324, 367, 402, 324, 367, 402, 782, 367, 402, 367, 402, 367, 922, 1112, 1258, 195, 792, 1258, 195, 1258, 1249, 1252, 1243, 1243, 1249, 1243, 925, 25, 140, 612, 399, 1251, 367, 402, 591, 1243, 1243, 1243, 447, 447, 85, 462, 355, 538, 1057, 1057, 1057, 1150, 1150, 480, 1191, 535, 1150, 1211, 979, 297, 820, 1249, 38, 820, 138, 814, 820, 820, 224, 472, 472, 820, 820, 820, 243, 820, 820, 820, 814, 350, 616, 616, 206, 434, 753, 1150, 1126, 814, 535, 538, 524, 643, 1261, 1243, 63, 177, 389, 483, 712, 719, 720, 157, 302, 252, 631, 633, 635, 637, 649, 652, 26, 201, 379, 431, 554, 555, 171, 1243, 484, 1241, 38, 749, 435, 890, 545, 1258, 565, 630, 862, 1243, 173, 814, 534, 681, 682, 1155, 1258, 351, 1249, 782, 782, 782, 782, 534, 782, 1110, 1111, 1112, 399, 157, 534, 157, 157, 156, 1038, 814, 302, 631, 1258, 472, 674, 491, 600, 292, 38, 657, 1249, 292, 308, 3, 787, 788, 782, 27, 535, 868, 869, 874, 38, 243, 376, 450, 490, 880, 881, 882, 883, 880, 308, 243, 302, 125, 216, 455, 470, 756, 757, 1243, 192, 192, 171, 548, 38, 551, 172, 967, 968, 548, 548, 813, 814, 1243, 814, 1243, 548, 548, 548, 548, 243, 548, 399, 171, 548, 548, 308, 548, 292, 535, 659, 201, 201, 201, 201, 201, 495, 1242, 698, 699, 538, 536, 186, 836, 837, 1252, 59, 841, 842, 1261, 447, 534, 177, 155, 405, 155, 405, 384, 470, 273, 1248, 1147, 573, 1126, 1252, 491, 686, 308, 836, 548, 177, 878, 814, 1126, 866, 301, 866, 866, 1126, 814, 1243, 535, 533, 533, 538, 1150, 142, 1206, 1207, 38, 535, 1150, 535, 535, 535, 177, 535, 535, 512, 1224, 1225, 491, 493, 1229, 1126, 1225, 535, 21, 297, 538, 1233, 314, 1236, 538, 539, 477, 535, 535, 21, 297, 538, 1232, 1232, 538, 535, 1227, 538, 535, 535, 535, 535, 538, 538, 535, 334, 535, 535, 534, 1151, 1151, 1189, 13, 17, 18, 19, 201, 224, 310, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1186, 1151, 535, 535, 171, 177, 407, 535, 535, 38, 1202, 1189, 1202, 1202, 177, 535, 135, 535, 1261, 330, 1165, 38, 535, 538, 1150, 1261, 538, 1150, 1213, 1150, 535, 511, 1151, 1151, 150, 1189, 177, 37, 301, 388, 477, 135, 137, 163, 291, 297, 454, 466, 1198, 1228, 291, 1229, 150, 900, 1150, 430, 1214, 1150, 1203, 1150, 447, 534, 1039, 534, 1172, 534, 1189, 488, 534, 1173, 1258, 439, 441, 439, 441, 1241, 1052, 1052, 1052, 1108, 1057, 1108, 952, 994, 266, 534, 535, 1248, 1146, 1146, 533, 533, 535, 534, 1039, 1103, 1113, 1120, 177, 534, 1039, 1088, 1089, 38, 1090, 1091, 1258, 538, 100, 178, 212, 227, 250, 279, 378, 1094, 1091, 38, 1090, 1093, 1258, 1091, 1091, 515, 1107, 1212, 1150, 186, 1071, 1060, 310, 1184, 1187, 514, 860, 5, 1248, 1069, 309, 491, 470, 1066, 261, 1087, 488, 1109, 478, 432, 471, 1006, 1007, 1008, 1258, 308, 1009, 1258, 1088, 1022, 1023, 538, 1086, 524, 1213, 877, 815, 873, 873, 59, 875, 529, 1253, 1253, 308, 1242, 311, 308, 1150, 655, 772, 157, 548, 447, 1252, 1243, 578, 1126, 814, 814, 1126, 702, 1243, 189, 476, 447, 447, 702, 718, 724, 367, 402, 591, 1243, 1243, 1243, 214, 297, 160, 869, 323, 402, 447, 1150, 292, 153, 653, 1243, 534, 534, 157, 534, 679, 206, 534, 772, 422, 641, 642, 772, 402, 25, 140, 371, 372, 402, 595, 603, 604, 724, 920, 394, 157, 548, 157, 548, 1243, 1243, 1243, 1243, 394, 394, 251, 727, 728, 727, 535, 538, 729, 1249, 206, 535, 538, 524, 536, 120, 606, 1258, 160, 1252, 1243, 367, 402, 591, 1243, 1243, 1243, 308, 324, 367, 402, 25, 140, 324, 367, 402, 1126, 289, 1126, 535, 538, 524, 1241, 447, 1253, 472, 745, 160, 657, 389, 931, 488, 664, 664, 657, 253, 331, 297, 1249, 331, 1253, 469, 160, 447, 447, 389, 419, 890, 890, 890, 323, 402, 92, 447, 919, 389, 120, 171, 607, 167, 547, 447, 447, 263, 263, 263, 447, 447, 389, 447, 447, 389, 447, 389, 447, 389, 447, 128, 548, 1126, 292, 1249, 402, 920, 157, 548, 447, 447, 535, 1243, 447, 919, 389, 447, 1252, 1243, 535, 535, 535, 1191, 533, 1126, 814, 224, 820, 1243, 1243, 1243, 224, 420, 421, 617, 1249, 617, 189, 535, 535, 177, 782, 784, 289, 310, 525, 526, 698, 785, 873, 1187, 1249, 1266, 72, 78, 92, 120, 122, 181, 210, 292, 297, 344, 361, 465, 644, 645, 648, 156, 487, 551, 578, 1243, 578, 312, 722, 1241, 1241, 1241, 535, 538, 1253, 186, 379, 1253, 1248, 457, 1241, 657, 3, 171, 750, 890, 48, 565, 434, 731, 113, 991, 1150, 177, 538, 1242, 600, 789, 790, 1249, 535, 538, 1243, 171, 658, 1241, 685, 1241, 1243, 686, 534, 632, 1241, 535, 1243, 491, 493, 675, 599, 38, 157, 1038, 674, 447, 157, 1097, 524, 535, 538, 756, 535, 538, 120, 524, 884, 1249, 578, 434, 872, 873, 171, 889, 51, 374, 885, 886, 883, 886, 125, 216, 395, 470, 942, 1243, 302, 308, 313, 189, 1038, 1126, 534, 535, 538, 548, 472, 548, 472, 548, 1243, 1243, 740, 814, 157, 389, 389, 389, 389, 389, 1242, 538, 834, 1258, 1252, 491, 538, 838, 1252, 538, 844, 163, 311, 454, 843, 1099, 399, 155, 155, 535, 113, 288, 835, 844, 1253, 224, 224, 224, 224, 698, 224, 224, 224, 224, 224, 1194, 443, 1150, 147, 1126, 535, 1150, 228, 465, 465, 535, 1225, 1227, 308, 308, 1223, 1227, 59, 1233, 1150, 1223, 1223, 308, 308, 1231, 1229, 1229, 1150, 535, 1150, 1198, 1150, 1150, 535, 1189, 538, 1126, 1151, 1151, 1151, 1151, 135, 137, 292, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1150, 1150, 1150, 1126, 535, 535, 535, 1189, 535, 538, 59, 1152, 1166, 535, 1261, 1161, 341, 426, 1164, 535, 538, 483, 1157, 38, 535, 1249, 1150, 35, 35, 1150, 535, 1150, 177, 291, 1229, 1150, 535, 150, 1151, 1151, 150, 150, 1150, 1150, 1058, 535, 1189, 538, 1150, 1174, 1258, 1052, 1052, 1052, 1052, 1241, 1241, 1241, 1071, 535, 1071, 999, 533, 1223, 1091, 1093, 1091, 1091, 534, 503, 1152, 535, 1258, 534, 1088, 227, 318, 1095, 1088, 1095, 227, 1094, 1095, 227, 436, 1101, 534, 1258, 534, 315, 59, 190, 1078, 534, 860, 168, 245, 309, 491, 444, 103, 1150, 375, 1011, 477, 535, 538, 1213, 90, 1011, 308, 535, 538, 1021, 1109, 1150, 535, 529, 877, 457, 180, 383, 390, 397, 435, 458, 849, 171, 849, 535, 122, 210, 288, 292, 773, 1243, 1243, 38, 472, 472, 243, 815, 1252, 1243, 447, 919, 389, 447, 214, 1243, 59, 437, 1243, 535, 157, 534, 662, 663, 855, 1155, 1258, 658, 637, 658, 772, 1243, 658, 120, 1258, 86, 639, 640, 419, 181, 159, 194, 292, 599, 551, 113, 159, 181, 292, 419, 599, 639, 641, 696, 402, 604, 457, 1243, 1258, 394, 726, 1243, 602, 785, 1261, 1243, 323, 402, 447, 919, 389, 447, 160, 447, 447, 389, 179, 310, 422, 794, 795, 179, 310, 802, 803, 447, 447, 389, 535, 535, 535, 926, 289, 698, 873, 927, 1187, 1249, 1266, 367, 1243, 534, 491, 746, 1243, 664, 107, 1258, 534, 664, 1250, 1249, 1249, 1249, 1243, 1243, 1243, 1243, 605, 59, 437, 1243, 1243, 1243, 1243, 478, 1243, 1243, 171, 171, 369, 171, 195, 1252, 1243, 1243, 1252, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 308, 78, 596, 157, 27, 50, 457, 1258, 1243, 1249, 724, 1243, 1243, 1243, 1243, 1057, 535, 224, 820, 224, 224, 224, 820, 551, 472, 622, 623, 702, 772, 491, 493, 814, 534, 814, 1243, 1151, 32, 59, 647, 123, 197, 122, 297, 240, 1241, 646, 179, 348, 768, 775, 776, 1258, 711, 534, 329, 534, 632, 650, 209, 669, 635, 1253, 1253, 1126, 534, 600, 29, 125, 216, 395, 470, 751, 447, 747, 1252, 195, 1241, 733, 495, 308, 535, 1087, 682, 890, 535, 538, 1112, 722, 740, 535, 693, 38, 302, 329, 534, 1001, 634, 636, 638, 652, 1258, 329, 670, 671, 632, 669, 599, 305, 308, 676, 1038, 688, 686, 600, 1249, 1243, 852, 785, 3, 788, 308, 874, 1150, 1150, 538, 534, 880, 457, 538, 44, 1150, 447, 534, 658, 1241, 757, 702, 535, 967, 968, 1243, 1243, 548, 399, 548, 1242, 1242, 1242, 1242, 1242, 698, 183, 837, 844, 842, 535, 1243, 1249, 113, 177, 548, 844, 297, 823, 1249, 823, 823, 823, 224, 823, 823, 823, 823, 823, 1150, 535, 145, 241, 241, 535, 297, 297, 535, 1059, 1227, 330, 1215, 297, 297, 1227, 1227, 1215, 1215, 535, 535, 177, 535, 1150, 177, 135, 137, 177, 171, 150, 535, 498, 1159, 1189, 360, 477, 59, 1166, 1152, 489, 489, 535, 1150, 288, 1150, 538, 1158, 1128, 1150, 1150, 1150, 1150, 35, 35, 1150, 1150, 150, 535, 535, 535, 1150, 535, 329, 1175, 1241, 1241, 1241, 1241, 1078, 1249, 1078, 535, 538, 1104, 1105, 1155, 534, 1165, 1090, 534, 1242, 1088, 308, 472, 1096, 1088, 227, 1088, 1246, 1111, 534, 1111, 1258, 1053, 1150, 490, 1169, 900, 444, 302, 1238, 1038, 322, 1038, 1008, 308, 534, 1010, 1150, 524, 1022, 1011, 457, 535, 447, 830, 177, 772, 123, 197, 208, 122, 474, 548, 1126, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1253, 1243, 772, 637, 1150, 535, 538, 491, 78, 854, 858, 854, 535, 535, 535, 120, 1258, 722, 605, 647, 195, 195, 297, 698, 38, 647, 297, 605, 1126, 548, 548, 524, 59, 437, 1243, 1243, 1243, 1243, 1243, 1252, 1243, 1243, 1248, 1248, 1126, 538, 1248, 1248, 538, 1252, 1243, 1243, 447, 1150, 72, 1150, 1253, 1243, 447, 447, 177, 201, 491, 1242, 1242, 814, 1242, 157, 160, 814, 1249, 1249, 1126, 548, 548, 447, 535, 224, 820, 820, 820, 820, 534, 618, 619, 551, 127, 179, 213, 179, 1150, 292, 645, 120, 38, 890, 657, 890, 1246, 35, 156, 201, 723, 727, 302, 631, 607, 154, 203, 534, 399, 472, 658, 38, 1253, 745, 565, 292, 534, 173, 1243, 681, 1249, 399, 600, 156, 1038, 814, 302, 631, 686, 535, 538, 491, 643, 59, 674, 607, 670, 84, 437, 677, 491, 956, 38, 677, 177, 308, 534, 1241, 1249, 871, 891, 892, 1259, 886, 1126, 171, 887, 1241, 177, 447, 911, 362, 758, 211, 703, 548, 535, 548, 548, 1243, 311, 222, 836, 548, 823, 1243, 535, 1216, 1217, 1223, 120, 143, 149, 163, 297, 454, 466, 1219, 1220, 1222, 535, 535, 1227, 1227, 1150, 535, 1151, 177, 1150, 1150, 1150, 534, 535, 538, 535, 1166, 535, 477, 416, 535, 205, 288, 1163, 1150, 1150, 1150, 535, 59, 1057, 1169, 1169, 392, 1047, 1150, 535, 538, 38, 1106, 120, 1118, 1119, 1151, 81, 1242, 535, 1150, 534, 1088, 1096, 534, 535, 1111, 535, 102, 187, 381, 534, 1072, 1073, 1074, 1075, 1076, 1077, 1150, 1170, 1171, 1258, 1057, 535, 1035, 1006, 92, 853, 855, 136, 487, 1025, 1026, 1027, 1028, 1150, 836, 308, 836, 535, 447, 402, 1017, 535, 202, 660, 663, 310, 900, 814, 546, 814, 361, 660, 660, 643, 38, 157, 157, 534, 596, 785, 1253, 1243, 447, 534, 866, 900, 902, 795, 534, 534, 803, 1243, 535, 534, 535, 402, 1017, 1243, 1243, 534, 534, 534, 491, 515, 976, 369, 976, 976, 171, 1243, 596, 1243, 820, 624, 625, 1261, 54, 101, 126, 145, 150, 172, 176, 191, 297, 352, 620, 618, 1249, 866, 38, 907, 907, 535, 194, 534, 472, 678, 264, 661, 678, 534, 776, 768, 534, 535, 538, 1241, 535, 399, 29, 83, 86, 93, 121, 181, 194, 207, 419, 422, 651, 651, 1240, 1243, 1243, 535, 1038, 746, 157, 113, 722, 177, 1243, 38, 1243, 686, 632, 1241, 535, 636, 312, 1258, 675, 670, 674, 125, 140, 341, 1243, 64, 72, 256, 1038, 814, 1097, 853, 177, 771, 873, 535, 538, 457, 147, 544, 885, 888, 1108, 414, 414, 535, 282, 306, 759, 760, 761, 171, 764, 702, 288, 476, 704, 705, 1243, 844, 538, 38, 1150, 37, 301, 308, 535, 491, 493, 1218, 1219, 1221, 171, 1151, 1160, 1189, 288, 510, 205, 535, 1189, 188, 354, 385, 1176, 58, 129, 112, 1048, 38, 1121, 1107, 1104, 534, 1151, 535, 538, 38, 1114, 1115, 1258, 535, 1242, 1189, 535, 534, 403, 534, 535, 538, 538, 38, 1062, 477, 1243, 535, 538, 293, 470, 265, 292, 1011, 1026, 35, 1029, 1029, 838, 849, 548, 1243, 437, 854, 534, 890, 534, 859, 599, 1241, 890, 890, 194, 1150, 472, 597, 402, 1017, 1243, 1193, 171, 798, 798, 1193, 1193, 1150, 437, 1189, 1189, 608, 609, 1260, 813, 814, 813, 814, 1242, 548, 535, 538, 120, 527, 534, 575, 626, 698, 973, 1249, 973, 292, 297, 352, 973, 973, 1108, 907, 42, 199, 288, 656, 534, 694, 1150, 206, 178, 328, 408, 308, 665, 666, 667, 535, 1246, 6, 777, 727, 632, 669, 1243, 535, 722, 164, 797, 600, 956, 1241, 495, 1087, 722, 1038, 1001, 670, 632, 669, 643, 534, 676, 674, 675, 385, 385, 72, 311, 72, 686, 852, 535, 1241, 772, 880, 891, 1126, 537, 136, 491, 491, 760, 384, 434, 762, 141, 765, 487, 767, 476, 702, 722, 548, 1217, 1261, 149, 37, 88, 461, 495, 37, 495, 239, 307, 1226, 308, 535, 1150, 535, 535, 477, 52, 103, 460, 1150, 1177, 1178, 1177, 1177, 535, 168, 168, 658, 1243, 1215, 1111, 538, 1119, 1261, 535, 538, 171, 1126, 535, 535, 1189, 534, 1189, 1073, 1171, 1173, 1080, 1038, 1108, 855, 402, 265, 1150, 443, 443, 177, 1243, 658, 678, 900, 860, 859, 657, 678, 678, 694, 535, 1150, 437, 535, 314, 392, 358, 799, 799, 535, 535, 535, 1243, 535, 535, 535, 538, 1248, 976, 625, 575, 627, 628, 1249, 1249, 297, 527, 658, 527, 658, 1249, 1249, 208, 695, 535, 437, 125, 470, 308, 667, 308, 666, 534, 535, 538, 607, 399, 722, 814, 38, 38, 534, 1243, 956, 686, 674, 607, 670, 534, 672, 673, 1155, 1258, 677, 675, 676, 311, 311, 534, 202, 856, 171, 886, 30, 217, 943, 179, 179, 973, 384, 418, 766, 534, 156, 495, 37, 495, 37, 495, 495, 353, 353, 1221, 143, 149, 1178, 384, 170, 339, 170, 339, 153, 1179, 1179, 1179, 59, 59, 402, 81, 535, 1152, 1115, 315, 3, 120, 292, 297, 332, 1116, 1117, 38, 1092, 368, 1102, 535, 1072, 535, 1020, 59, 125, 136, 470, 1030, 1031, 136, 216, 1032, 836, 1017, 535, 664, 535, 860, 661, 772, 772, 1243, 866, 59, 1017, 447, 608, 814, 535, 538, 527, 658, 535, 423, 1243, 63, 288, 373, 402, 668, 668, 535, 6, 399, 1243, 794, 1038, 722, 675, 670, 674, 1150, 535, 538, 858, 858, 676, 677, 853, 534, 646, 141, 293, 534, 938, 940, 944, 1003, 1012, 1019, 1038, 1049, 866, 866, 763, 1258, 1150, 768, 495, 495, 308, 308, 535, 1219, 35, 103, 186, 288, 444, 658, 658, 1258, 534, 1165, 1151, 1151, 297, 1151, 1117, 1258, 534, 535, 1108, 413, 438, 293, 402, 293, 120, 322, 478, 534, 1033, 548, 772, 665, 1017, 814, 534, 628, 24, 120, 297, 1243, 722, 956, 676, 674, 675, 535, 673, 546, 546, 677, 535, 855, 857, 600, 384, 939, 940, 941, 1039, 1040, 538, 538, 535, 1246, 388, 388, 308, 1178, 384, 316, 402, 402, 447, 472, 281, 1122, 1123, 1258, 81, 1150, 1020, 478, 1006, 534, 1007, 772, 1189, 657, 657, 722, 677, 675, 676, 858, 856, 535, 538, 677, 767, 535, 537, 447, 177, 534, 425, 425, 149, 1258, 1258, 228, 1246, 1247, 1258, 332, 1124, 535, 538, 171, 1126, 1114, 535, 477, 1189, 535, 535, 676, 677, 546, 646, 855, 1108, 156, 941, 414, 414, 5, 769, 770, 1248, 1249, 1261, 534, 120, 1249, 1222, 1123, 315, 157, 332, 1125, 1224, 535, 1033, 535, 322, 1033, 677, 600, 768, 491, 491, 535, 538, 1190, 1247, 38, 81, 535, 1125, 1249, 1218, 1125, 1006, 677, 1246, 179, 179, 770, 1057, 472, 1243, 534, 1222, 1226, 1218, 477, 1108, 534, 866, 866, 535, 1258, 81, 1122, 1221, 1226, 1033, 769, 534, 535, 1221, 535, 1122, 535 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 540, 541, 541, 541, 541, 541, 541, 542, 542, 543, 543, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 545, 545, 546, 546, 547, 547, 548, 548, 548, 549, 550, 551, 551, 551, 552, 552, 553, 553, 554, 554, 554, 554, 554, 554, 554, 554, 554, 555, 555, 555, 555, 555, 555, 556, 557, 557, 558, 558, 559, 559, 559, 559, 560, 560, 560, 560, 560, 560, 561, 562, 563, 563, 564, 564, 564, 564, 565, 565, 566, 566, 566, 566, 566, 566, 567, 567, 567, 567, 567, 568, 568, 568, 569, 569, 569, 569, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 571, 571, 572, 572, 573, 573, 574, 574, 574, 574, 575, 575, 575, 575, 576, 576, 576, 576, 576, 576, 576, 577, 577, 577, 578, 578, 579, 579, 580, 580, 580, 580, 581, 581, 582, 582, 583, 583, 584, 584, 584, 584, 584, 584, 584, 585, 586, 586, 587, 587, 588, 589, 589, 589, 589, 589, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 591, 591, 592, 592, 592, 593, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 595, 595, 596, 596, 597, 597, 598, 598, 598, 598, 599, 600, 600, 601, 601, 602, 602, 602, 602, 603, 603, 604, 604, 604, 604, 605, 605, 606, 606, 607, 607, 607, 607, 608, 609, 609, 610, 611, 611, 612, 612, 612, 612, 613, 613, 614, 614, 615, 615, 616, 616, 617, 617, 617, 618, 618, 619, 619, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 621, 621, 622, 622, 623, 623, 624, 624, 625, 626, 626, 626, 626, 626, 626, 627, 627, 628, 629, 629, 629, 629, 629, 629, 630, 630, 630, 630, 630, 630, 630, 630, 631, 631, 632, 632, 633, 633, 634, 634, 635, 635, 635, 636, 636, 637, 638, 638, 639, 639, 640, 640, 641, 641, 642, 642, 643, 643, 644, 644, 644, 644, 645, 645, 645, 645, 645, 645, 645, 645, 645, 646, 646, 646, 647, 647, 648, 648, 648, 648, 649, 650, 650, 650, 651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 652, 652, 653, 653, 653, 653, 653, 653, 653, 654, 654, 655, 655, 656, 656, 657, 657, 658, 658, 659, 660, 660, 661, 661, 661, 661, 662, 662, 663, 663, 664, 664, 665, 665, 665, 665, 665, 666, 667, 668, 668, 668, 668, 668, 669, 669, 670, 670, 671, 672, 672, 673, 673, 673, 674, 674, 675, 675, 675, 676, 676, 676, 676, 677, 677, 678, 678, 679, 680, 680, 681, 681, 682, 682, 682, 683, 683, 684, 684, 685, 686, 686, 686, 687, 687, 688, 689, 689, 690, 691, 691, 692, 692, 693, 693, 694, 694, 695, 695, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 697, 697, 698, 698, 698, 698, 699, 699, 700, 700, 701, 701, 702, 702, 703, 703, 704, 704, 705, 705, 706, 706, 707, 708, 708, 709, 709, 710, 710, 711, 711, 712, 712, 712, 712, 713, 714, 714, 715, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 717, 718, 718, 718, 718, 719, 719, 720, 720, 721, 721, 722, 722, 723, 723, 724, 725, 725, 726, 726, 726, 726, 727, 728, 729, 730, 730, 731, 731, 732, 732, 733, 733, 734, 734, 734, 735, 735, 735, 735, 736, 737, 737, 738, 738, 739, 739, 740, 740, 741, 741, 742, 743, 744, 745, 745, 746, 746, 747, 747, 748, 748, 749, 749, 750, 750, 751, 751, 751, 751, 751, 752, 753, 753, 754, 754, 755, 755, 755, 756, 756, 757, 757, 757, 757, 757, 758, 758, 759, 759, 760, 761, 761, 762, 762, 763, 764, 764, 765, 765, 766, 766, 767, 767, 768, 768, 769, 769, 769, 770, 770, 770, 770, 771, 771, 772, 772, 773, 773, 773, 773, 773, 773, 774, 774, 775, 775, 776, 777, 777, 778, 779, 779, 779, 779, 780, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 782, 783, 783, 784, 784, 785, 785, 785, 785, 785, 785, 786, 787, 787, 788, 789, 789, 790, 790, 791, 791, 791, 791, 791, 792, 792, 793, 794, 794, 795, 795, 795, 795, 795, 796, 796, 797, 797, 798, 798, 798, 799, 799, 800, 801, 801, 802, 802, 803, 803, 804, 804, 805, 805, 806, 807, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 810, 810, 810, 810, 810, 811, 811, 811, 811, 811, 811, 811, 811, 812, 812, 812, 813, 813, 814, 814, 815, 815, 816, 816, 817, 818, 818, 818, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 820, 820, 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, 822, 822, 823, 823, 824, 824, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 826, 826, 827, 827, 828, 829, 829, 830, 830, 830, 830, 830, 831, 831, 832, 832, 832, 832, 832, 833, 833, 834, 834, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 836, 836, 837, 837, 838, 838, 839, 839, 840, 840, 841, 841, 842, 843, 843, 843, 844, 844, 845, 846, 846, 847, 847, 847, 848, 848, 848, 849, 849, 849, 849, 849, 849, 850, 850, 851, 851, 852, 852, 853, 853, 854, 854, 855, 855, 855, 856, 856, 857, 857, 858, 858, 859, 859, 859, 860, 860, 860, 861, 861, 861, 861, 862, 862, 863, 863, 864, 864, 865, 865, 866, 866, 866, 866, 867, 867, 868, 868, 869, 869, 869, 869, 869, 870, 870, 870, 870, 870, 871, 872, 873, 873, 873, 874, 874, 874, 875, 876, 876, 876, 876, 877, 877, 878, 879, 879, 880, 880, 881, 881, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 883, 883, 883, 883, 883, 884, 884, 885, 886, 886, 886, 887, 887, 888, 888, 889, 889, 890, 890, 891, 892, 892, 893, 893, 893, 894, 894, 895, 895, 896, 896, 896, 896, 896, 896, 897, 897, 898, 898, 899, 899, 899, 899, 900, 900, 901, 901, 902, 903, 904, 904, 905, 905, 906, 906, 906, 907, 907, 907, 908, 909, 909, 910, 911, 911, 911, 911, 912, 913, 913, 913, 914, 914, 915, 915, 916, 916, 917, 917, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 919, 919, 920, 920, 921, 921, 921, 921, 921, 921, 922, 922, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 924, 925, 925, 926, 926, 926, 927, 927, 927, 927, 927, 928, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 930, 930, 930, 931, 931, 931, 931, 931, 931, 931, 932, 932, 933, 933, 933, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935, 936, 936, 937, 938, 938, 938, 939, 939, 940, 940, 940, 940, 940, 941, 941, 942, 942, 942, 942, 943, 943, 943, 944, 945, 945, 946, 947, 947, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 949, 949, 950, 950, 950, 951, 951, 951, 951, 951, 952, 952, 952, 953, 953, 954, 954, 954, 955, 955, 955, 955, 956, 956, 956, 956, 957, 958, 959, 959, 960, 960, 961, 961, 961, 962, 962, 962, 962, 962, 962, 962, 963, 963, 964, 964, 964, 964, 965, 966, 966, 966, 966, 967, 967, 968, 969, 970, 970, 971, 972, 972, 972, 972, 972, 972, 972, 973, 973, 974, 975, 975, 975, 975, 975, 975, 976, 976, 977, 978, 978, 978, 978, 978, 979, 979, 980, 980, 981, 981, 982, 982, 983, 983, 984, 985, 985, 985, 986, 986, 986, 987, 987, 988, 988, 989, 989, 990, 990, 991, 991, 992, 993, 993, 994, 994, 995, 995, 995, 995, 996, 996, 996, 996, 996, 996, 996, 996, 996, 996, 997, 998, 998, 999, 999, 999, 999, 999, 1000, 1000, 1000, 1001, 1001, 1002, 1002, 1002, 1002, 1003, 1004, 1004, 1005, 1005, 1005, 1005, 1005, 1006, 1006, 1007, 1007, 1008, 1009, 1009, 1009, 1010, 1010, 1010, 1011, 1011, 1012, 1013, 1013, 1014, 1015, 1015, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1017, 1017, 1018, 1018, 1018, 1019, 1020, 1020, 1021, 1021, 1022, 1023, 1023, 1024, 1025, 1025, 1026, 1026, 1026, 1026, 1026, 1027, 1027, 1028, 1028, 1029, 1029, 1030, 1031, 1032, 1032, 1032, 1032, 1032, 1033, 1034, 1035, 1036, 1036, 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1038, 1038, 1039, 1039, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1043, 1043, 1043, 1044, 1044, 1045, 1046, 1046, 1046, 1047, 1047, 1047, 1048, 1048, 1048, 1049, 1049, 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1052, 1052, 1053, 1053, 1053, 1054, 1054, 1055, 1055, 1056, 1056, 1057, 1057, 1058, 1059, 1059, 1060, 1060, 1061, 1061, 1061, 1061, 1062, 1062, 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1067, 1067, 1067, 1068, 1068, 1069, 1069, 1070, 1070, 1071, 1071, 1072, 1072, 1073, 1073, 1073, 1073, 1073, 1074, 1075, 1076, 1077, 1078, 1078, 1079, 1079, 1080, 1080, 1081, 1081, 1082, 1083, 1083, 1083, 1083, 1084, 1084, 1085, 1085, 1086, 1086, 1087, 1087, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1089, 1089, 1089, 1089, 1089, 1089, 1090, 1090, 1090, 1090, 1091, 1091, 1092, 1092, 1093, 1093, 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1095, 1095, 1096, 1096, 1097, 1097, 1098, 1098, 1098, 1099, 1099, 1100, 1100, 1100, 1101, 1102, 1102, 1103, 1103, 1104, 1105, 1105, 1106, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1109, 1110, 1110, 1111, 1111, 1112, 1113, 1113, 1114, 1114, 1115, 1115, 1115, 1116, 1116, 1117, 1117, 1117, 1117, 1117, 1118, 1118, 1119, 1119, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1123, 1123, 1123, 1123, 1124, 1124, 1125, 1125, 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1127, 1127, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129, 1129, 1129, 1130, 1130, 1131, 1131, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1137, 1138, 1138, 1139, 1139, 1140, 1141, 1142, 1142, 1142, 1142, 1142, 1142, 1143, 1143, 1144, 1144, 1144, 1144, 1145, 1146, 1146, 1146, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1148, 1148, 1149, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 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, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 1154, 1154, 1155, 1155, 1155, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1157, 1157, 1158, 1158, 1158, 1158, 1159, 1160, 1160, 1161, 1161, 1162, 1162, 1163, 1163, 1163, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1166, 1166, 1167, 1167, 1168, 1168, 1169, 1169, 1170, 1170, 1171, 1172, 1172, 1172, 1173, 1174, 1174, 1175, 1175, 1176, 1176, 1176, 1176, 1177, 1177, 1178, 1178, 1178, 1178, 1178, 1179, 1179, 1179, 1179, 1179, 1180, 1180, 1180, 1181, 1181, 1182, 1183, 1183, 1183, 1184, 1184, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1186, 1186, 1187, 1187, 1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1190, 1190, 1191, 1191, 1191, 1192, 1192, 1193, 1193, 1194, 1194, 1194, 1195, 1195, 1196, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1198, 1198, 1198, 1198, 1199, 1199, 1200, 1201, 1201, 1201, 1201, 1201, 1202, 1202, 1202, 1203, 1203, 1204, 1205, 1205, 1206, 1207, 1207, 1208, 1208, 1209, 1209, 1210, 1210, 1210, 1210, 1211, 1211, 1212, 1212, 1213, 1213, 1214, 1214, 1215, 1215, 1216, 1216, 1217, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1219, 1219, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1221, 1221, 1221, 1221, 1222, 1222, 1223, 1224, 1224, 1225, 1225, 1226, 1226, 1226, 1226, 1226, 1227, 1227, 1228, 1228, 1228, 1228, 1228, 1229, 1229, 1229, 1229, 1229, 1230, 1230, 1231, 1231, 1232, 1232, 1232, 1233, 1233, 1233, 1234, 1234, 1235, 1235, 1236, 1236, 1237, 1237, 1238, 1238, 1239, 1239, 1239, 1239, 1240, 1240, 1241, 1241, 1242, 1242, 1243, 1244, 1245, 1246, 1246, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1248, 1249, 1250, 1250, 1250, 1251, 1252, 1252, 1252, 1252, 1253, 1253, 1254, 1255, 1256, 1256, 1257, 1257, 1258, 1258, 1258, 1259, 1259, 1259, 1260, 1260, 1260, 1260, 1261, 1261, 1261, 1261, 1261, 1262, 1262, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 2, 2, 2, 2, 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, 0, 1, 0, 1, 0, 1, 0, 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, 2, 0, 1, 1, 1, 1, 1, 1, 3, 2, 2, 3, 3, 2, 5, 1, 3, 3, 3, 3, 1, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 4, 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, 5, 7, 1, 3, 4, 4, 4, 3, 2, 5, 3, 6, 4, 6, 6, 9, 5, 7, 6, 6, 5, 5, 5, 5, 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, 4, 3, 2, 2, 3, 4, 4, 4, 5, 1, 3, 2, 2, 0, 2, 0, 1, 1, 1, 3, 3, 2, 0, 1, 3, 3, 1, 5, 3, 1, 2, 1, 3, 2, 3, 1, 1, 1, 1, 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, 4, 3, 3, 2, 1, 0, 3, 0, 1, 0, 1, 3, 2, 1, 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, 6, 2, 4, 2, 2, 1, 0, 2, 2, 1, 0, 2, 0, 3, 1, 1, 2, 2, 1, 4, 4, 5, 2, 5, 7, 5, 2, 3, 0, 1, 2, 1, 2, 2, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 9, 3, 9, 4, 10, 11, 3, 1, 5, 3, 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, 3, 3, 4, 0, 1, 0, 6, 1, 3, 3, 3, 5, 2, 0, 2, 2, 0, 3, 4, 4, 0, 2, 0, 4, 0, 3, 8, 11, 1, 3, 1, 1, 3, 6, 8, 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, 1, 0, 7, 2, 0, 3, 5, 5, 8, 2, 0, 2, 2, 2, 1, 5, 2, 0, 2, 6, 6, 6, 10, 6, 6, 6, 9, 9, 6, 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, 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, 17, 21, 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, 6, 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, 1, 1, 1, 1, 1, 2, 2, 1, 3, 2, 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, 6, 8, 9, 8, 6, 6, 9, 9, 9, 7, 10, 1, 1, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 2, 0, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 4, 4, 3, 4, 4, 1, 1, 1, 0, 8, 8, 11, 1, 1, 2, 4, 5, 1, 3, 2, 2, 2, 2, 2, 1, 3, 1, 3, 1, 2, 2, 4, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 5, 5, 5, 5, 5, 1, 3, 1, 2, 3, 0, 5, 7, 6, 9, 3, 1, 2, 1, 1, 1, 3, 0, 5, 2, 0, 3, 3, 3, 7, 7, 10, 1, 1, 1, 1, 1, 1, 16, 19, 1, 0, 2, 0, 1, 3, 4, 5, 2, 2, 4, 4, 0, 1, 3, 2, 0, 1, 1, 0, 2, 2, 0, 9, 12, 7, 7, 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, 0, 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, 2, 1, 4, 0, 3, 0, 1, 1, 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, 5, 5, 5, 1, 1, 1, 1, 3, 0, 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, 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, 8, 8, 8, 10, 9, 8, 1, 0, 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, 1, 7, 6, 6, 6, 6, 6, 6, 7, 7, 6, 9, 9, 6, 6, 6, 6, 6, 6, 8, 8, 8, 6, 7, 6, 6, 4, 7, 6, 4, 4, 4, 3, 4, 3, 1, 1, 3, 5, 5, 5, 5, 8, 5, 5, 6, 7, 7, 7, 4, 4, 5, 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, 2, 3, 2, 5, 4, 3, 3, 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, 6, 4, 3, 5, 7, 9, 1, 3, 1, 5, 4, 4, 6, 4, 6, 6, 5, 7, 9, 6, 1, 0, 6, 11, 11, 11, 13, 9, 11, 1, 1, 10, 6, 4, 4, 2, 5, 2, 0, 6, 5, 3, 5, 1, 3, 1, 1, 2, 1, 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, 5, 3, 0, 1, 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, 10, 1, 2, 4, 4, 4, 5, 5, 2, 5, 3, 5, 2, 0, 3, 1, 2, 5, 5, 8, 3, 4, 7, 1, 0, 3, 2, 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, 9, 1, 2, 0, 7, 7, 0, 10, 6, 0, 1, 0, 2, 0, 3, 3, 4, 4, 4, 4, 3, 2, 1, 1, 0, 1, 1, 0, 1, 5, 1, 0, 1, 1, 1, 0, 3, 1, 3, 4, 3, 2, 2, 1, 1, 1, 0, 2, 4, 5, 6, 4, 5, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 4, 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, 2, 3, 3, 4, 5, 4, 5, 4, 5, 2, 4, 1, 1, 0, 2, 0, 1, 4, 5, 4, 0, 2, 2, 2, 1, 1, 0, 5, 2, 1, 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, 2, 1, 3, 3, 2, 13, 2, 0, 1, 3, 3, 6, 7, 5, 7, 9, 1, 0, 2, 0, 2, 3, 5, 6, 2, 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, 4, 1, 1, 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, 1, 3, 3, 5, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 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, 3, 4, 4, 6, 3, 3, 4, 3, 4, 4, 5, 4, 5, 1, 1, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 6, 3, 4, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 2, 1, 1, 4, 3, 5, 6, 8, 6, 6, 4, 4, 3, 1, 1, 1, 1, 5, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 1, 6, 4, 4, 6, 4, 4, 4, 4, 4, 6, 5, 5, 5, 4, 6, 4, 4, 4, 4, 5, 7, 7, 9, 5, 4, 6, 5, 7, 7, 8, 4, 7, 4, 6, 6, 4, 5, 4, 5, 3, 11, 8, 9, 2, 3, 3, 3, 4, 0, 4, 1, 3, 3, 1, 1, 1, 1, 2, 0, 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, 0, 1, 3, 3, 3, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 3, 5, 5, 3, 3, 5, 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, 2, 0, 1, 3, 3, 2, 3, 2, 3, 4, 4, 3, 3, 0, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 3, 6, 0, 3, 0, 2, 4, 2, 1, 0, 5, 2, 5, 2, 0, 3, 0, 1, 2, 2, 2, 2, 3, 2, 3, 2, 0, 1, 3, 3, 3, 3, 3, 0, 3, 3, 0, 1, 3, 7, 7, 3, 0, 1, 0, 1, 3, 3, 2, 1, 1, 1, 3, 1, 2, 1, 3, 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, 1, 3, 10, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 954 "gram.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); (void) yynerrs; /* suppress compiler warning */ } #line 30926 "gram.c" /* yacc.c:1646 */ break; case 3: #line 959 "gram.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = list_make1((yyvsp[0].typnam)); } #line 30934 "gram.c" /* yacc.c:1646 */ break; case 4: #line 963 "gram.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyvsp[0].node), 0)); } #line 30943 "gram.c" /* yacc.c:1646 */ break; case 5: #line 968 "gram.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30955 "gram.c" /* yacc.c:1646 */ break; case 6: #line 976 "gram.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30967 "gram.c" /* yacc.c:1646 */ break; case 7: #line 984 "gram.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30979 "gram.c" /* yacc.c:1646 */ break; case 8: #line 1004 "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 30995 "gram.c" /* yacc.c:1646 */ break; case 9: #line 1016 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), 0)); else (yyval.list) = NIL; } #line 31006 "gram.c" /* yacc.c:1646 */ break; case 136: #line 1159 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 31012 "gram.c" /* yacc.c:1646 */ break; case 137: #line 1166 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31018 "gram.c" /* yacc.c:1646 */ break; case 138: #line 1167 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31024 "gram.c" /* yacc.c:1646 */ break; case 139: #line 1171 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31030 "gram.c" /* yacc.c:1646 */ break; case 140: #line 1172 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31036 "gram.c" /* yacc.c:1646 */ break; case 141: #line 1176 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 31042 "gram.c" /* yacc.c:1646 */ break; case 142: #line 1177 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 31048 "gram.c" /* yacc.c:1646 */ break; case 143: #line 1181 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_CASCADE; } #line 31054 "gram.c" /* yacc.c:1646 */ break; case 144: #line 1182 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; } #line 31060 "gram.c" /* yacc.c:1646 */ break; case 145: #line 1183 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 31066 "gram.c" /* yacc.c:1646 */ break; case 146: #line 1193 "gram.y" /* yacc.c:1646 */ { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *) n; } #line 31077 "gram.c" /* yacc.c:1646 */ break; case 147: #line 1209 "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 31090 "gram.c" /* yacc.c:1646 */ break; case 151: #line 1231 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31096 "gram.c" /* yacc.c:1646 */ break; case 152: #line 1232 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31102 "gram.c" /* yacc.c:1646 */ break; case 153: #line 1236 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31108 "gram.c" /* yacc.c:1646 */ break; case 154: #line 1237 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31114 "gram.c" /* yacc.c:1646 */ break; case 155: #line 1242 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 31123 "gram.c" /* yacc.c:1646 */ break; case 156: #line 1247 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 31131 "gram.c" /* yacc.c:1646 */ break; case 157: #line 1251 "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 31145 "gram.c" /* yacc.c:1646 */ break; case 158: #line 1261 "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 31157 "gram.c" /* yacc.c:1646 */ break; case 159: #line 1269 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("inherit", (Node *) makeBoolean(true), (yylsp[0])); } #line 31165 "gram.c" /* yacc.c:1646 */ break; case 160: #line 1273 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 31173 "gram.c" /* yacc.c:1646 */ break; case 161: #line 1277 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validUntil", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 31181 "gram.c" /* yacc.c:1646 */ break; case 162: #line 1282 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31189 "gram.c" /* yacc.c:1646 */ break; case 163: #line 1286 "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 *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nosuperuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createrole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreaterole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "replication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "noreplication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createdb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreatedb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "login") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nologin") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "bypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nobypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *) makeBoolean(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 *) makeBoolean(false), (yylsp[0])); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", (yyvsp[0].str)), parser_errposition((yylsp[0])))); } #line 31238 "gram.c" /* yacc.c:1646 */ break; case 164: #line 1333 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 31244 "gram.c" /* yacc.c:1646 */ break; case 165: #line 1336 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("sysid", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 31252 "gram.c" /* yacc.c:1646 */ break; case 166: #line 1340 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("adminmembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31260 "gram.c" /* yacc.c:1646 */ break; case 167: #line 1344 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31268 "gram.c" /* yacc.c:1646 */ break; case 168: #line 1348 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 31276 "gram.c" /* yacc.c:1646 */ break; case 169: #line 1352 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 31284 "gram.c" /* yacc.c:1646 */ break; case 170: #line 1366 "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 31297 "gram.c" /* yacc.c:1646 */ break; case 171: #line 1385 "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 31310 "gram.c" /* yacc.c:1646 */ break; case 172: #line 1394 "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 31323 "gram.c" /* yacc.c:1646 */ break; case 173: #line 1405 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31329 "gram.c" /* yacc.c:1646 */ break; case 174: #line 1406 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31335 "gram.c" /* yacc.c:1646 */ break; case 175: #line 1411 "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 31348 "gram.c" /* yacc.c:1646 */ break; case 176: #line 1420 "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 31361 "gram.c" /* yacc.c:1646 */ break; case 177: #line 1429 "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 31374 "gram.c" /* yacc.c:1646 */ break; case 178: #line 1438 "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 31387 "gram.c" /* yacc.c:1646 */ break; case 179: #line 1460 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31399 "gram.c" /* yacc.c:1646 */ break; case 180: #line 1468 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31411 "gram.c" /* yacc.c:1646 */ break; case 181: #line 1476 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31423 "gram.c" /* yacc.c:1646 */ break; case 182: #line 1484 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 31435 "gram.c" /* yacc.c:1646 */ break; case 183: #line 1492 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31447 "gram.c" /* yacc.c:1646 */ break; case 184: #line 1500 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31459 "gram.c" /* yacc.c:1646 */ break; case 185: #line 1518 "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 31472 "gram.c" /* yacc.c:1646 */ break; case 186: #line 1537 "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 31486 "gram.c" /* yacc.c:1646 */ break; case 187: #line 1548 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = +1; } #line 31492 "gram.c" /* yacc.c:1646 */ break; case 188: #line 1549 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = -1; } #line 31498 "gram.c" /* yacc.c:1646 */ break; case 189: #line 1561 "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 31513 "gram.c" /* yacc.c:1646 */ break; case 190: #line 1572 "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 31528 "gram.c" /* yacc.c:1646 */ break; case 191: #line 1583 "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 31548 "gram.c" /* yacc.c:1646 */ break; case 192: #line 1599 "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 31568 "gram.c" /* yacc.c:1646 */ break; case 193: #line 1618 "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 31578 "gram.c" /* yacc.c:1646 */ break; case 194: #line 1624 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31584 "gram.c" /* yacc.c:1646 */ break; case 201: #line 1652 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 31595 "gram.c" /* yacc.c:1646 */ break; case 202: #line 1659 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolQueryCacheStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 31606 "gram.c" /* yacc.c:1646 */ break; case 203: #line 1666 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 31617 "gram.c" /* yacc.c:1646 */ break; case 204: #line 1673 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 31628 "gram.c" /* yacc.c:1646 */ break; case 205: #line 1680 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 31639 "gram.c" /* yacc.c:1646 */ break; case 206: #line 1690 "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 31652 "gram.c" /* yacc.c:1646 */ break; case 207: #line 1699 "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 31665 "gram.c" /* yacc.c:1646 */ break; case 209: #line 1712 "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 31678 "gram.c" /* yacc.c:1646 */ break; case 210: #line 1721 "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 31691 "gram.c" /* yacc.c:1646 */ break; case 211: #line 1730 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31703 "gram.c" /* yacc.c:1646 */ break; case 212: #line 1738 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31715 "gram.c" /* yacc.c:1646 */ break; case 213: #line 1748 "gram.y" /* yacc.c:1646 */ {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 31721 "gram.c" /* yacc.c:1646 */ break; case 214: #line 1750 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31733 "gram.c" /* yacc.c:1646 */ break; case 215: #line 1759 "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 31749 "gram.c" /* yacc.c:1646 */ break; case 216: #line 1771 "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 31761 "gram.c" /* yacc.c:1646 */ break; case 217: #line 1779 "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 31774 "gram.c" /* yacc.c:1646 */ break; case 218: #line 1788 "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 31790 "gram.c" /* yacc.c:1646 */ break; case 219: #line 1800 "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 31803 "gram.c" /* yacc.c:1646 */ break; case 220: #line 1809 "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 31816 "gram.c" /* yacc.c:1646 */ break; case 221: #line 1818 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 31828 "gram.c" /* yacc.c:1646 */ break; case 222: #line 1826 "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 31841 "gram.c" /* yacc.c:1646 */ break; case 223: #line 1836 "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 31854 "gram.c" /* yacc.c:1646 */ break; case 224: #line 1846 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = (yyvsp[0].str); /* query to delete query cache */ (yyval.vsetstmt) = n; } #line 31864 "gram.c" /* yacc.c:1646 */ break; case 225: #line 1853 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31870 "gram.c" /* yacc.c:1646 */ break; case 226: #line 1855 "gram.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 31876 "gram.c" /* yacc.c:1646 */ break; case 227: #line 1858 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 31882 "gram.c" /* yacc.c:1646 */ break; case 228: #line 1859 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 31888 "gram.c" /* yacc.c:1646 */ break; case 229: #line 1863 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31894 "gram.c" /* yacc.c:1646 */ break; case 230: #line 1865 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 31900 "gram.c" /* yacc.c:1646 */ break; case 231: #line 1868 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read uncommitted"; } #line 31906 "gram.c" /* yacc.c:1646 */ break; case 232: #line 1869 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read committed"; } #line 31912 "gram.c" /* yacc.c:1646 */ break; case 233: #line 1870 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "repeatable read"; } #line 31918 "gram.c" /* yacc.c:1646 */ break; case 234: #line 1871 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "serializable"; } #line 31924 "gram.c" /* yacc.c:1646 */ break; case 235: #line 1875 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "true"; } #line 31930 "gram.c" /* yacc.c:1646 */ break; case 236: #line 1876 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "false"; } #line 31936 "gram.c" /* yacc.c:1646 */ break; case 237: #line 1877 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "on"; } #line 31942 "gram.c" /* yacc.c:1646 */ break; case 238: #line 1883 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31948 "gram.c" /* yacc.c:1646 */ break; case 239: #line 1896 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31956 "gram.c" /* yacc.c:1646 */ break; case 240: #line 1900 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31964 "gram.c" /* yacc.c:1646 */ break; case 241: #line 1904 "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.ival.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 31985 "gram.c" /* yacc.c:1646 */ break; case 242: #line 1921 "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 31997 "gram.c" /* yacc.c:1646 */ break; case 243: #line 1928 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 32003 "gram.c" /* yacc.c:1646 */ break; case 244: #line 1929 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32009 "gram.c" /* yacc.c:1646 */ break; case 245: #line 1930 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32015 "gram.c" /* yacc.c:1646 */ break; case 246: #line 1934 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32021 "gram.c" /* yacc.c:1646 */ break; case 247: #line 1935 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 32027 "gram.c" /* yacc.c:1646 */ break; case 248: #line 1936 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 32033 "gram.c" /* yacc.c:1646 */ break; case 249: #line 1940 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32039 "gram.c" /* yacc.c:1646 */ break; case 250: #line 1941 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32045 "gram.c" /* yacc.c:1646 */ break; case 251: #line 1945 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 32051 "gram.c" /* yacc.c:1646 */ break; case 252: #line 1947 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minimum */ (yyval.node) = (Node *) n; } #line 32061 "gram.c" /* yacc.c:1646 */ break; case 253: #line 1955 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 32067 "gram.c" /* yacc.c:1646 */ break; case 254: #line 1957 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; (yyval.vsetstmt) = n; } #line 32079 "gram.c" /* yacc.c:1646 */ break; case 255: #line 1965 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; (yyval.vsetstmt) = n; } #line 32091 "gram.c" /* yacc.c:1646 */ break; case 256: #line 1973 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 32103 "gram.c" /* yacc.c:1646 */ break; case 257: #line 1984 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); (yyval.vsetstmt) = n; } #line 32115 "gram.c" /* yacc.c:1646 */ break; case 258: #line 1992 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.vsetstmt) = n; } #line 32126 "gram.c" /* yacc.c:1646 */ break; case 259: #line 2002 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 32132 "gram.c" /* yacc.c:1646 */ break; case 260: #line 2003 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 32138 "gram.c" /* yacc.c:1646 */ break; case 261: #line 2008 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 32144 "gram.c" /* yacc.c:1646 */ break; case 262: #line 2009 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 32150 "gram.c" /* yacc.c:1646 */ break; case 263: #line 2016 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32160 "gram.c" /* yacc.c:1646 */ break; case 264: #line 2022 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 32170 "gram.c" /* yacc.c:1646 */ break; case 265: #line 2028 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32181 "gram.c" /* yacc.c:1646 */ break; case 266: #line 2035 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 32192 "gram.c" /* yacc.c:1646 */ break; case 267: #line 2042 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 32203 "gram.c" /* yacc.c:1646 */ break; case 268: #line 2049 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 32214 "gram.c" /* yacc.c:1646 */ break; case 269: #line 2056 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 32225 "gram.c" /* yacc.c:1646 */ break; case 270: #line 2067 "gram.y" /* yacc.c:1646 */ { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 32237 "gram.c" /* yacc.c:1646 */ break; case 271: #line 2077 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32243 "gram.c" /* yacc.c:1646 */ break; case 272: #line 2078 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32249 "gram.c" /* yacc.c:1646 */ break; case 273: #line 2082 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32255 "gram.c" /* yacc.c:1646 */ break; case 274: #line 2083 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32261 "gram.c" /* yacc.c:1646 */ break; case 275: #line 2092 "gram.y" /* yacc.c:1646 */ { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *) n; } #line 32271 "gram.c" /* yacc.c:1646 */ break; case 276: #line 2108 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 32282 "gram.c" /* yacc.c:1646 */ break; case 277: #line 2115 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 32293 "gram.c" /* yacc.c:1646 */ break; case 278: #line 2122 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 32304 "gram.c" /* yacc.c:1646 */ break; case 279: #line 2129 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 32315 "gram.c" /* yacc.c:1646 */ break; case 280: #line 2136 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 32326 "gram.c" /* yacc.c:1646 */ break; case 281: #line 2156 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32340 "gram.c" /* yacc.c:1646 */ break; case 282: #line 2166 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32354 "gram.c" /* yacc.c:1646 */ break; case 283: #line 2176 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32368 "gram.c" /* yacc.c:1646 */ break; case 284: #line 2186 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32382 "gram.c" /* yacc.c:1646 */ break; case 285: #line 2196 "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 32398 "gram.c" /* yacc.c:1646 */ break; case 286: #line 2208 "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 32414 "gram.c" /* yacc.c:1646 */ break; case 287: #line 2220 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32428 "gram.c" /* yacc.c:1646 */ break; case 288: #line 2230 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_INDEX; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32442 "gram.c" /* yacc.c:1646 */ break; case 289: #line 2240 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32456 "gram.c" /* yacc.c:1646 */ break; case 290: #line 2250 "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 32472 "gram.c" /* yacc.c:1646 */ break; case 291: #line 2262 "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 32488 "gram.c" /* yacc.c:1646 */ break; case 292: #line 2274 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_SEQUENCE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32502 "gram.c" /* yacc.c:1646 */ break; case 293: #line 2284 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_SEQUENCE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32516 "gram.c" /* yacc.c:1646 */ break; case 294: #line 2294 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_VIEW; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32530 "gram.c" /* yacc.c:1646 */ break; case 295: #line 2304 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_VIEW; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32544 "gram.c" /* yacc.c:1646 */ break; case 296: #line 2314 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_MATVIEW; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32558 "gram.c" /* yacc.c:1646 */ break; case 297: #line 2324 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_MATVIEW; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32572 "gram.c" /* yacc.c:1646 */ break; case 298: #line 2334 "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 32588 "gram.c" /* yacc.c:1646 */ break; case 299: #line 2346 "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 32604 "gram.c" /* yacc.c:1646 */ break; case 300: #line 2358 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_FOREIGN_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32618 "gram.c" /* yacc.c:1646 */ break; case 301: #line 2368 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_FOREIGN_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32632 "gram.c" /* yacc.c:1646 */ break; case 302: #line 2380 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32638 "gram.c" /* yacc.c:1646 */ break; case 303: #line 2381 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 32644 "gram.c" /* yacc.c:1646 */ break; case 304: #line 2387 "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); cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32661 "gram.c" /* yacc.c:1646 */ break; case 305: #line 2401 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = (yyvsp[-1].range); cmd->bound = NULL; cmd->concurrent = (yyvsp[0].boolean); n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32678 "gram.c" /* yacc.c:1646 */ break; case 306: #line 2414 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartitionFinalize; cmd->name = (yyvsp[-1].range); cmd->bound = NULL; cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32694 "gram.c" /* yacc.c:1646 */ break; case 307: #line 2430 "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; cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32711 "gram.c" /* yacc.c:1646 */ break; case 308: #line 2447 "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 32724 "gram.c" /* yacc.c:1646 */ break; case 309: #line 2457 "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 32737 "gram.c" /* yacc.c:1646 */ break; case 310: #line 2467 "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 32750 "gram.c" /* yacc.c:1646 */ break; case 311: #line 2477 "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 32763 "gram.c" /* yacc.c:1646 */ break; case 312: #line 2487 "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 32776 "gram.c" /* yacc.c:1646 */ break; case 313: #line 2497 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 32788 "gram.c" /* yacc.c:1646 */ break; case 314: #line 2506 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 32800 "gram.c" /* yacc.c:1646 */ break; case 315: #line 2515 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetExpression; n->name = (yyvsp[-6].str); n->def = (yyvsp[-1].node); (yyval.node) = (Node *) n; } #line 32813 "gram.c" /* yacc.c:1646 */ break; case 316: #line 2525 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-2].str); (yyval.node) = (Node *) n; } #line 32825 "gram.c" /* yacc.c:1646 */ break; case 317: #line 2534 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32838 "gram.c" /* yacc.c:1646 */ break; case 318: #line 2544 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = (yyvsp[-3].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32851 "gram.c" /* yacc.c:1646 */ break; case 319: #line 2554 "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 = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32870 "gram.c" /* yacc.c:1646 */ break; case 320: #line 2570 "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 32883 "gram.c" /* yacc.c:1646 */ break; case 321: #line 2580 "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 32896 "gram.c" /* yacc.c:1646 */ break; case 322: #line 2590 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStorage; n->name = (yyvsp[-2].str); n->def = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 32909 "gram.c" /* yacc.c:1646 */ break; case 323: #line 2600 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetCompression; n->name = (yyvsp[-2].str); n->def = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 32922 "gram.c" /* yacc.c:1646 */ break; case 324: #line 2610 "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 32942 "gram.c" /* yacc.c:1646 */ break; case 325: #line 2627 "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 32955 "gram.c" /* yacc.c:1646 */ break; case 326: #line 2637 "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 32968 "gram.c" /* yacc.c:1646 */ break; case 327: #line 2647 "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 32981 "gram.c" /* yacc.c:1646 */ break; case 328: #line 2657 "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 32995 "gram.c" /* yacc.c:1646 */ break; case 329: #line 2668 "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 33009 "gram.c" /* yacc.c:1646 */ break; case 330: #line 2682 "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 33028 "gram.c" /* yacc.c:1646 */ break; case 331: #line 2698 "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 33040 "gram.c" /* yacc.c:1646 */ break; case 332: #line 2707 "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 33052 "gram.c" /* yacc.c:1646 */ break; case 333: #line 2716 "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 33070 "gram.c" /* yacc.c:1646 */ break; case 334: #line 2731 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33082 "gram.c" /* yacc.c:1646 */ break; case 335: #line 2740 "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 33096 "gram.c" /* yacc.c:1646 */ break; case 336: #line 2751 "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 33110 "gram.c" /* yacc.c:1646 */ break; case 337: #line 2762 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *) n; } #line 33121 "gram.c" /* yacc.c:1646 */ break; case 338: #line 2770 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33133 "gram.c" /* yacc.c:1646 */ break; case 339: #line 2779 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *) n; } #line 33145 "gram.c" /* yacc.c:1646 */ break; case 340: #line 2788 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *) n; } #line 33156 "gram.c" /* yacc.c:1646 */ break; case 341: #line 2796 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *) n; } #line 33167 "gram.c" /* yacc.c:1646 */ break; case 342: #line 2804 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33179 "gram.c" /* yacc.c:1646 */ break; case 343: #line 2813 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33191 "gram.c" /* yacc.c:1646 */ break; case 344: #line 2822 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33203 "gram.c" /* yacc.c:1646 */ break; case 345: #line 2831 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *) n; } #line 33214 "gram.c" /* yacc.c:1646 */ break; case 346: #line 2839 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *) n; } #line 33225 "gram.c" /* yacc.c:1646 */ break; case 347: #line 2847 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33237 "gram.c" /* yacc.c:1646 */ break; case 348: #line 2856 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *) n; } #line 33248 "gram.c" /* yacc.c:1646 */ break; case 349: #line 2864 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *) n; } #line 33259 "gram.c" /* yacc.c:1646 */ break; case 350: #line 2872 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33271 "gram.c" /* yacc.c:1646 */ break; case 351: #line 2881 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33283 "gram.c" /* yacc.c:1646 */ break; case 352: #line 2890 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33295 "gram.c" /* yacc.c:1646 */ break; case 353: #line 2899 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33307 "gram.c" /* yacc.c:1646 */ break; case 354: #line 2908 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 33319 "gram.c" /* yacc.c:1646 */ break; case 355: #line 2917 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *) n; } #line 33331 "gram.c" /* yacc.c:1646 */ break; case 356: #line 2926 "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 33345 "gram.c" /* yacc.c:1646 */ break; case 357: #line 2937 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *) n; } #line 33356 "gram.c" /* yacc.c:1646 */ break; case 358: #line 2945 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 33368 "gram.c" /* yacc.c:1646 */ break; case 359: #line 2954 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetAccessMethod; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33380 "gram.c" /* yacc.c:1646 */ break; case 360: #line 2963 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33392 "gram.c" /* yacc.c:1646 */ break; case 361: #line 2972 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 33404 "gram.c" /* yacc.c:1646 */ break; case 362: #line 2981 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 33416 "gram.c" /* yacc.c:1646 */ break; case 363: #line 2990 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 33428 "gram.c" /* yacc.c:1646 */ break; case 364: #line 2999 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *) n; } #line 33439 "gram.c" /* yacc.c:1646 */ break; case 365: #line 3007 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *) n; } #line 33450 "gram.c" /* yacc.c:1646 */ break; case 366: #line 3015 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *) n; } #line 33461 "gram.c" /* yacc.c:1646 */ break; case 367: #line 3023 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *) n; } #line 33472 "gram.c" /* yacc.c:1646 */ break; case 368: #line 3030 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 33484 "gram.c" /* yacc.c:1646 */ break; case 369: #line 3040 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33490 "gram.c" /* yacc.c:1646 */ break; case 370: #line 3041 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33496 "gram.c" /* yacc.c:1646 */ break; case 371: #line 3046 "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 33509 "gram.c" /* yacc.c:1646 */ break; case 372: #line 3054 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33515 "gram.c" /* yacc.c:1646 */ break; case 373: #line 3058 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33521 "gram.c" /* yacc.c:1646 */ break; case 374: #line 3059 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33527 "gram.c" /* yacc.c:1646 */ break; case 375: #line 3064 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 33539 "gram.c" /* yacc.c:1646 */ break; case 376: #line 3072 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 33551 "gram.c" /* yacc.c:1646 */ break; case 377: #line 3080 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 33563 "gram.c" /* yacc.c:1646 */ break; case 378: #line 3088 "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 33575 "gram.c" /* yacc.c:1646 */ break; case 379: #line 3098 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33581 "gram.c" /* yacc.c:1646 */ break; case 380: #line 3101 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33587 "gram.c" /* yacc.c:1646 */ break; case 381: #line 3102 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33593 "gram.c" /* yacc.c:1646 */ break; case 382: #line 3106 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33599 "gram.c" /* yacc.c:1646 */ break; case 383: #line 3107 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33605 "gram.c" /* yacc.c:1646 */ break; case 384: #line 3113 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 33613 "gram.c" /* yacc.c:1646 */ break; case 385: #line 3117 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 33621 "gram.c" /* yacc.c:1646 */ break; case 386: #line 3121 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 33630 "gram.c" /* yacc.c:1646 */ break; case 387: #line 3126 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 33638 "gram.c" /* yacc.c:1646 */ break; case 388: #line 3133 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33644 "gram.c" /* yacc.c:1646 */ break; case 389: #line 3135 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 33650 "gram.c" /* yacc.c:1646 */ break; case 390: #line 3140 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 33658 "gram.c" /* yacc.c:1646 */ break; case 391: #line 3144 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 33666 "gram.c" /* yacc.c:1646 */ break; case 392: #line 3148 "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 33681 "gram.c" /* yacc.c:1646 */ break; case 393: #line 3159 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 33689 "gram.c" /* yacc.c:1646 */ break; case 394: #line 3165 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 33695 "gram.c" /* yacc.c:1646 */ break; case 395: #line 3166 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33701 "gram.c" /* yacc.c:1646 */ break; case 396: #line 3170 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 33707 "gram.c" /* yacc.c:1646 */ break; case 397: #line 3171 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 33713 "gram.c" /* yacc.c:1646 */ break; case 398: #line 3177 "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 33768 "gram.c" /* yacc.c:1646 */ break; case 399: #line 3230 "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 33783 "gram.c" /* yacc.c:1646 */ break; case 400: #line 3243 "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 33799 "gram.c" /* yacc.c:1646 */ break; case 401: #line 3257 "gram.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 33812 "gram.c" /* yacc.c:1646 */ break; case 402: #line 3269 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 33820 "gram.c" /* yacc.c:1646 */ break; case 403: #line 3276 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33828 "gram.c" /* yacc.c:1646 */ break; case 404: #line 3280 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33836 "gram.c" /* yacc.c:1646 */ break; case 405: #line 3294 "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->objtype = OBJECT_TYPE; (yyval.node) = (Node *) n; } #line 33850 "gram.c" /* yacc.c:1646 */ break; case 406: #line 3306 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33856 "gram.c" /* yacc.c:1646 */ break; case 407: #line 3307 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33862 "gram.c" /* yacc.c:1646 */ break; case 408: #line 3313 "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 33875 "gram.c" /* yacc.c:1646 */ break; case 409: #line 3323 "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 33889 "gram.c" /* yacc.c:1646 */ break; case 410: #line 3334 "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 33903 "gram.c" /* yacc.c:1646 */ break; case 411: #line 3345 "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 33923 "gram.c" /* yacc.c:1646 */ break; case 412: #line 3372 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33934 "gram.c" /* yacc.c:1646 */ break; case 413: #line 3379 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *) n; } #line 33945 "gram.c" /* yacc.c:1646 */ break; case 414: #line 3415 "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 33983 "gram.c" /* yacc.c:1646 */ break; case 415: #line 3449 "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 34007 "gram.c" /* yacc.c:1646 */ break; case 416: #line 3471 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34013 "gram.c" /* yacc.c:1646 */ break; case 417: #line 3472 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34019 "gram.c" /* yacc.c:1646 */ break; case 418: #line 3476 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34025 "gram.c" /* yacc.c:1646 */ break; case 419: #line 3477 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34031 "gram.c" /* yacc.c:1646 */ break; case 420: #line 3486 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34037 "gram.c" /* yacc.c:1646 */ break; case 421: #line 3487 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34043 "gram.c" /* yacc.c:1646 */ break; case 422: #line 3488 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34049 "gram.c" /* yacc.c:1646 */ break; case 423: #line 3491 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34055 "gram.c" /* yacc.c:1646 */ break; case 424: #line 3492 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 34061 "gram.c" /* yacc.c:1646 */ break; case 425: #line 3497 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 34067 "gram.c" /* yacc.c:1646 */ break; case 426: #line 3498 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34073 "gram.c" /* yacc.c:1646 */ break; case 427: #line 3503 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 34081 "gram.c" /* yacc.c:1646 */ break; case 428: #line 3507 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("freeze", (Node *) makeBoolean(true), (yylsp[0])); } #line 34089 "gram.c" /* yacc.c:1646 */ break; case 429: #line 3511 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 34097 "gram.c" /* yacc.c:1646 */ break; case 430: #line 3515 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("null", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 34105 "gram.c" /* yacc.c:1646 */ break; case 431: #line 3519 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("csv"), (yylsp[0])); } #line 34113 "gram.c" /* yacc.c:1646 */ break; case 432: #line 3523 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("header", (Node *) makeBoolean(true), (yylsp[0])); } #line 34121 "gram.c" /* yacc.c:1646 */ break; case 433: #line 3527 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("quote", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 34129 "gram.c" /* yacc.c:1646 */ break; case 434: #line 3531 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("escape", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 34137 "gram.c" /* yacc.c:1646 */ break; case 435: #line 3535 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 34145 "gram.c" /* yacc.c:1646 */ break; case 436: #line 3539 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 34153 "gram.c" /* yacc.c:1646 */ break; case 437: #line 3543 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *) (yyvsp[0].list), (yylsp[-3])); } #line 34161 "gram.c" /* yacc.c:1646 */ break; case 438: #line 3547 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *) makeNode(A_Star), (yylsp[-3])); } #line 34169 "gram.c" /* yacc.c:1646 */ break; case 439: #line 3551 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 34177 "gram.c" /* yacc.c:1646 */ break; case 440: #line 3555 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 34185 "gram.c" /* yacc.c:1646 */ break; case 441: #line 3559 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 34193 "gram.c" /* yacc.c:1646 */ break; case 442: #line 3568 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 34201 "gram.c" /* yacc.c:1646 */ break; case 443: #line 3571 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 34207 "gram.c" /* yacc.c:1646 */ break; case 444: #line 3576 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 34215 "gram.c" /* yacc.c:1646 */ break; case 445: #line 3579 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 34221 "gram.c" /* yacc.c:1646 */ break; case 448: #line 3590 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 34229 "gram.c" /* yacc.c:1646 */ break; case 449: #line 3594 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 34237 "gram.c" /* yacc.c:1646 */ break; case 450: #line 3601 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 34245 "gram.c" /* yacc.c:1646 */ break; case 451: #line 3607 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 34251 "gram.c" /* yacc.c:1646 */ break; case 452: #line 3608 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 34257 "gram.c" /* yacc.c:1646 */ break; case 453: #line 3609 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 34263 "gram.c" /* yacc.c:1646 */ break; case 454: #line 3610 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString("default"); } #line 34269 "gram.c" /* yacc.c:1646 */ break; case 455: #line 3611 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 34275 "gram.c" /* yacc.c:1646 */ break; case 456: #line 3612 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 34281 "gram.c" /* yacc.c:1646 */ break; case 457: #line 3617 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34289 "gram.c" /* yacc.c:1646 */ break; case 458: #line 3621 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34297 "gram.c" /* yacc.c:1646 */ break; case 459: #line 3628 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 34303 "gram.c" /* yacc.c:1646 */ break; case 460: #line 3642 "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 34325 "gram.c" /* yacc.c:1646 */ break; case 461: #line 3662 "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 34347 "gram.c" /* yacc.c:1646 */ break; case 462: #line 3682 "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 34370 "gram.c" /* yacc.c:1646 */ break; case 463: #line 3703 "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 34393 "gram.c" /* yacc.c:1646 */ break; case 464: #line 3724 "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 34416 "gram.c" /* yacc.c:1646 */ break; case 465: #line 3745 "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 34439 "gram.c" /* yacc.c:1646 */ break; case 466: #line 3776 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34445 "gram.c" /* yacc.c:1646 */ break; case 467: #line 3777 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34451 "gram.c" /* yacc.c:1646 */ break; case 468: #line 3778 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34457 "gram.c" /* yacc.c:1646 */ break; case 469: #line 3779 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34463 "gram.c" /* yacc.c:1646 */ break; case 470: #line 3781 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34474 "gram.c" /* yacc.c:1646 */ break; case 471: #line 3788 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34485 "gram.c" /* yacc.c:1646 */ break; case 472: #line 3794 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 34491 "gram.c" /* yacc.c:1646 */ break; case 473: #line 3795 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 34497 "gram.c" /* yacc.c:1646 */ break; case 474: #line 3799 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34503 "gram.c" /* yacc.c:1646 */ break; case 475: #line 3800 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34509 "gram.c" /* yacc.c:1646 */ break; case 476: #line 3804 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 34515 "gram.c" /* yacc.c:1646 */ break; case 477: #line 3805 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34521 "gram.c" /* yacc.c:1646 */ break; case 478: #line 3810 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34529 "gram.c" /* yacc.c:1646 */ break; case 479: #line 3814 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34537 "gram.c" /* yacc.c:1646 */ break; case 480: #line 3821 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34545 "gram.c" /* yacc.c:1646 */ break; case 481: #line 3825 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34553 "gram.c" /* yacc.c:1646 */ break; case 482: #line 3831 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34559 "gram.c" /* yacc.c:1646 */ break; case 483: #line 3832 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34565 "gram.c" /* yacc.c:1646 */ break; case 484: #line 3833 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34571 "gram.c" /* yacc.c:1646 */ break; case 485: #line 3837 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34577 "gram.c" /* yacc.c:1646 */ break; case 486: #line 3838 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34583 "gram.c" /* yacc.c:1646 */ break; case 487: #line 3842 "gram.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-5].str); n->typeName = (yyvsp[-4].typnam); n->storage_name = (yyvsp[-3].str); n->compression = (yyvsp[-2].str); 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[-5]); (yyval.node) = (Node *) n; } #line 34609 "gram.c" /* yacc.c:1646 */ break; case 488: #line 3866 "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 34632 "gram.c" /* yacc.c:1646 */ break; case 489: #line 3885 "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 34655 "gram.c" /* yacc.c:1646 */ break; case 490: #line 3906 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34661 "gram.c" /* yacc.c:1646 */ break; case 491: #line 3907 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("default"); } #line 34667 "gram.c" /* yacc.c:1646 */ break; case 492: #line 3911 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34673 "gram.c" /* yacc.c:1646 */ break; case 493: #line 3912 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34679 "gram.c" /* yacc.c:1646 */ break; case 494: #line 3916 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34685 "gram.c" /* yacc.c:1646 */ break; case 495: #line 3917 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("default"); } #line 34691 "gram.c" /* yacc.c:1646 */ break; case 496: #line 3921 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34697 "gram.c" /* yacc.c:1646 */ break; case 497: #line 3922 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34703 "gram.c" /* yacc.c:1646 */ break; case 498: #line 3926 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 34709 "gram.c" /* yacc.c:1646 */ break; case 499: #line 3927 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34715 "gram.c" /* yacc.c:1646 */ break; case 500: #line 3932 "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 34727 "gram.c" /* yacc.c:1646 */ break; case 501: #line 3939 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34733 "gram.c" /* yacc.c:1646 */ break; case 502: #line 3940 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34739 "gram.c" /* yacc.c:1646 */ break; case 503: #line 3942 "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 34757 "gram.c" /* yacc.c:1646 */ break; case 504: #line 3974 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34769 "gram.c" /* yacc.c:1646 */ break; case 505: #line 3982 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 34781 "gram.c" /* yacc.c:1646 */ break; case 506: #line 3990 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-3]); n->nulls_not_distinct = !(yyvsp[-2].boolean); n->keys = NULL; n->options = (yyvsp[-1].list); n->indexname = NULL; n->indexspace = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34798 "gram.c" /* yacc.c:1646 */ break; case 507: #line 4003 "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 34814 "gram.c" /* yacc.c:1646 */ break; case 508: #line 4015 "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 34831 "gram.c" /* yacc.c:1646 */ break; case 509: #line 4028 "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 34847 "gram.c" /* yacc.c:1646 */ break; case 510: #line 4040 "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 34861 "gram.c" /* yacc.c:1646 */ break; case 511: #line 4050 "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 34889 "gram.c" /* yacc.c:1646 */ break; case 512: #line 4074 "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 = ((yyvsp[0].keyactions))->updateAction->action; n->fk_del_action = ((yyvsp[0].keyactions))->deleteAction->action; n->fk_del_set_cols = ((yyvsp[0].keyactions))->deleteAction->cols; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 34910 "gram.c" /* yacc.c:1646 */ break; case 513: #line 4093 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34916 "gram.c" /* yacc.c:1646 */ break; case 514: #line 4094 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34922 "gram.c" /* yacc.c:1646 */ break; case 515: #line 4095 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34928 "gram.c" /* yacc.c:1646 */ break; case 516: #line 4099 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 34934 "gram.c" /* yacc.c:1646 */ break; case 517: #line 4100 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 34940 "gram.c" /* yacc.c:1646 */ break; case 518: #line 4120 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 34952 "gram.c" /* yacc.c:1646 */ break; case 519: #line 4128 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34964 "gram.c" /* yacc.c:1646 */ break; case 520: #line 4136 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34976 "gram.c" /* yacc.c:1646 */ break; case 521: #line 4144 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34988 "gram.c" /* yacc.c:1646 */ break; case 522: #line 4156 "gram.y" /* yacc.c:1646 */ { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); n->relationOid = InvalidOid; (yyval.node) = (Node *) n; } #line 35001 "gram.c" /* yacc.c:1646 */ break; case 523: #line 4167 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 35007 "gram.c" /* yacc.c:1646 */ break; case 524: #line 4168 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 35013 "gram.c" /* yacc.c:1646 */ break; case 525: #line 4169 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 35019 "gram.c" /* yacc.c:1646 */ break; case 526: #line 4173 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 35025 "gram.c" /* yacc.c:1646 */ break; case 527: #line 4174 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMPRESSION; } #line 35031 "gram.c" /* yacc.c:1646 */ break; case 528: #line 4175 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 35037 "gram.c" /* yacc.c:1646 */ break; case 529: #line 4176 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 35043 "gram.c" /* yacc.c:1646 */ break; case 530: #line 4177 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 35049 "gram.c" /* yacc.c:1646 */ break; case 531: #line 4178 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 35055 "gram.c" /* yacc.c:1646 */ break; case 532: #line 4179 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 35061 "gram.c" /* yacc.c:1646 */ break; case 533: #line 4180 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 35067 "gram.c" /* yacc.c:1646 */ break; case 534: #line 4181 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 35073 "gram.c" /* yacc.c:1646 */ break; case 535: #line 4182 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 35079 "gram.c" /* yacc.c:1646 */ break; case 536: #line 4192 "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 35091 "gram.c" /* yacc.c:1646 */ break; case 537: #line 4199 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35097 "gram.c" /* yacc.c:1646 */ break; case 538: #line 4204 "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 35115 "gram.c" /* yacc.c:1646 */ break; case 539: #line 4219 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-8]); n->nulls_not_distinct = !(yyvsp[-7].boolean); 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 35136 "gram.c" /* yacc.c:1646 */ break; case 540: #line 4236 "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 35156 "gram.c" /* yacc.c:1646 */ break; case 541: #line 4253 "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 35176 "gram.c" /* yacc.c:1646 */ break; case 542: #line 4269 "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 35196 "gram.c" /* yacc.c:1646 */ break; case 543: #line 4287 "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 35218 "gram.c" /* yacc.c:1646 */ break; case 544: #line 4306 "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 = ((yyvsp[-1].keyactions))->updateAction->action; n->fk_del_action = ((yyvsp[-1].keyactions))->deleteAction->action; n->fk_del_set_cols = ((yyvsp[-1].keyactions))->deleteAction->cols; 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 35242 "gram.c" /* yacc.c:1646 */ break; case 545: #line 4340 "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 35254 "gram.c" /* yacc.c:1646 */ break; case 546: #line 4347 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35260 "gram.c" /* yacc.c:1646 */ break; case 547: #line 4352 "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 35278 "gram.c" /* yacc.c:1646 */ break; case 548: #line 4366 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->keys = list_make1(makeString("value")); /* no NOT VALID support yet */ processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, &n->is_no_inherit, yyscanner); n->initially_valid = true; (yyval.node) = (Node *) n; } #line 35296 "gram.c" /* yacc.c:1646 */ break; case 549: #line 4381 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35302 "gram.c" /* yacc.c:1646 */ break; case 550: #line 4382 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35308 "gram.c" /* yacc.c:1646 */ break; case 551: #line 4386 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35314 "gram.c" /* yacc.c:1646 */ break; case 552: #line 4387 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35320 "gram.c" /* yacc.c:1646 */ break; case 553: #line 4391 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35326 "gram.c" /* yacc.c:1646 */ break; case 554: #line 4392 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35332 "gram.c" /* yacc.c:1646 */ break; case 555: #line 4396 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35340 "gram.c" /* yacc.c:1646 */ break; case 556: #line 4401 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35346 "gram.c" /* yacc.c:1646 */ break; case 557: #line 4402 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35352 "gram.c" /* yacc.c:1646 */ break; case 558: #line 4406 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 35360 "gram.c" /* yacc.c:1646 */ break; case 559: #line 4410 "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 35372 "gram.c" /* yacc.c:1646 */ break; case 560: #line 4418 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 35380 "gram.c" /* yacc.c:1646 */ break; case 561: #line 4422 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 35388 "gram.c" /* yacc.c:1646 */ break; case 562: #line 4428 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 35394 "gram.c" /* yacc.c:1646 */ break; case 563: #line 4430 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 35400 "gram.c" /* yacc.c:1646 */ break; case 564: #line 4434 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 35408 "gram.c" /* yacc.c:1646 */ break; case 565: #line 4439 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 35416 "gram.c" /* yacc.c:1646 */ break; case 566: #line 4445 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 35422 "gram.c" /* yacc.c:1646 */ break; case 567: #line 4446 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 35428 "gram.c" /* yacc.c:1646 */ break; case 568: #line 4451 "gram.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; (yyval.keyactions) = n; } #line 35442 "gram.c" /* yacc.c:1646 */ break; case 569: #line 4461 "gram.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 35456 "gram.c" /* yacc.c:1646 */ break; case 570: #line 4471 "gram.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[-1].keyaction); n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 35468 "gram.c" /* yacc.c:1646 */ break; case 571: #line 4479 "gram.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = (yyvsp[-1].keyaction); (yyval.keyactions) = n; } #line 35480 "gram.c" /* yacc.c:1646 */ break; case 572: #line 4487 "gram.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; (yyval.keyactions) = n; } #line 35496 "gram.c" /* yacc.c:1646 */ break; case 573: #line 4501 "gram.y" /* yacc.c:1646 */ { if (((yyvsp[0].keyaction))->cols) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("a column list with %s is only supported for ON DELETE actions", ((yyvsp[0].keyaction))->action == FKCONSTR_ACTION_SETNULL ? "SET NULL" : "SET DEFAULT"), parser_errposition((yylsp[-2])))); (yyval.keyaction) = (yyvsp[0].keyaction); } #line 35510 "gram.c" /* yacc.c:1646 */ break; case 574: #line 4513 "gram.y" /* yacc.c:1646 */ { (yyval.keyaction) = (yyvsp[0].keyaction); } #line 35518 "gram.c" /* yacc.c:1646 */ break; case 575: #line 4520 "gram.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_NOACTION; n->cols = NIL; (yyval.keyaction) = n; } #line 35530 "gram.c" /* yacc.c:1646 */ break; case 576: #line 4528 "gram.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_RESTRICT; n->cols = NIL; (yyval.keyaction) = n; } #line 35542 "gram.c" /* yacc.c:1646 */ break; case 577: #line 4536 "gram.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_CASCADE; n->cols = NIL; (yyval.keyaction) = n; } #line 35554 "gram.c" /* yacc.c:1646 */ break; case 578: #line 4544 "gram.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETNULL; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 35566 "gram.c" /* yacc.c:1646 */ break; case 579: #line 4552 "gram.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETDEFAULT; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 35578 "gram.c" /* yacc.c:1646 */ break; case 580: #line 4561 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35584 "gram.c" /* yacc.c:1646 */ break; case 581: #line 4562 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35590 "gram.c" /* yacc.c:1646 */ break; case 582: #line 4566 "gram.y" /* yacc.c:1646 */ { (yyval.partspec) = (yyvsp[0].partspec); } #line 35596 "gram.c" /* yacc.c:1646 */ break; case 583: #line 4567 "gram.y" /* yacc.c:1646 */ { (yyval.partspec) = NULL; } #line 35602 "gram.c" /* yacc.c:1646 */ break; case 584: #line 4571 "gram.y" /* yacc.c:1646 */ { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = parsePartitionStrategy((yyvsp[-3].str)); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 35616 "gram.c" /* yacc.c:1646 */ break; case 585: #line 4582 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 35622 "gram.c" /* yacc.c:1646 */ break; case 586: #line 4583 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 35628 "gram.c" /* yacc.c:1646 */ break; case 587: #line 4587 "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 35643 "gram.c" /* yacc.c:1646 */ break; case 588: #line 4598 "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 35658 "gram.c" /* yacc.c:1646 */ break; case 589: #line 4609 "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 35673 "gram.c" /* yacc.c:1646 */ break; case 590: #line 4622 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35679 "gram.c" /* yacc.c:1646 */ break; case 591: #line 4623 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35685 "gram.c" /* yacc.c:1646 */ break; case 592: #line 4628 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35691 "gram.c" /* yacc.c:1646 */ break; case 593: #line 4629 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35697 "gram.c" /* yacc.c:1646 */ break; case 594: #line 4630 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35703 "gram.c" /* yacc.c:1646 */ break; case 595: #line 4633 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DROP; } #line 35709 "gram.c" /* yacc.c:1646 */ break; case 596: #line 4634 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 35715 "gram.c" /* yacc.c:1646 */ break; case 597: #line 4635 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 35721 "gram.c" /* yacc.c:1646 */ break; case 598: #line 4636 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 35727 "gram.c" /* yacc.c:1646 */ break; case 599: #line 4639 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35733 "gram.c" /* yacc.c:1646 */ break; case 600: #line 4640 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35739 "gram.c" /* yacc.c:1646 */ break; case 601: #line 4643 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35745 "gram.c" /* yacc.c:1646 */ break; case 602: #line 4644 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35751 "gram.c" /* yacc.c:1646 */ break; case 603: #line 4647 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35757 "gram.c" /* yacc.c:1646 */ break; case 604: #line 4669 "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 35773 "gram.c" /* yacc.c:1646 */ break; case 605: #line 4682 "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 35789 "gram.c" /* yacc.c:1646 */ break; case 606: #line 4702 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].selem)); } #line 35795 "gram.c" /* yacc.c:1646 */ break; case 607: #line 4703 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].selem)); } #line 35801 "gram.c" /* yacc.c:1646 */ break; case 608: #line 4707 "gram.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = (yyvsp[0].str); (yyval.selem)->expr = NULL; } #line 35811 "gram.c" /* yacc.c:1646 */ break; case 609: #line 4713 "gram.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[0].node); } #line 35821 "gram.c" /* yacc.c:1646 */ break; case 610: #line 4719 "gram.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[-1].node); } #line 35831 "gram.c" /* yacc.c:1646 */ break; case 611: #line 4736 "gram.y" /* yacc.c:1646 */ { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = false; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 35844 "gram.c" /* yacc.c:1646 */ break; case 612: #line 4745 "gram.y" /* yacc.c:1646 */ { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = true; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 35857 "gram.c" /* yacc.c:1646 */ break; case 613: #line 4767 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35875 "gram.c" /* yacc.c:1646 */ break; case 614: #line 4781 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35893 "gram.c" /* yacc.c:1646 */ break; case 615: #line 4799 "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 35909 "gram.c" /* yacc.c:1646 */ break; case 616: #line 4813 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35915 "gram.c" /* yacc.c:1646 */ break; case 617: #line 4814 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35921 "gram.c" /* yacc.c:1646 */ break; case 618: #line 4815 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35927 "gram.c" /* yacc.c:1646 */ break; case 619: #line 4828 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35945 "gram.c" /* yacc.c:1646 */ break; case 620: #line 4842 "gram.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35963 "gram.c" /* yacc.c:1646 */ break; case 621: #line 4859 "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 35979 "gram.c" /* yacc.c:1646 */ break; case 622: #line 4872 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 35985 "gram.c" /* yacc.c:1646 */ break; case 623: #line 4873 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 35991 "gram.c" /* yacc.c:1646 */ break; case 624: #line 4886 "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 36004 "gram.c" /* yacc.c:1646 */ break; case 625: #line 4907 "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 36019 "gram.c" /* yacc.c:1646 */ break; case 626: #line 4918 "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 36034 "gram.c" /* yacc.c:1646 */ break; case 627: #line 4932 "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 36047 "gram.c" /* yacc.c:1646 */ break; case 628: #line 4941 "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 36060 "gram.c" /* yacc.c:1646 */ break; case 629: #line 4952 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36066 "gram.c" /* yacc.c:1646 */ break; case 630: #line 4953 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36072 "gram.c" /* yacc.c:1646 */ break; case 631: #line 4956 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36078 "gram.c" /* yacc.c:1646 */ break; case 632: #line 4957 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36084 "gram.c" /* yacc.c:1646 */ break; case 633: #line 4960 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36090 "gram.c" /* yacc.c:1646 */ break; case 634: #line 4961 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36096 "gram.c" /* yacc.c:1646 */ break; case 635: #line 4965 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].typnam), (yylsp[-1])); } #line 36104 "gram.c" /* yacc.c:1646 */ break; case 636: #line 4969 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cache", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 36112 "gram.c" /* yacc.c:1646 */ break; case 637: #line 4973 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(true), (yylsp[0])); } #line 36120 "gram.c" /* yacc.c:1646 */ break; case 638: #line 4977 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(false), (yylsp[-1])); } #line 36128 "gram.c" /* yacc.c:1646 */ break; case 639: #line 4981 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("increment", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 36136 "gram.c" /* yacc.c:1646 */ break; case 640: #line 4985 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 36144 "gram.c" /* yacc.c:1646 */ break; case 641: #line 4989 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 36152 "gram.c" /* yacc.c:1646 */ break; case 642: #line 4993 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 36160 "gram.c" /* yacc.c:1646 */ break; case 643: #line 4997 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 36168 "gram.c" /* yacc.c:1646 */ break; case 644: #line 5001 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owned_by", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 36176 "gram.c" /* yacc.c:1646 */ break; case 645: #line 5005 "gram.y" /* yacc.c:1646 */ { /* not documented, only used by pg_dump */ (yyval.defelt) = makeDefElem("sequence_name", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 36185 "gram.c" /* yacc.c:1646 */ break; case 646: #line 5010 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("start", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 36193 "gram.c" /* yacc.c:1646 */ break; case 647: #line 5014 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 36201 "gram.c" /* yacc.c:1646 */ break; case 648: #line 5018 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 36209 "gram.c" /* yacc.c:1646 */ break; case 651: #line 5028 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 36215 "gram.c" /* yacc.c:1646 */ break; case 652: #line 5029 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 36221 "gram.c" /* yacc.c:1646 */ break; case 653: #line 5031 "gram.y" /* yacc.c:1646 */ { Float *f = makeFloat((yyvsp[0].str)); doNegateFloat(f); (yyval.node) = (Node *) f; } #line 36232 "gram.c" /* yacc.c:1646 */ break; case 654: #line 5037 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 36238 "gram.c" /* yacc.c:1646 */ break; case 655: #line 5040 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36244 "gram.c" /* yacc.c:1646 */ break; case 656: #line 5041 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36250 "gram.c" /* yacc.c:1646 */ break; case 657: #line 5054 "gram.y" /* yacc.c:1646 */ { /* * We now interpret parameterless CREATE LANGUAGE as * CREATE EXTENSION. "OR REPLACE" is silently translated * to "IF NOT EXISTS", which isn't quite the same, but * seems more useful than throwing an error. We just * ignore TRUSTED, as the previous code would have too. */ CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->if_not_exists = (yyvsp[-4].boolean); n->extname = (yyvsp[0].str); n->options = NIL; (yyval.node) = (Node *) n; } #line 36270 "gram.c" /* yacc.c:1646 */ break; case 658: #line 5071 "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 36286 "gram.c" /* yacc.c:1646 */ break; case 659: #line 5085 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 36292 "gram.c" /* yacc.c:1646 */ break; case 660: #line 5086 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 36298 "gram.c" /* yacc.c:1646 */ break; case 661: #line 5094 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36304 "gram.c" /* yacc.c:1646 */ break; case 662: #line 5095 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 36310 "gram.c" /* yacc.c:1646 */ break; case 663: #line 5099 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36316 "gram.c" /* yacc.c:1646 */ break; case 664: #line 5100 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36322 "gram.c" /* yacc.c:1646 */ break; case 665: #line 5104 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36328 "gram.c" /* yacc.c:1646 */ break; case 666: #line 5105 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36334 "gram.c" /* yacc.c:1646 */ break; case 667: #line 5109 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36340 "gram.c" /* yacc.c:1646 */ break; case 668: #line 5110 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36346 "gram.c" /* yacc.c:1646 */ break; case 671: #line 5126 "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 36360 "gram.c" /* yacc.c:1646 */ break; case 672: #line 5137 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 36366 "gram.c" /* yacc.c:1646 */ break; case 673: #line 5138 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 36372 "gram.c" /* yacc.c:1646 */ break; case 674: #line 5152 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 36384 "gram.c" /* yacc.c:1646 */ break; case 675: #line 5160 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 36396 "gram.c" /* yacc.c:1646 */ break; case 676: #line 5178 "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 36409 "gram.c" /* yacc.c:1646 */ break; case 677: #line 5187 "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 36422 "gram.c" /* yacc.c:1646 */ break; case 678: #line 5199 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36428 "gram.c" /* yacc.c:1646 */ break; case 679: #line 5201 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36434 "gram.c" /* yacc.c:1646 */ break; case 680: #line 5206 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schema", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36442 "gram.c" /* yacc.c:1646 */ break; case 681: #line 5210 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36450 "gram.c" /* yacc.c:1646 */ break; case 682: #line 5214 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE EXTENSION ... FROM is no longer supported"), parser_errposition((yylsp[-1])))); } #line 36461 "gram.c" /* yacc.c:1646 */ break; case 683: #line 5221 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cascade", (Node *) makeBoolean(true), (yylsp[0])); } #line 36469 "gram.c" /* yacc.c:1646 */ break; case 684: #line 5233 "gram.y" /* yacc.c:1646 */ { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 36481 "gram.c" /* yacc.c:1646 */ break; case 685: #line 5244 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36487 "gram.c" /* yacc.c:1646 */ break; case 686: #line 5246 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36493 "gram.c" /* yacc.c:1646 */ break; case 687: #line 5251 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36501 "gram.c" /* yacc.c:1646 */ break; case 688: #line 5264 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = (yyvsp[-1].objtype); n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 36515 "gram.c" /* yacc.c:1646 */ break; case 689: #line 5274 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = (yyvsp[-1].objtype); n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 36529 "gram.c" /* yacc.c:1646 */ break; case 690: #line 5284 "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 36543 "gram.c" /* yacc.c:1646 */ break; case 691: #line 5294 "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 36557 "gram.c" /* yacc.c:1646 */ break; case 692: #line 5304 "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 36571 "gram.c" /* yacc.c:1646 */ break; case 693: #line 5314 "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 36585 "gram.c" /* yacc.c:1646 */ break; case 694: #line 5324 "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 36599 "gram.c" /* yacc.c:1646 */ break; case 695: #line 5334 "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 36613 "gram.c" /* yacc.c:1646 */ break; case 696: #line 5344 "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 36627 "gram.c" /* yacc.c:1646 */ break; case 697: #line 5354 "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 36641 "gram.c" /* yacc.c:1646 */ break; case 698: #line 5364 "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 36655 "gram.c" /* yacc.c:1646 */ break; case 699: #line 5374 "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 36669 "gram.c" /* yacc.c:1646 */ break; case 700: #line 5384 "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 36683 "gram.c" /* yacc.c:1646 */ break; case 701: #line 5403 "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 36696 "gram.c" /* yacc.c:1646 */ break; case 702: #line 5414 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 36702 "gram.c" /* yacc.c:1646 */ break; case 703: #line 5415 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 36708 "gram.c" /* yacc.c:1646 */ break; case 704: #line 5416 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 36714 "gram.c" /* yacc.c:1646 */ break; case 705: #line 5417 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 36720 "gram.c" /* yacc.c:1646 */ break; case 706: #line 5421 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36726 "gram.c" /* yacc.c:1646 */ break; case 707: #line 5422 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36732 "gram.c" /* yacc.c:1646 */ break; case 708: #line 5426 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36738 "gram.c" /* yacc.c:1646 */ break; case 709: #line 5427 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36744 "gram.c" /* yacc.c:1646 */ break; case 710: #line 5438 "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 36757 "gram.c" /* yacc.c:1646 */ break; case 711: #line 5447 "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 36770 "gram.c" /* yacc.c:1646 */ break; case 712: #line 5459 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36776 "gram.c" /* yacc.c:1646 */ break; case 713: #line 5460 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36782 "gram.c" /* yacc.c:1646 */ break; case 714: #line 5465 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36790 "gram.c" /* yacc.c:1646 */ break; case 715: #line 5469 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 36798 "gram.c" /* yacc.c:1646 */ break; case 716: #line 5476 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36804 "gram.c" /* yacc.c:1646 */ break; case 717: #line 5481 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36812 "gram.c" /* yacc.c:1646 */ break; case 718: #line 5485 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 36820 "gram.c" /* yacc.c:1646 */ break; case 719: #line 5492 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 36828 "gram.c" /* yacc.c:1646 */ break; case 720: #line 5496 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 36837 "gram.c" /* yacc.c:1646 */ break; case 721: #line 5501 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 36846 "gram.c" /* yacc.c:1646 */ break; case 722: #line 5506 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 36854 "gram.c" /* yacc.c:1646 */ break; case 723: #line 5513 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 36862 "gram.c" /* yacc.c:1646 */ break; case 724: #line 5519 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36868 "gram.c" /* yacc.c:1646 */ break; case 725: #line 5524 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 36874 "gram.c" /* yacc.c:1646 */ break; case 726: #line 5536 "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 36890 "gram.c" /* yacc.c:1646 */ break; case 727: #line 5549 "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 36906 "gram.c" /* yacc.c:1646 */ break; case 728: #line 5563 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36912 "gram.c" /* yacc.c:1646 */ break; case 729: #line 5564 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36918 "gram.c" /* yacc.c:1646 */ break; case 730: #line 5569 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36924 "gram.c" /* yacc.c:1646 */ break; case 731: #line 5570 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36930 "gram.c" /* yacc.c:1646 */ break; case 732: #line 5574 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36936 "gram.c" /* yacc.c:1646 */ break; case 733: #line 5575 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36942 "gram.c" /* yacc.c:1646 */ break; case 734: #line 5586 "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 36956 "gram.c" /* yacc.c:1646 */ break; case 735: #line 5596 "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 36969 "gram.c" /* yacc.c:1646 */ break; case 736: #line 5605 "gram.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 36981 "gram.c" /* yacc.c:1646 */ break; case 737: #line 5625 "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 37004 "gram.c" /* yacc.c:1646 */ break; case 738: #line 5646 "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 37027 "gram.c" /* yacc.c:1646 */ break; case 739: #line 5667 "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 37051 "gram.c" /* yacc.c:1646 */ break; case 740: #line 5689 "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 37075 "gram.c" /* yacc.c:1646 */ break; case 741: #line 5722 "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 37091 "gram.c" /* yacc.c:1646 */ break; case 742: #line 5736 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 37097 "gram.c" /* yacc.c:1646 */ break; case 743: #line 5737 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 37103 "gram.c" /* yacc.c:1646 */ break; case 744: #line 5742 "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 37115 "gram.c" /* yacc.c:1646 */ break; case 745: #line 5750 "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 37126 "gram.c" /* yacc.c:1646 */ break; case 746: #line 5766 "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 37140 "gram.c" /* yacc.c:1646 */ break; case 747: #line 5776 "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 37154 "gram.c" /* yacc.c:1646 */ break; case 748: #line 5788 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 37160 "gram.c" /* yacc.c:1646 */ break; case 749: #line 5789 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 37166 "gram.c" /* yacc.c:1646 */ break; case 750: #line 5802 "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 37179 "gram.c" /* yacc.c:1646 */ break; case 751: #line 5811 "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 37192 "gram.c" /* yacc.c:1646 */ break; case 752: #line 5829 "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 37205 "gram.c" /* yacc.c:1646 */ break; case 753: #line 5856 "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 37222 "gram.c" /* yacc.c:1646 */ break; case 754: #line 5873 "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 37237 "gram.c" /* yacc.c:1646 */ break; case 755: #line 5886 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37243 "gram.c" /* yacc.c:1646 */ break; case 756: #line 5887 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37249 "gram.c" /* yacc.c:1646 */ break; case 757: #line 5891 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37255 "gram.c" /* yacc.c:1646 */ break; case 758: #line 5892 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37261 "gram.c" /* yacc.c:1646 */ break; case 759: #line 5896 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37267 "gram.c" /* yacc.c:1646 */ break; case 760: #line 5897 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 37273 "gram.c" /* yacc.c:1646 */ break; case 761: #line 5901 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37279 "gram.c" /* yacc.c:1646 */ break; case 762: #line 5902 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 37285 "gram.c" /* yacc.c:1646 */ break; case 763: #line 5907 "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 37303 "gram.c" /* yacc.c:1646 */ break; case 764: #line 5920 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37309 "gram.c" /* yacc.c:1646 */ break; case 765: #line 5924 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37315 "gram.c" /* yacc.c:1646 */ break; case 766: #line 5925 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 37321 "gram.c" /* yacc.c:1646 */ break; case 767: #line 5929 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 37327 "gram.c" /* yacc.c:1646 */ break; case 768: #line 5930 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "select"; } #line 37333 "gram.c" /* yacc.c:1646 */ break; case 769: #line 5931 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "insert"; } #line 37339 "gram.c" /* yacc.c:1646 */ break; case 770: #line 5932 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "update"; } #line 37345 "gram.c" /* yacc.c:1646 */ break; case 771: #line 5933 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "delete"; } #line 37351 "gram.c" /* yacc.c:1646 */ break; case 772: #line 5944 "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 37364 "gram.c" /* yacc.c:1646 */ break; case 773: #line 5955 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_INDEX; } #line 37370 "gram.c" /* yacc.c:1646 */ break; case 774: #line 5956 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_TABLE; } #line 37376 "gram.c" /* yacc.c:1646 */ break; case 775: #line 5970 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->replace = (yyvsp[-15].boolean); n->isconstraint = false; 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->deferrable = false; n->initdeferred = false; n->constrrel = NULL; (yyval.node) = (Node *) n; } #line 37401 "gram.c" /* yacc.c:1646 */ break; case 776: #line 5994 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->replace = (yyvsp[-19].boolean); if (n->replace) /* not supported, see CreateTrigger */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE OR REPLACE CONSTRAINT TRIGGER is not supported"))); n->isconstraint = true; 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; processCASbits((yyvsp[-10].ival), (yylsp[-10]), "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); n->constrrel = (yyvsp[-11].range); (yyval.node) = (Node *) n; } #line 37431 "gram.c" /* yacc.c:1646 */ break; case 777: #line 6022 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 37437 "gram.c" /* yacc.c:1646 */ break; case 778: #line 6023 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 37443 "gram.c" /* yacc.c:1646 */ break; case 779: #line 6024 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 37449 "gram.c" /* yacc.c:1646 */ break; case 780: #line 6029 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37455 "gram.c" /* yacc.c:1646 */ break; case 781: #line 6031 "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 37478 "gram.c" /* yacc.c:1646 */ break; case 782: #line 6053 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 37484 "gram.c" /* yacc.c:1646 */ break; case 783: #line 6055 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 37490 "gram.c" /* yacc.c:1646 */ break; case 784: #line 6057 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 37496 "gram.c" /* yacc.c:1646 */ break; case 785: #line 6059 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 37502 "gram.c" /* yacc.c:1646 */ break; case 786: #line 6061 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 37508 "gram.c" /* yacc.c:1646 */ break; case 787: #line 6065 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37514 "gram.c" /* yacc.c:1646 */ break; case 788: #line 6066 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37520 "gram.c" /* yacc.c:1646 */ break; case 789: #line 6070 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37526 "gram.c" /* yacc.c:1646 */ break; case 790: #line 6071 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 37532 "gram.c" /* yacc.c:1646 */ break; case 791: #line 6076 "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 37545 "gram.c" /* yacc.c:1646 */ break; case 792: #line 6087 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37551 "gram.c" /* yacc.c:1646 */ break; case 793: #line 6088 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37557 "gram.c" /* yacc.c:1646 */ break; case 794: #line 6092 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37563 "gram.c" /* yacc.c:1646 */ break; case 795: #line 6101 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37569 "gram.c" /* yacc.c:1646 */ break; case 796: #line 6105 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37575 "gram.c" /* yacc.c:1646 */ break; case 797: #line 6110 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = (yyvsp[0].boolean); } #line 37583 "gram.c" /* yacc.c:1646 */ break; case 798: #line 6114 "gram.y" /* yacc.c:1646 */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 37595 "gram.c" /* yacc.c:1646 */ break; case 801: #line 6129 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37601 "gram.c" /* yacc.c:1646 */ break; case 802: #line 6130 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37607 "gram.c" /* yacc.c:1646 */ break; case 803: #line 6134 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37613 "gram.c" /* yacc.c:1646 */ break; case 804: #line 6135 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37619 "gram.c" /* yacc.c:1646 */ break; case 807: #line 6144 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37625 "gram.c" /* yacc.c:1646 */ break; case 808: #line 6145 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37631 "gram.c" /* yacc.c:1646 */ break; case 809: #line 6146 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37637 "gram.c" /* yacc.c:1646 */ break; case 810: #line 6151 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(psprintf("%d", (yyvsp[0].ival))); } #line 37645 "gram.c" /* yacc.c:1646 */ break; case 811: #line 6154 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37651 "gram.c" /* yacc.c:1646 */ break; case 812: #line 6155 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37657 "gram.c" /* yacc.c:1646 */ break; case 813: #line 6156 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37663 "gram.c" /* yacc.c:1646 */ break; case 814: #line 6160 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 37669 "gram.c" /* yacc.c:1646 */ break; case 815: #line 6161 "gram.y" /* yacc.c:1646 */ { (yyval.range) = NULL; } #line 37675 "gram.c" /* yacc.c:1646 */ break; case 816: #line 6166 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37681 "gram.c" /* yacc.c:1646 */ break; case 817: #line 6168 "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 37709 "gram.c" /* yacc.c:1646 */ break; case 818: #line 6194 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 37715 "gram.c" /* yacc.c:1646 */ break; case 819: #line 6195 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_DEFERRABLE; } #line 37721 "gram.c" /* yacc.c:1646 */ break; case 820: #line 6196 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 37727 "gram.c" /* yacc.c:1646 */ break; case 821: #line 6197 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 37733 "gram.c" /* yacc.c:1646 */ break; case 822: #line 6198 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_VALID; } #line 37739 "gram.c" /* yacc.c:1646 */ break; case 823: #line 6199 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NO_INHERIT; } #line 37745 "gram.c" /* yacc.c:1646 */ break; case 824: #line 6214 "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 37759 "gram.c" /* yacc.c:1646 */ break; case 825: #line 6226 "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 37773 "gram.c" /* yacc.c:1646 */ break; case 826: #line 6239 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37779 "gram.c" /* yacc.c:1646 */ break; case 827: #line 6241 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 37785 "gram.c" /* yacc.c:1646 */ break; case 828: #line 6246 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 37791 "gram.c" /* yacc.c:1646 */ break; case 829: #line 6251 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37797 "gram.c" /* yacc.c:1646 */ break; case 830: #line 6253 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 37803 "gram.c" /* yacc.c:1646 */ break; case 831: #line 6258 "gram.y" /* yacc.c:1646 */ { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 37815 "gram.c" /* yacc.c:1646 */ break; case 832: #line 6268 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 37821 "gram.c" /* yacc.c:1646 */ break; case 833: #line 6269 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 37827 "gram.c" /* yacc.c:1646 */ break; case 834: #line 6270 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 37833 "gram.c" /* yacc.c:1646 */ break; case 835: #line 6271 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_DISABLED; } #line 37839 "gram.c" /* yacc.c:1646 */ break; case 836: #line 6283 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); (yyval.node) = NULL; } #line 37851 "gram.c" /* yacc.c:1646 */ break; case 837: #line 6302 "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 37867 "gram.c" /* yacc.c:1646 */ break; case 838: #line 6314 "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 37884 "gram.c" /* yacc.c:1646 */ break; case 839: #line 6327 "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 37899 "gram.c" /* yacc.c:1646 */ break; case 840: #line 6338 "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 37914 "gram.c" /* yacc.c:1646 */ break; case 841: #line 6349 "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 37930 "gram.c" /* yacc.c:1646 */ break; case 842: #line 6361 "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 37943 "gram.c" /* yacc.c:1646 */ break; case 843: #line 6370 "gram.y" /* yacc.c:1646 */ { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 37955 "gram.c" /* yacc.c:1646 */ break; case 844: #line 6378 "gram.y" /* yacc.c:1646 */ { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 37967 "gram.c" /* yacc.c:1646 */ break; case 845: #line 6386 "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 37981 "gram.c" /* yacc.c:1646 */ break; case 846: #line 6396 "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 37995 "gram.c" /* yacc.c:1646 */ break; case 847: #line 6406 "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 38009 "gram.c" /* yacc.c:1646 */ break; case 848: #line 6416 "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 38023 "gram.c" /* yacc.c:1646 */ break; case 849: #line 6426 "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 38037 "gram.c" /* yacc.c:1646 */ break; case 850: #line 6436 "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 38052 "gram.c" /* yacc.c:1646 */ break; case 851: #line 6447 "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 38066 "gram.c" /* yacc.c:1646 */ break; case 852: #line 6457 "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 38081 "gram.c" /* yacc.c:1646 */ break; case 853: #line 6469 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 38087 "gram.c" /* yacc.c:1646 */ break; case 854: #line 6472 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38093 "gram.c" /* yacc.c:1646 */ break; case 855: #line 6473 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38099 "gram.c" /* yacc.c:1646 */ break; case 856: #line 6477 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 38107 "gram.c" /* yacc.c:1646 */ break; case 857: #line 6481 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 38115 "gram.c" /* yacc.c:1646 */ break; case 858: #line 6487 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 38121 "gram.c" /* yacc.c:1646 */ break; case 859: #line 6488 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 38127 "gram.c" /* yacc.c:1646 */ break; case 860: #line 6489 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 38133 "gram.c" /* yacc.c:1646 */ break; case 861: #line 6490 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 38139 "gram.c" /* yacc.c:1646 */ break; case 862: #line 6491 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 38145 "gram.c" /* yacc.c:1646 */ break; case 863: #line 6492 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 38151 "gram.c" /* yacc.c:1646 */ break; case 864: #line 6495 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 38157 "gram.c" /* yacc.c:1646 */ break; case 865: #line 6498 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38163 "gram.c" /* yacc.c:1646 */ break; case 866: #line 6499 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38169 "gram.c" /* yacc.c:1646 */ break; case 867: #line 6508 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 38177 "gram.c" /* yacc.c:1646 */ break; case 868: #line 6514 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38183 "gram.c" /* yacc.c:1646 */ break; case 869: #line 6515 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38189 "gram.c" /* yacc.c:1646 */ break; case 870: #line 6519 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 38195 "gram.c" /* yacc.c:1646 */ break; case 871: #line 6521 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 38201 "gram.c" /* yacc.c:1646 */ break; case 872: #line 6532 "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 38217 "gram.c" /* yacc.c:1646 */ break; case 873: #line 6544 "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 38233 "gram.c" /* yacc.c:1646 */ break; case 874: #line 6556 "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 38249 "gram.c" /* yacc.c:1646 */ break; case 875: #line 6568 "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 38265 "gram.c" /* yacc.c:1646 */ break; case 876: #line 6580 "gram.y" /* yacc.c:1646 */ { /* * The following problems must be solved before this can be * implemented: * * - There must be no instance of the target value in * any table. * * - The value must not appear in any catalog metadata, * such as stored view expressions or column defaults. * * - The value must not appear in any non-leaf page of a * btree (and similar issues with other index types). * This is problematic because a value could persist * there long after it's gone from user-visible data. * * - Concurrent sessions must not be able to insert the * value while the preceding conditions are being checked. * * - Possibly more... */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("dropping an enum value is not implemented"), parser_errposition((yylsp[-2])))); } #line 38296 "gram.c" /* yacc.c:1646 */ break; case 877: #line 6608 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38302 "gram.c" /* yacc.c:1646 */ break; case 878: #line 6609 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38308 "gram.c" /* yacc.c:1646 */ break; case 879: #line 6627 "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 38324 "gram.c" /* yacc.c:1646 */ break; case 880: #line 6641 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38330 "gram.c" /* yacc.c:1646 */ break; case 881: #line 6642 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 38336 "gram.c" /* yacc.c:1646 */ break; case 882: #line 6647 "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 38353 "gram.c" /* yacc.c:1646 */ break; case 883: #line 6661 "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 38367 "gram.c" /* yacc.c:1646 */ break; case 884: #line 6671 "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 38380 "gram.c" /* yacc.c:1646 */ break; case 885: #line 6680 "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 38394 "gram.c" /* yacc.c:1646 */ break; case 886: #line 6690 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 38406 "gram.c" /* yacc.c:1646 */ break; case 887: #line 6699 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38412 "gram.c" /* yacc.c:1646 */ break; case 888: #line 6700 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38418 "gram.c" /* yacc.c:1646 */ break; case 889: #line 6703 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38424 "gram.c" /* yacc.c:1646 */ break; case 890: #line 6704 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38430 "gram.c" /* yacc.c:1646 */ break; case 891: #line 6707 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38436 "gram.c" /* yacc.c:1646 */ break; case 892: #line 6708 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38442 "gram.c" /* yacc.c:1646 */ break; case 893: #line 6709 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38448 "gram.c" /* yacc.c:1646 */ break; case 894: #line 6713 "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 38466 "gram.c" /* yacc.c:1646 */ break; case 895: #line 6726 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38472 "gram.c" /* yacc.c:1646 */ break; case 896: #line 6732 "gram.y" /* yacc.c:1646 */ { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 38484 "gram.c" /* yacc.c:1646 */ break; case 897: #line 6743 "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 38498 "gram.c" /* yacc.c:1646 */ break; case 898: #line 6753 "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 38512 "gram.c" /* yacc.c:1646 */ break; case 899: #line 6765 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38518 "gram.c" /* yacc.c:1646 */ break; case 900: #line 6766 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 38524 "gram.c" /* yacc.c:1646 */ break; case 901: #line 6771 "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 38537 "gram.c" /* yacc.c:1646 */ break; case 902: #line 6780 "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 38550 "gram.c" /* yacc.c:1646 */ break; case 903: #line 6793 "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 38565 "gram.c" /* yacc.c:1646 */ break; case 904: #line 6804 "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 38580 "gram.c" /* yacc.c:1646 */ break; case 905: #line 6818 "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 38595 "gram.c" /* yacc.c:1646 */ break; case 906: #line 6829 "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 38610 "gram.c" /* yacc.c:1646 */ break; case 907: #line 6852 "gram.y" /* yacc.c:1646 */ { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 38622 "gram.c" /* yacc.c:1646 */ break; case 908: #line 6863 "gram.y" /* yacc.c:1646 */ { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 38634 "gram.c" /* yacc.c:1646 */ break; case 909: #line 6882 "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 38649 "gram.c" /* yacc.c:1646 */ break; case 910: #line 6893 "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 38664 "gram.c" /* yacc.c:1646 */ break; case 911: #line 6904 "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 38679 "gram.c" /* yacc.c:1646 */ break; case 912: #line 6915 "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 38694 "gram.c" /* yacc.c:1646 */ break; case 913: #line 6926 "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 38709 "gram.c" /* yacc.c:1646 */ break; case 914: #line 6937 "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 38724 "gram.c" /* yacc.c:1646 */ break; case 915: #line 6948 "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 38739 "gram.c" /* yacc.c:1646 */ break; case 916: #line 6959 "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 38754 "gram.c" /* yacc.c:1646 */ break; case 917: #line 6970 "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 38769 "gram.c" /* yacc.c:1646 */ break; case 918: #line 6981 "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 38784 "gram.c" /* yacc.c:1646 */ break; case 919: #line 6992 "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 38799 "gram.c" /* yacc.c:1646 */ break; case 920: #line 7003 "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 38814 "gram.c" /* yacc.c:1646 */ break; case 921: #line 7017 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 38820 "gram.c" /* yacc.c:1646 */ break; case 922: #line 7018 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 38826 "gram.c" /* yacc.c:1646 */ break; case 923: #line 7019 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 38832 "gram.c" /* yacc.c:1646 */ break; case 924: #line 7020 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 38838 "gram.c" /* yacc.c:1646 */ break; case 925: #line 7021 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 38844 "gram.c" /* yacc.c:1646 */ break; case 926: #line 7022 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 38850 "gram.c" /* yacc.c:1646 */ break; case 927: #line 7023 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 38856 "gram.c" /* yacc.c:1646 */ break; case 928: #line 7024 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 38862 "gram.c" /* yacc.c:1646 */ break; case 929: #line 7025 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 38868 "gram.c" /* yacc.c:1646 */ break; case 930: #line 7026 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 38874 "gram.c" /* yacc.c:1646 */ break; case 931: #line 7027 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 38880 "gram.c" /* yacc.c:1646 */ break; case 932: #line 7028 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 38886 "gram.c" /* yacc.c:1646 */ break; case 933: #line 7029 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 38892 "gram.c" /* yacc.c:1646 */ break; case 934: #line 7039 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = (yyvsp[0].objtype); } #line 38898 "gram.c" /* yacc.c:1646 */ break; case 935: #line 7040 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 38904 "gram.c" /* yacc.c:1646 */ break; case 936: #line 7041 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 38910 "gram.c" /* yacc.c:1646 */ break; case 937: #line 7042 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 38916 "gram.c" /* yacc.c:1646 */ break; case 938: #line 7043 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 38922 "gram.c" /* yacc.c:1646 */ break; case 939: #line 7047 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 38928 "gram.c" /* yacc.c:1646 */ break; case 940: #line 7048 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 38934 "gram.c" /* yacc.c:1646 */ break; case 941: #line 7049 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 38940 "gram.c" /* yacc.c:1646 */ break; case 942: #line 7050 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 38946 "gram.c" /* yacc.c:1646 */ break; case 943: #line 7051 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 38952 "gram.c" /* yacc.c:1646 */ break; case 944: #line 7052 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 38958 "gram.c" /* yacc.c:1646 */ break; case 945: #line 7053 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 38964 "gram.c" /* yacc.c:1646 */ break; case 946: #line 7054 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 38970 "gram.c" /* yacc.c:1646 */ break; case 947: #line 7059 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_POLICY; } #line 38976 "gram.c" /* yacc.c:1646 */ break; case 948: #line 7060 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_RULE; } #line 38982 "gram.c" /* yacc.c:1646 */ break; case 949: #line 7061 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TRIGGER; } #line 38988 "gram.c" /* yacc.c:1646 */ break; case 950: #line 7065 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 38994 "gram.c" /* yacc.c:1646 */ break; case 951: #line 7066 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 39000 "gram.c" /* yacc.c:1646 */ break; case 952: #line 7069 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39006 "gram.c" /* yacc.c:1646 */ break; case 953: #line 7070 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 39012 "gram.c" /* yacc.c:1646 */ break; case 954: #line 7074 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39018 "gram.c" /* yacc.c:1646 */ break; case 955: #line 7076 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39024 "gram.c" /* yacc.c:1646 */ break; case 956: #line 7080 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 39030 "gram.c" /* yacc.c:1646 */ break; case 957: #line 7081 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 39036 "gram.c" /* yacc.c:1646 */ break; case 958: #line 7093 "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 39049 "gram.c" /* yacc.c:1646 */ break; case 959: #line 7104 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39055 "gram.c" /* yacc.c:1646 */ break; case 960: #line 7105 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39061 "gram.c" /* yacc.c:1646 */ break; case 961: #line 7106 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39067 "gram.c" /* yacc.c:1646 */ break; case 962: #line 7117 "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 39080 "gram.c" /* yacc.c:1646 */ break; case 963: #line 7126 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39093 "gram.c" /* yacc.c:1646 */ break; case 964: #line 7135 "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 39106 "gram.c" /* yacc.c:1646 */ break; case 965: #line 7144 "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 39119 "gram.c" /* yacc.c:1646 */ break; case 966: #line 7153 "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 39132 "gram.c" /* yacc.c:1646 */ break; case 967: #line 7162 "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 39145 "gram.c" /* yacc.c:1646 */ break; case 968: #line 7171 "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 39158 "gram.c" /* yacc.c:1646 */ break; case 969: #line 7180 "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 39171 "gram.c" /* yacc.c:1646 */ break; case 970: #line 7189 "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 39184 "gram.c" /* yacc.c:1646 */ break; case 971: #line 7198 "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 39202 "gram.c" /* yacc.c:1646 */ break; case 972: #line 7212 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-5].objtype); n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39215 "gram.c" /* yacc.c:1646 */ break; case 973: #line 7221 "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 39228 "gram.c" /* yacc.c:1646 */ break; case 974: #line 7230 "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 39241 "gram.c" /* yacc.c:1646 */ break; case 975: #line 7239 "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 39254 "gram.c" /* yacc.c:1646 */ break; case 976: #line 7248 "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 39267 "gram.c" /* yacc.c:1646 */ break; case 977: #line 7257 "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 39280 "gram.c" /* yacc.c:1646 */ break; case 978: #line 7266 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39293 "gram.c" /* yacc.c:1646 */ break; case 979: #line 7275 "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 39306 "gram.c" /* yacc.c:1646 */ break; case 980: #line 7286 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39312 "gram.c" /* yacc.c:1646 */ break; case 981: #line 7287 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39318 "gram.c" /* yacc.c:1646 */ break; case 982: #line 7303 "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 39332 "gram.c" /* yacc.c:1646 */ break; case 983: #line 7314 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39346 "gram.c" /* yacc.c:1646 */ break; case 984: #line 7325 "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 39360 "gram.c" /* yacc.c:1646 */ break; case 985: #line 7336 "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 39374 "gram.c" /* yacc.c:1646 */ break; case 986: #line 7347 "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 39388 "gram.c" /* yacc.c:1646 */ break; case 987: #line 7358 "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 39402 "gram.c" /* yacc.c:1646 */ break; case 988: #line 7369 "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 39416 "gram.c" /* yacc.c:1646 */ break; case 989: #line 7380 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39430 "gram.c" /* yacc.c:1646 */ break; case 990: #line 7391 "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 39444 "gram.c" /* yacc.c:1646 */ break; case 991: #line 7402 "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 39458 "gram.c" /* yacc.c:1646 */ break; case 992: #line 7413 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39464 "gram.c" /* yacc.c:1646 */ break; case 993: #line 7414 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39470 "gram.c" /* yacc.c:1646 */ break; case 994: #line 7417 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39476 "gram.c" /* yacc.c:1646 */ break; case 995: #line 7418 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39482 "gram.c" /* yacc.c:1646 */ break; case 996: #line 7429 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *) n; } #line 39493 "gram.c" /* yacc.c:1646 */ break; case 997: #line 7436 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *) n; } #line 39504 "gram.c" /* yacc.c:1646 */ break; case 998: #line 7445 "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 39517 "gram.c" /* yacc.c:1646 */ break; case 999: #line 7454 "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 39530 "gram.c" /* yacc.c:1646 */ break; case 1000: #line 7463 "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 39543 "gram.c" /* yacc.c:1646 */ break; case 1001: #line 7472 "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 39556 "gram.c" /* yacc.c:1646 */ break; case 1002: #line 7481 "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 39569 "gram.c" /* yacc.c:1646 */ break; case 1003: #line 7490 "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 39582 "gram.c" /* yacc.c:1646 */ break; case 1004: #line 7499 "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 39595 "gram.c" /* yacc.c:1646 */ break; case 1005: #line 7508 "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 39608 "gram.c" /* yacc.c:1646 */ break; case 1006: #line 7517 "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 39621 "gram.c" /* yacc.c:1646 */ break; case 1007: #line 7526 "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 39634 "gram.c" /* yacc.c:1646 */ break; case 1008: #line 7535 "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 39647 "gram.c" /* yacc.c:1646 */ break; case 1009: #line 7544 "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 39660 "gram.c" /* yacc.c:1646 */ break; case 1010: #line 7553 "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 39673 "gram.c" /* yacc.c:1646 */ break; case 1011: #line 7562 "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 39686 "gram.c" /* yacc.c:1646 */ break; case 1012: #line 7571 "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 39699 "gram.c" /* yacc.c:1646 */ break; case 1013: #line 7580 "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 39712 "gram.c" /* yacc.c:1646 */ break; case 1018: #line 7607 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = true; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grant_option = (yyvsp[-1].boolean); n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 39730 "gram.c" /* yacc.c:1646 */ break; case 1019: #line 7625 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = false; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 39749 "gram.c" /* yacc.c:1646 */ break; case 1020: #line 7641 "gram.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = true; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 39768 "gram.c" /* yacc.c:1646 */ break; case 1021: #line 7668 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39774 "gram.c" /* yacc.c:1646 */ break; case 1022: #line 7670 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39780 "gram.c" /* yacc.c:1646 */ break; case 1023: #line 7672 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39786 "gram.c" /* yacc.c:1646 */ break; case 1024: #line 7674 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 39798 "gram.c" /* yacc.c:1646 */ break; case 1025: #line 7682 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 39810 "gram.c" /* yacc.c:1646 */ break; case 1026: #line 7691 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 39816 "gram.c" /* yacc.c:1646 */ break; case 1027: #line 7692 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 39822 "gram.c" /* yacc.c:1646 */ break; case 1028: #line 7696 "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 39834 "gram.c" /* yacc.c:1646 */ break; case 1029: #line 7704 "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 39846 "gram.c" /* yacc.c:1646 */ break; case 1030: #line 7712 "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 39858 "gram.c" /* yacc.c:1646 */ break; case 1031: #line 7720 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup("alter system"); n->cols = NIL; (yyval.accesspriv) = n; } #line 39869 "gram.c" /* yacc.c:1646 */ break; case 1032: #line 7727 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 39881 "gram.c" /* yacc.c:1646 */ break; case 1033: #line 7738 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39889 "gram.c" /* yacc.c:1646 */ break; case 1034: #line 7742 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39897 "gram.c" /* yacc.c:1646 */ break; case 1035: #line 7749 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39905 "gram.c" /* yacc.c:1646 */ break; case 1036: #line 7753 "gram.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 39913 "gram.c" /* yacc.c:1646 */ break; case 1037: #line 7764 "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 39926 "gram.c" /* yacc.c:1646 */ break; case 1038: #line 7773 "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 39939 "gram.c" /* yacc.c:1646 */ break; case 1039: #line 7782 "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 39952 "gram.c" /* yacc.c:1646 */ break; case 1040: #line 7791 "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 39965 "gram.c" /* yacc.c:1646 */ break; case 1041: #line 7800 "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 39978 "gram.c" /* yacc.c:1646 */ break; case 1042: #line 7809 "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 39991 "gram.c" /* yacc.c:1646 */ break; case 1043: #line 7818 "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 40004 "gram.c" /* yacc.c:1646 */ break; case 1044: #line 7827 "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 40017 "gram.c" /* yacc.c:1646 */ break; case 1045: #line 7836 "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 40030 "gram.c" /* yacc.c:1646 */ break; case 1046: #line 7845 "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 40043 "gram.c" /* yacc.c:1646 */ break; case 1047: #line 7854 "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 40056 "gram.c" /* yacc.c:1646 */ break; case 1048: #line 7863 "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 40069 "gram.c" /* yacc.c:1646 */ break; case 1049: #line 7872 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PARAMETER_ACL; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 40081 "gram.c" /* yacc.c:1646 */ break; case 1050: #line 7880 "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 40094 "gram.c" /* yacc.c:1646 */ break; case 1051: #line 7889 "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 40107 "gram.c" /* yacc.c:1646 */ break; case 1052: #line 7898 "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 40120 "gram.c" /* yacc.c:1646 */ break; case 1053: #line 7907 "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 40133 "gram.c" /* yacc.c:1646 */ break; case 1054: #line 7916 "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 40146 "gram.c" /* yacc.c:1646 */ break; case 1055: #line 7925 "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 40159 "gram.c" /* yacc.c:1646 */ break; case 1056: #line 7934 "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 40172 "gram.c" /* yacc.c:1646 */ break; case 1057: #line 7943 "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 40185 "gram.c" /* yacc.c:1646 */ break; case 1058: #line 7955 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 40191 "gram.c" /* yacc.c:1646 */ break; case 1059: #line 7956 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 40197 "gram.c" /* yacc.c:1646 */ break; case 1060: #line 7960 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40203 "gram.c" /* yacc.c:1646 */ break; case 1061: #line 7961 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40209 "gram.c" /* yacc.c:1646 */ break; case 1062: #line 7966 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40215 "gram.c" /* yacc.c:1646 */ break; case 1063: #line 7967 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40221 "gram.c" /* yacc.c:1646 */ break; case 1064: #line 7978 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = true; n->granted_roles = (yyvsp[-3].list); n->grantee_roles = (yyvsp[-1].list); n->opt = NIL; n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40236 "gram.c" /* yacc.c:1646 */ break; case 1065: #line 7989 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = true; n->granted_roles = (yyvsp[-5].list); n->grantee_roles = (yyvsp[-3].list); n->opt = (yyvsp[-1].list); n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40251 "gram.c" /* yacc.c:1646 */ break; case 1066: #line 8003 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = false; n->opt = NIL; n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40267 "gram.c" /* yacc.c:1646 */ break; case 1067: #line 8015 "gram.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); DefElem *opt; opt = makeDefElem(pstrdup((yyvsp[-7].str)), (Node *) makeBoolean(false), (yylsp[-7])); n->is_grant = false; n->opt = list_make1(opt); n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40286 "gram.c" /* yacc.c:1646 */ break; case 1068: #line 8032 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 40292 "gram.c" /* yacc.c:1646 */ break; case 1069: #line 8033 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 40298 "gram.c" /* yacc.c:1646 */ break; case 1070: #line 8038 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem(pstrdup((yyvsp[-1].str)), (yyvsp[0].node), (yylsp[-1])); } #line 40306 "gram.c" /* yacc.c:1646 */ break; case 1071: #line 8044 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(true); } #line 40312 "gram.c" /* yacc.c:1646 */ break; case 1072: #line 8045 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(true); } #line 40318 "gram.c" /* yacc.c:1646 */ break; case 1073: #line 8046 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(false); } #line 40324 "gram.c" /* yacc.c:1646 */ break; case 1074: #line 8049 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40330 "gram.c" /* yacc.c:1646 */ break; case 1075: #line 8050 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 40336 "gram.c" /* yacc.c:1646 */ break; case 1076: #line 8061 "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 40348 "gram.c" /* yacc.c:1646 */ break; case 1077: #line 8071 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 40354 "gram.c" /* yacc.c:1646 */ break; case 1078: #line 8072 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40360 "gram.c" /* yacc.c:1646 */ break; case 1079: #line 8077 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schemas", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40368 "gram.c" /* yacc.c:1646 */ break; case 1080: #line 8081 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40376 "gram.c" /* yacc.c:1646 */ break; case 1081: #line 8085 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40384 "gram.c" /* yacc.c:1646 */ break; case 1082: #line 8097 "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 40401 "gram.c" /* yacc.c:1646 */ break; case 1083: #line 8111 "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 40419 "gram.c" /* yacc.c:1646 */ break; case 1084: #line 8126 "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 40437 "gram.c" /* yacc.c:1646 */ break; case 1085: #line 8142 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TABLE; } #line 40443 "gram.c" /* yacc.c:1646 */ break; case 1086: #line 8143 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 40449 "gram.c" /* yacc.c:1646 */ break; case 1087: #line 8144 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 40455 "gram.c" /* yacc.c:1646 */ break; case 1088: #line 8145 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SEQUENCE; } #line 40461 "gram.c" /* yacc.c:1646 */ break; case 1089: #line 8146 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TYPE; } #line 40467 "gram.c" /* yacc.c:1646 */ break; case 1090: #line 8147 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SCHEMA; } #line 40473 "gram.c" /* yacc.c:1646 */ break; case 1091: #line 8162 "gram.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-14].boolean); n->concurrent = (yyvsp[-12].boolean); n->idxname = (yyvsp[-11].str); n->relation = (yyvsp[-9].range); n->accessMethod = (yyvsp[-8].str); n->indexParams = (yyvsp[-6].list); n->indexIncludingParams = (yyvsp[-4].list); n->nulls_not_distinct = !(yyvsp[-3].boolean); 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->oldNumber = InvalidRelFileNumber; n->oldCreateSubid = InvalidSubTransactionId; n->oldFirstRelfilelocatorSubid = InvalidSubTransactionId; 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 40507 "gram.c" /* yacc.c:1646 */ break; case 1092: #line 8194 "gram.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-17].boolean); n->concurrent = (yyvsp[-15].boolean); n->idxname = (yyvsp[-11].str); n->relation = (yyvsp[-9].range); n->accessMethod = (yyvsp[-8].str); n->indexParams = (yyvsp[-6].list); n->indexIncludingParams = (yyvsp[-4].list); n->nulls_not_distinct = !(yyvsp[-3].boolean); 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->oldNumber = InvalidRelFileNumber; n->oldCreateSubid = InvalidSubTransactionId; n->oldFirstRelfilelocatorSubid = InvalidSubTransactionId; 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 40541 "gram.c" /* yacc.c:1646 */ break; case 1093: #line 8226 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40547 "gram.c" /* yacc.c:1646 */ break; case 1094: #line 8227 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40553 "gram.c" /* yacc.c:1646 */ break; case 1095: #line 8231 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 40559 "gram.c" /* yacc.c:1646 */ break; case 1096: #line 8232 "gram.y" /* yacc.c:1646 */ { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 40565 "gram.c" /* yacc.c:1646 */ break; case 1097: #line 8235 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 40571 "gram.c" /* yacc.c:1646 */ break; case 1098: #line 8236 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 40577 "gram.c" /* yacc.c:1646 */ break; case 1099: #line 8242 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-3].list); (yyval.ielem)->opclass = (yyvsp[-2].list); (yyval.ielem)->opclassopts = NIL; (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 40593 "gram.c" /* yacc.c:1646 */ break; case 1100: #line 8254 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-4].list); (yyval.ielem)->opclass = (yyvsp[-3].list); (yyval.ielem)->opclassopts = (yyvsp[-2].list); (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 40609 "gram.c" /* yacc.c:1646 */ break; case 1101: #line 8273 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->name = (yyvsp[-1].str); } #line 40618 "gram.c" /* yacc.c:1646 */ break; case 1102: #line 8278 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-1].node); } #line 40627 "gram.c" /* yacc.c:1646 */ break; case 1103: #line 8283 "gram.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-2].node); } #line 40636 "gram.c" /* yacc.c:1646 */ break; case 1104: #line 8289 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40642 "gram.c" /* yacc.c:1646 */ break; case 1105: #line 8290 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40648 "gram.c" /* yacc.c:1646 */ break; case 1106: #line 8293 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 40654 "gram.c" /* yacc.c:1646 */ break; case 1107: #line 8294 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 40660 "gram.c" /* yacc.c:1646 */ break; case 1108: #line 8297 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40666 "gram.c" /* yacc.c:1646 */ break; case 1109: #line 8298 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40672 "gram.c" /* yacc.c:1646 */ break; case 1110: #line 8302 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_ASC; } #line 40678 "gram.c" /* yacc.c:1646 */ break; case 1111: #line 8303 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DESC; } #line 40684 "gram.c" /* yacc.c:1646 */ break; case 1112: #line 8304 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DEFAULT; } #line 40690 "gram.c" /* yacc.c:1646 */ break; case 1113: #line 8307 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 40696 "gram.c" /* yacc.c:1646 */ break; case 1114: #line 8308 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_LAST; } #line 40702 "gram.c" /* yacc.c:1646 */ break; case 1115: #line 8309 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 40708 "gram.c" /* yacc.c:1646 */ break; case 1116: #line 8327 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-7].boolean); n->funcname = (yyvsp[-5].list); n->parameters = (yyvsp[-4].list); n->returnType = (yyvsp[-2].typnam); n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40725 "gram.c" /* yacc.c:1646 */ break; case 1117: #line 8341 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-10].boolean); n->funcname = (yyvsp[-8].list); n->parameters = mergeTableFuncParameters((yyvsp[-7].list), (yyvsp[-3].list)); n->returnType = TableFuncTypeName((yyvsp[-3].list)); n->returnType->location = (yylsp[-5]); n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40743 "gram.c" /* yacc.c:1646 */ break; case 1118: #line 8356 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-5].boolean); n->funcname = (yyvsp[-3].list); n->parameters = (yyvsp[-2].list); n->returnType = NULL; n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40760 "gram.c" /* yacc.c:1646 */ break; case 1119: #line 8370 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = true; n->replace = (yyvsp[-5].boolean); n->funcname = (yyvsp[-3].list); n->parameters = (yyvsp[-2].list); n->returnType = NULL; n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40777 "gram.c" /* yacc.c:1646 */ break; case 1120: #line 8385 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40783 "gram.c" /* yacc.c:1646 */ break; case 1121: #line 8386 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40789 "gram.c" /* yacc.c:1646 */ break; case 1122: #line 8389 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40795 "gram.c" /* yacc.c:1646 */ break; case 1123: #line 8390 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40801 "gram.c" /* yacc.c:1646 */ break; case 1124: #line 8394 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 40807 "gram.c" /* yacc.c:1646 */ break; case 1125: #line 8395 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 40813 "gram.c" /* yacc.c:1646 */ break; case 1126: #line 8399 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 40819 "gram.c" /* yacc.c:1646 */ break; case 1127: #line 8401 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 40825 "gram.c" /* yacc.c:1646 */ break; case 1128: #line 8406 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); n->objfuncargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 40838 "gram.c" /* yacc.c:1646 */ break; case 1129: #line 8420 "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 40850 "gram.c" /* yacc.c:1646 */ break; case 1130: #line 8428 "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 40862 "gram.c" /* yacc.c:1646 */ break; case 1131: #line 8436 "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 40875 "gram.c" /* yacc.c:1646 */ break; case 1132: #line 8451 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40881 "gram.c" /* yacc.c:1646 */ break; case 1133: #line 8452 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40887 "gram.c" /* yacc.c:1646 */ break; case 1134: #line 8456 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 40893 "gram.c" /* yacc.c:1646 */ break; case 1135: #line 8458 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 40899 "gram.c" /* yacc.c:1646 */ break; case 1136: #line 8473 "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 40913 "gram.c" /* yacc.c:1646 */ break; case 1137: #line 8483 "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 40927 "gram.c" /* yacc.c:1646 */ break; case 1138: #line 8493 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; (yyval.fun_param) = n; } #line 40941 "gram.c" /* yacc.c:1646 */ break; case 1139: #line 8503 "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 40955 "gram.c" /* yacc.c:1646 */ break; case 1140: #line 8513 "gram.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; (yyval.fun_param) = n; } #line 40969 "gram.c" /* yacc.c:1646 */ break; case 1141: #line 8525 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 40975 "gram.c" /* yacc.c:1646 */ break; case 1142: #line 8526 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 40981 "gram.c" /* yacc.c:1646 */ break; case 1143: #line 8527 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 40987 "gram.c" /* yacc.c:1646 */ break; case 1144: #line 8528 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 40993 "gram.c" /* yacc.c:1646 */ break; case 1145: #line 8529 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 40999 "gram.c" /* yacc.c:1646 */ break; case 1147: #line 8540 "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 41011 "gram.c" /* yacc.c:1646 */ break; case 1148: #line 8554 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 41017 "gram.c" /* yacc.c:1646 */ break; case 1149: #line 8556 "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 41027 "gram.c" /* yacc.c:1646 */ break; case 1150: #line 8562 "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 41038 "gram.c" /* yacc.c:1646 */ break; case 1151: #line 8572 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 41046 "gram.c" /* yacc.c:1646 */ break; case 1152: #line 8576 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 41055 "gram.c" /* yacc.c:1646 */ break; case 1153: #line 8581 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 41064 "gram.c" /* yacc.c:1646 */ break; case 1154: #line 8589 "gram.y" /* yacc.c:1646 */ { if (!((yyvsp[0].fun_param)->mode == FUNC_PARAM_DEFAULT || (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 41079 "gram.c" /* yacc.c:1646 */ break; case 1155: #line 8631 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 41087 "gram.c" /* yacc.c:1646 */ break; case 1156: #line 8635 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 41095 "gram.c" /* yacc.c:1646 */ break; case 1157: #line 8639 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 41103 "gram.c" /* yacc.c:1646 */ break; case 1158: #line 8643 "gram.y" /* yacc.c:1646 */ { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 41112 "gram.c" /* yacc.c:1646 */ break; case 1159: #line 8650 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 41118 "gram.c" /* yacc.c:1646 */ break; case 1160: #line 8651 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 41124 "gram.c" /* yacc.c:1646 */ break; case 1161: #line 8656 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractAggrArgTypes((yyvsp[0].list)); n->objfuncargs = (List *) linitial((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 41137 "gram.c" /* yacc.c:1646 */ break; case 1162: #line 8667 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 41143 "gram.c" /* yacc.c:1646 */ break; case 1163: #line 8669 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 41149 "gram.c" /* yacc.c:1646 */ break; case 1165: #line 8674 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41155 "gram.c" /* yacc.c:1646 */ break; case 1166: #line 8679 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41161 "gram.c" /* yacc.c:1646 */ break; case 1167: #line 8680 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41167 "gram.c" /* yacc.c:1646 */ break; case 1168: #line 8688 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(false), (yylsp[-3])); } #line 41175 "gram.c" /* yacc.c:1646 */ break; case 1169: #line 8692 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[-4])); } #line 41183 "gram.c" /* yacc.c:1646 */ break; case 1170: #line 8696 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[0])); } #line 41191 "gram.c" /* yacc.c:1646 */ break; case 1171: #line 8700 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("immutable"), (yylsp[0])); } #line 41199 "gram.c" /* yacc.c:1646 */ break; case 1172: #line 8704 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("stable"), (yylsp[0])); } #line 41207 "gram.c" /* yacc.c:1646 */ break; case 1173: #line 8708 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("volatile"), (yylsp[0])); } #line 41215 "gram.c" /* yacc.c:1646 */ break; case 1174: #line 8712 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-2])); } #line 41223 "gram.c" /* yacc.c:1646 */ break; case 1175: #line 8716 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-2])); } #line 41231 "gram.c" /* yacc.c:1646 */ break; case 1176: #line 8720 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-1])); } #line 41239 "gram.c" /* yacc.c:1646 */ break; case 1177: #line 8724 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-1])); } #line 41247 "gram.c" /* yacc.c:1646 */ break; case 1178: #line 8728 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(true), (yylsp[0])); } #line 41255 "gram.c" /* yacc.c:1646 */ break; case 1179: #line 8732 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(false), (yylsp[-1])); } #line 41263 "gram.c" /* yacc.c:1646 */ break; case 1180: #line 8736 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cost", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 41271 "gram.c" /* yacc.c:1646 */ break; case 1181: #line 8740 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rows", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 41279 "gram.c" /* yacc.c:1646 */ break; case 1182: #line 8744 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("support", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41287 "gram.c" /* yacc.c:1646 */ break; case 1183: #line 8748 "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 41296 "gram.c" /* yacc.c:1646 */ break; case 1184: #line 8753 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("parallel", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41304 "gram.c" /* yacc.c:1646 */ break; case 1185: #line 8760 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41312 "gram.c" /* yacc.c:1646 */ break; case 1186: #line 8764 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41320 "gram.c" /* yacc.c:1646 */ break; case 1187: #line 8768 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transform", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41328 "gram.c" /* yacc.c:1646 */ break; case 1188: #line 8772 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("window", (Node *) makeBoolean(true), (yylsp[0])); } #line 41336 "gram.c" /* yacc.c:1646 */ break; case 1189: #line 8776 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 41344 "gram.c" /* yacc.c:1646 */ break; case 1190: #line 8781 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41350 "gram.c" /* yacc.c:1646 */ break; case 1191: #line 8783 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 41358 "gram.c" /* yacc.c:1646 */ break; case 1192: #line 8789 "gram.y" /* yacc.c:1646 */ { ReturnStmt *r = makeNode(ReturnStmt); r->returnval = (Node *) (yyvsp[0].node); (yyval.node) = (Node *) r; } #line 41369 "gram.c" /* yacc.c:1646 */ break; case 1193: #line 8799 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41377 "gram.c" /* yacc.c:1646 */ break; case 1194: #line 8803 "gram.y" /* yacc.c:1646 */ { /* * A compound statement is stored as a single-item list * containing the list of statements as its member. That * way, the parse analysis code can tell apart an empty * body from no body at all. */ (yyval.node) = (Node *) list_make1((yyvsp[-1].list)); } #line 41391 "gram.c" /* yacc.c:1646 */ break; case 1195: #line 8813 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41399 "gram.c" /* yacc.c:1646 */ break; case 1196: #line 8820 "gram.y" /* yacc.c:1646 */ { /* As in stmtmulti, discard empty statements */ if ((yyvsp[-1].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[-1].node)); else (yyval.list) = (yyvsp[-2].list); } #line 41411 "gram.c" /* yacc.c:1646 */ break; case 1197: #line 8828 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41419 "gram.c" /* yacc.c:1646 */ break; case 1200: #line 8839 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 41425 "gram.c" /* yacc.c:1646 */ break; case 1201: #line 8840 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 41431 "gram.c" /* yacc.c:1646 */ break; case 1202: #line 8844 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41437 "gram.c" /* yacc.c:1646 */ break; case 1203: #line 8845 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41443 "gram.c" /* yacc.c:1646 */ break; case 1204: #line 8849 "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 41457 "gram.c" /* yacc.c:1646 */ break; case 1205: #line 8862 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 41465 "gram.c" /* yacc.c:1646 */ break; case 1206: #line 8866 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 41473 "gram.c" /* yacc.c:1646 */ break; case 1207: #line 8881 "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 41486 "gram.c" /* yacc.c:1646 */ break; case 1208: #line 8890 "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 41499 "gram.c" /* yacc.c:1646 */ break; case 1209: #line 8899 "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 41512 "gram.c" /* yacc.c:1646 */ break; case 1210: #line 8911 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41518 "gram.c" /* yacc.c:1646 */ break; case 1211: #line 8912 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41524 "gram.c" /* yacc.c:1646 */ break; case 1214: #line 8936 "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 41539 "gram.c" /* yacc.c:1646 */ break; case 1215: #line 8947 "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 41554 "gram.c" /* yacc.c:1646 */ break; case 1216: #line 8958 "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 41569 "gram.c" /* yacc.c:1646 */ break; case 1217: #line 8969 "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 41584 "gram.c" /* yacc.c:1646 */ break; case 1218: #line 8980 "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 41599 "gram.c" /* yacc.c:1646 */ break; case 1219: #line 8991 "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 41614 "gram.c" /* yacc.c:1646 */ break; case 1220: #line 9005 "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 41629 "gram.c" /* yacc.c:1646 */ break; case 1221: #line 9016 "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 41644 "gram.c" /* yacc.c:1646 */ break; case 1222: #line 9030 "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 41659 "gram.c" /* yacc.c:1646 */ break; case 1223: #line 9041 "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 41674 "gram.c" /* yacc.c:1646 */ break; case 1224: #line 9055 "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 41686 "gram.c" /* yacc.c:1646 */ break; case 1225: #line 9063 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 41692 "gram.c" /* yacc.c:1646 */ break; case 1226: #line 9065 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 41698 "gram.c" /* yacc.c:1646 */ break; case 1227: #line 9067 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 41704 "gram.c" /* yacc.c:1646 */ break; case 1228: #line 9072 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41710 "gram.c" /* yacc.c:1646 */ break; case 1229: #line 9074 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 41716 "gram.c" /* yacc.c:1646 */ break; case 1230: #line 9078 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 41722 "gram.c" /* yacc.c:1646 */ break; case 1231: #line 9080 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 41728 "gram.c" /* yacc.c:1646 */ break; case 1232: #line 9085 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 41740 "gram.c" /* yacc.c:1646 */ break; case 1233: #line 9104 "gram.y" /* yacc.c:1646 */ { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 41751 "gram.c" /* yacc.c:1646 */ break; case 1234: #line 9113 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41757 "gram.c" /* yacc.c:1646 */ break; case 1235: #line 9114 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41763 "gram.c" /* yacc.c:1646 */ break; case 1236: #line 9119 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) makeString((yyvsp[0].str)), (yylsp[0])); } #line 41771 "gram.c" /* yacc.c:1646 */ break; case 1237: #line 9123 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41779 "gram.c" /* yacc.c:1646 */ break; case 1238: #line 9136 "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 41794 "gram.c" /* yacc.c:1646 */ break; case 1239: #line 9148 "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 41809 "gram.c" /* yacc.c:1646 */ break; case 1240: #line 9160 "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 41824 "gram.c" /* yacc.c:1646 */ break; case 1241: #line 9172 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_IMPLICIT; } #line 41830 "gram.c" /* yacc.c:1646 */ break; case 1242: #line 9173 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_ASSIGNMENT; } #line 41836 "gram.c" /* yacc.c:1646 */ break; case 1243: #line 9174 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_EXPLICIT; } #line 41842 "gram.c" /* yacc.c:1646 */ break; case 1244: #line 9179 "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 41857 "gram.c" /* yacc.c:1646 */ break; case 1245: #line 9191 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 41863 "gram.c" /* yacc.c:1646 */ break; case 1246: #line 9192 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 41869 "gram.c" /* yacc.c:1646 */ break; case 1247: #line 9203 "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 41884 "gram.c" /* yacc.c:1646 */ break; case 1248: #line 9216 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 41892 "gram.c" /* yacc.c:1646 */ break; case 1249: #line 9220 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 41900 "gram.c" /* yacc.c:1646 */ break; case 1250: #line 9224 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 41908 "gram.c" /* yacc.c:1646 */ break; case 1251: #line 9228 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 41916 "gram.c" /* yacc.c:1646 */ break; case 1252: #line 9235 "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 41930 "gram.c" /* yacc.c:1646 */ break; case 1253: #line 9257 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->relation = (yyvsp[0].range); n->name = NULL; n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41947 "gram.c" /* yacc.c:1646 */ break; case 1254: #line 9270 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = REINDEX_OBJECT_SCHEMA; n->relation = NULL; n->name = (yyvsp[0].str); n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41964 "gram.c" /* yacc.c:1646 */ break; case 1255: #line 9283 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->relation = NULL; n->name = (yyvsp[0].str); n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41981 "gram.c" /* yacc.c:1646 */ break; case 1256: #line 9297 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 41987 "gram.c" /* yacc.c:1646 */ break; case 1257: #line 9298 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 41993 "gram.c" /* yacc.c:1646 */ break; case 1258: #line 9301 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 41999 "gram.c" /* yacc.c:1646 */ break; case 1259: #line 9302 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 42005 "gram.c" /* yacc.c:1646 */ break; case 1260: #line 9305 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 42011 "gram.c" /* yacc.c:1646 */ break; case 1261: #line 9306 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 42017 "gram.c" /* yacc.c:1646 */ break; case 1262: #line 9317 "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 42031 "gram.c" /* yacc.c:1646 */ break; case 1263: #line 9327 "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 42045 "gram.c" /* yacc.c:1646 */ break; case 1264: #line 9345 "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 42059 "gram.c" /* yacc.c:1646 */ break; case 1265: #line 9355 "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 42073 "gram.c" /* yacc.c:1646 */ break; case 1266: #line 9365 "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 42087 "gram.c" /* yacc.c:1646 */ break; case 1267: #line 9375 "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 42101 "gram.c" /* yacc.c:1646 */ break; case 1268: #line 9385 "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 42115 "gram.c" /* yacc.c:1646 */ break; case 1269: #line 9395 "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 42129 "gram.c" /* yacc.c:1646 */ break; case 1270: #line 9405 "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 42143 "gram.c" /* yacc.c:1646 */ break; case 1271: #line 9415 "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 42157 "gram.c" /* yacc.c:1646 */ break; case 1272: #line 9425 "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 42171 "gram.c" /* yacc.c:1646 */ break; case 1273: #line 9435 "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 42185 "gram.c" /* yacc.c:1646 */ break; case 1274: #line 9445 "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 42199 "gram.c" /* yacc.c:1646 */ break; case 1275: #line 9455 "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 42213 "gram.c" /* yacc.c:1646 */ break; case 1276: #line 9465 "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 42228 "gram.c" /* yacc.c:1646 */ break; case 1277: #line 9476 "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 42243 "gram.c" /* yacc.c:1646 */ break; case 1278: #line 9487 "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 42257 "gram.c" /* yacc.c:1646 */ break; case 1279: #line 9497 "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 42271 "gram.c" /* yacc.c:1646 */ break; case 1280: #line 9507 "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 42285 "gram.c" /* yacc.c:1646 */ break; case 1281: #line 9517 "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 42299 "gram.c" /* yacc.c:1646 */ break; case 1282: #line 9527 "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 42313 "gram.c" /* yacc.c:1646 */ break; case 1283: #line 9537 "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 42327 "gram.c" /* yacc.c:1646 */ break; case 1284: #line 9547 "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 42342 "gram.c" /* yacc.c:1646 */ break; case 1285: #line 9558 "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 42357 "gram.c" /* yacc.c:1646 */ break; case 1286: #line 9569 "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 42372 "gram.c" /* yacc.c:1646 */ break; case 1287: #line 9580 "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 42387 "gram.c" /* yacc.c:1646 */ break; case 1288: #line 9591 "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 42402 "gram.c" /* yacc.c:1646 */ break; case 1289: #line 9602 "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 42417 "gram.c" /* yacc.c:1646 */ break; case 1290: #line 9613 "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 42432 "gram.c" /* yacc.c:1646 */ break; case 1291: #line 9624 "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 42447 "gram.c" /* yacc.c:1646 */ break; case 1292: #line 9635 "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 42462 "gram.c" /* yacc.c:1646 */ break; case 1293: #line 9646 "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 42477 "gram.c" /* yacc.c:1646 */ break; case 1294: #line 9657 "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 42492 "gram.c" /* yacc.c:1646 */ break; case 1295: #line 9668 "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 42507 "gram.c" /* yacc.c:1646 */ break; case 1296: #line 9679 "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 42523 "gram.c" /* yacc.c:1646 */ break; case 1297: #line 9691 "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 42539 "gram.c" /* yacc.c:1646 */ break; case 1298: #line 9703 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_VIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 42555 "gram.c" /* yacc.c:1646 */ break; case 1299: #line 9715 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_VIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 42571 "gram.c" /* yacc.c:1646 */ break; case 1300: #line 9727 "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 42587 "gram.c" /* yacc.c:1646 */ break; case 1301: #line 9739 "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 42603 "gram.c" /* yacc.c:1646 */ break; case 1302: #line 9751 "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 42618 "gram.c" /* yacc.c:1646 */ break; case 1303: #line 9762 "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 42633 "gram.c" /* yacc.c:1646 */ break; case 1304: #line 9773 "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 42649 "gram.c" /* yacc.c:1646 */ break; case 1305: #line 9785 "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 42665 "gram.c" /* yacc.c:1646 */ break; case 1306: #line 9797 "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 42680 "gram.c" /* yacc.c:1646 */ break; case 1307: #line 9808 "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 42695 "gram.c" /* yacc.c:1646 */ break; case 1308: #line 9819 "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 42708 "gram.c" /* yacc.c:1646 */ break; case 1309: #line 9828 "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 42722 "gram.c" /* yacc.c:1646 */ break; case 1310: #line 9838 "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 42736 "gram.c" /* yacc.c:1646 */ break; case 1311: #line 9848 "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 42750 "gram.c" /* yacc.c:1646 */ break; case 1312: #line 9858 "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 42764 "gram.c" /* yacc.c:1646 */ break; case 1313: #line 9868 "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 42778 "gram.c" /* yacc.c:1646 */ break; case 1314: #line 9878 "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 42792 "gram.c" /* yacc.c:1646 */ break; case 1315: #line 9888 "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 42806 "gram.c" /* yacc.c:1646 */ break; case 1316: #line 9898 "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 42820 "gram.c" /* yacc.c:1646 */ break; case 1317: #line 9908 "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 42834 "gram.c" /* yacc.c:1646 */ break; case 1318: #line 9918 "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 42851 "gram.c" /* yacc.c:1646 */ break; case 1321: #line 9936 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } #line 42857 "gram.c" /* yacc.c:1646 */ break; case 1322: #line 9937 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 42863 "gram.c" /* yacc.c:1646 */ break; case 1323: #line 9948 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42877 "gram.c" /* yacc.c:1646 */ break; case 1324: #line 9958 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42891 "gram.c" /* yacc.c:1646 */ break; case 1325: #line 9968 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42905 "gram.c" /* yacc.c:1646 */ break; case 1326: #line 9978 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_TRIGGER; n->relation = (yyvsp[-5].range); n->object = (Node *) list_make1(makeString((yyvsp[-7].str))); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42920 "gram.c" /* yacc.c:1646 */ break; case 1327: #line 9989 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-5].range); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42934 "gram.c" /* yacc.c:1646 */ break; case 1328: #line 9999 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_INDEX; n->relation = (yyvsp[-5].range); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42948 "gram.c" /* yacc.c:1646 */ break; case 1329: #line 10010 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42954 "gram.c" /* yacc.c:1646 */ break; case 1330: #line 10011 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42960 "gram.c" /* yacc.c:1646 */ break; case 1331: #line 10022 "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 42974 "gram.c" /* yacc.c:1646 */ break; case 1332: #line 10032 "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 42988 "gram.c" /* yacc.c:1646 */ break; case 1333: #line 10042 "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 43002 "gram.c" /* yacc.c:1646 */ break; case 1334: #line 10052 "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 43016 "gram.c" /* yacc.c:1646 */ break; case 1335: #line 10062 "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 43030 "gram.c" /* yacc.c:1646 */ break; case 1336: #line 10072 "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 43044 "gram.c" /* yacc.c:1646 */ break; case 1337: #line 10082 "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 43058 "gram.c" /* yacc.c:1646 */ break; case 1338: #line 10092 "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 43072 "gram.c" /* yacc.c:1646 */ break; case 1339: #line 10102 "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 43086 "gram.c" /* yacc.c:1646 */ break; case 1340: #line 10112 "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 43100 "gram.c" /* yacc.c:1646 */ break; case 1341: #line 10122 "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 43114 "gram.c" /* yacc.c:1646 */ break; case 1342: #line 10132 "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 43128 "gram.c" /* yacc.c:1646 */ break; case 1343: #line 10142 "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 43142 "gram.c" /* yacc.c:1646 */ break; case 1344: #line 10152 "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 43156 "gram.c" /* yacc.c:1646 */ break; case 1345: #line 10162 "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 43170 "gram.c" /* yacc.c:1646 */ break; case 1346: #line 10172 "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 43184 "gram.c" /* yacc.c:1646 */ break; case 1347: #line 10182 "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 43198 "gram.c" /* yacc.c:1646 */ break; case 1348: #line 10192 "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 43212 "gram.c" /* yacc.c:1646 */ break; case 1349: #line 10202 "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 43226 "gram.c" /* yacc.c:1646 */ break; case 1350: #line 10212 "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 43240 "gram.c" /* yacc.c:1646 */ break; case 1351: #line 10222 "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 43254 "gram.c" /* yacc.c:1646 */ break; case 1352: #line 10232 "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 43268 "gram.c" /* yacc.c:1646 */ break; case 1353: #line 10242 "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 43282 "gram.c" /* yacc.c:1646 */ break; case 1354: #line 10252 "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 43296 "gram.c" /* yacc.c:1646 */ break; case 1355: #line 10262 "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 43310 "gram.c" /* yacc.c:1646 */ break; case 1356: #line 10272 "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 43324 "gram.c" /* yacc.c:1646 */ break; case 1357: #line 10282 "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 43338 "gram.c" /* yacc.c:1646 */ break; case 1358: #line 10301 "gram.y" /* yacc.c:1646 */ { AlterOperatorStmt *n = makeNode(AlterOperatorStmt); n->opername = (yyvsp[-4].objwithargs); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43350 "gram.c" /* yacc.c:1646 */ break; case 1359: #line 10310 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43356 "gram.c" /* yacc.c:1646 */ break; case 1360: #line 10311 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 43362 "gram.c" /* yacc.c:1646 */ break; case 1361: #line 10315 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 43368 "gram.c" /* yacc.c:1646 */ break; case 1362: #line 10317 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 43374 "gram.c" /* yacc.c:1646 */ break; case 1363: #line 10319 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 43380 "gram.c" /* yacc.c:1646 */ break; case 1364: #line 10324 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 43386 "gram.c" /* yacc.c:1646 */ break; case 1365: #line 10325 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 43392 "gram.c" /* yacc.c:1646 */ break; case 1366: #line 10326 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 43398 "gram.c" /* yacc.c:1646 */ break; case 1367: #line 10327 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 43404 "gram.c" /* yacc.c:1646 */ break; case 1368: #line 10328 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 43410 "gram.c" /* yacc.c:1646 */ break; case 1369: #line 10341 "gram.y" /* yacc.c:1646 */ { AlterTypeStmt *n = makeNode(AlterTypeStmt); n->typeName = (yyvsp[-4].list); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43422 "gram.c" /* yacc.c:1646 */ break; case 1370: #line 10357 "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 43435 "gram.c" /* yacc.c:1646 */ break; case 1371: #line 10366 "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 43448 "gram.c" /* yacc.c:1646 */ break; case 1372: #line 10375 "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 43461 "gram.c" /* yacc.c:1646 */ break; case 1373: #line 10384 "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 43474 "gram.c" /* yacc.c:1646 */ break; case 1374: #line 10393 "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 43487 "gram.c" /* yacc.c:1646 */ break; case 1375: #line 10402 "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 43500 "gram.c" /* yacc.c:1646 */ break; case 1376: #line 10411 "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 43513 "gram.c" /* yacc.c:1646 */ break; case 1377: #line 10420 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].node); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 43526 "gram.c" /* yacc.c:1646 */ break; case 1378: #line 10429 "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 43539 "gram.c" /* yacc.c:1646 */ break; case 1379: #line 10438 "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 43552 "gram.c" /* yacc.c:1646 */ break; case 1380: #line 10447 "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 43565 "gram.c" /* yacc.c:1646 */ break; case 1381: #line 10456 "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 43578 "gram.c" /* yacc.c:1646 */ break; case 1382: #line 10465 "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 43591 "gram.c" /* yacc.c:1646 */ break; case 1383: #line 10474 "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 43604 "gram.c" /* yacc.c:1646 */ break; case 1384: #line 10483 "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 43617 "gram.c" /* yacc.c:1646 */ break; case 1385: #line 10492 "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 43630 "gram.c" /* yacc.c:1646 */ break; case 1386: #line 10501 "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 43643 "gram.c" /* yacc.c:1646 */ break; case 1387: #line 10510 "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 43656 "gram.c" /* yacc.c:1646 */ break; case 1388: #line 10519 "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 43669 "gram.c" /* yacc.c:1646 */ break; case 1389: #line 10528 "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 43682 "gram.c" /* yacc.c:1646 */ break; case 1390: #line 10537 "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 43695 "gram.c" /* yacc.c:1646 */ break; case 1391: #line 10546 "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 43708 "gram.c" /* yacc.c:1646 */ break; case 1392: #line 10555 "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 43721 "gram.c" /* yacc.c:1646 */ break; case 1393: #line 10564 "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 43734 "gram.c" /* yacc.c:1646 */ break; case 1394: #line 10592 "gram.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43746 "gram.c" /* yacc.c:1646 */ break; case 1395: #line 10600 "gram.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-4].str); n->options = (yyvsp[0].list); n->for_all_tables = true; (yyval.node) = (Node *) n; } #line 43759 "gram.c" /* yacc.c:1646 */ break; case 1396: #line 10609 "gram.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-3].str); n->options = (yyvsp[0].list); n->pubobjects = (List *) (yyvsp[-1].list); preprocess_pubobj_list(n->pubobjects, yyscanner); (yyval.node) = (Node *) n; } #line 43773 "gram.c" /* yacc.c:1646 */ break; case 1397: #line 10635 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLE; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = (yyvsp[-2].range); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } #line 43786 "gram.c" /* yacc.c:1646 */ break; case 1398: #line 10644 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; (yyval.publicationobjectspec)->name = (yyvsp[0].str); (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43797 "gram.c" /* yacc.c:1646 */ break; case 1399: #line 10651 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43807 "gram.c" /* yacc.c:1646 */ break; case 1400: #line 10657 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; /* * If either a row filter or column list is specified, create * a PublicationTable object. */ if ((yyvsp[-1].list) || (yyvsp[0].node)) { /* * The OptWhereClause must be stored here but it is * valid only for tables. For non-table objects, an * error will be thrown later via * preprocess_pubobj_list(). */ (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = makeRangeVar(NULL, (yyvsp[-2].str), (yylsp[-2])); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } else { (yyval.publicationobjectspec)->name = (yyvsp[-2].str); } (yyval.publicationobjectspec)->location = (yylsp[-2]); } #line 43838 "gram.c" /* yacc.c:1646 */ break; case 1401: #line 10684 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = makeRangeVarFromQualifiedName((yyvsp[-3].str), (yyvsp[-2].list), (yylsp[-3]), yyscanner); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); (yyval.publicationobjectspec)->location = (yylsp[-3]); } #line 43852 "gram.c" /* yacc.c:1646 */ break; case 1402: #line 10695 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = (yyvsp[-2].range); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } #line 43865 "gram.c" /* yacc.c:1646 */ break; case 1403: #line 10704 "gram.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43875 "gram.c" /* yacc.c:1646 */ break; case 1404: #line 10712 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].publicationobjectspec)); } #line 43881 "gram.c" /* yacc.c:1646 */ break; case 1405: #line 10714 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].publicationobjectspec)); } #line 43887 "gram.c" /* yacc.c:1646 */ break; case 1406: #line 10736 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43899 "gram.c" /* yacc.c:1646 */ break; case 1407: #line 10744 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_AddObjects; (yyval.node) = (Node *) n; } #line 43913 "gram.c" /* yacc.c:1646 */ break; case 1408: #line 10754 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_SetObjects; (yyval.node) = (Node *) n; } #line 43927 "gram.c" /* yacc.c:1646 */ break; case 1409: #line 10764 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_DropObjects; (yyval.node) = (Node *) n; } #line 43941 "gram.c" /* yacc.c:1646 */ break; case 1410: #line 10783 "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 43955 "gram.c" /* yacc.c:1646 */ break; case 1411: #line 10802 "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 43969 "gram.c" /* yacc.c:1646 */ break; case 1412: #line 10812 "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 43983 "gram.c" /* yacc.c:1646 */ break; case 1413: #line 10822 "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 43997 "gram.c" /* yacc.c:1646 */ break; case 1414: #line 10832 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ADD_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44012 "gram.c" /* yacc.c:1646 */ break; case 1415: #line 10843 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_DROP_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44027 "gram.c" /* yacc.c:1646 */ break; case 1416: #line 10854 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SET_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44042 "gram.c" /* yacc.c:1646 */ break; case 1417: #line 10865 "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 *) makeBoolean(true), (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 44057 "gram.c" /* yacc.c:1646 */ break; case 1418: #line 10876 "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 *) makeBoolean(false), (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 44072 "gram.c" /* yacc.c:1646 */ break; case 1419: #line 10887 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SKIP; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44086 "gram.c" /* yacc.c:1646 */ break; case 1420: #line 10905 "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 44099 "gram.c" /* yacc.c:1646 */ break; case 1421: #line 10914 "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 44112 "gram.c" /* yacc.c:1646 */ break; case 1422: #line 10933 "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 44129 "gram.c" /* yacc.c:1646 */ break; case 1423: #line 10948 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44135 "gram.c" /* yacc.c:1646 */ break; case 1424: #line 10949 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 44141 "gram.c" /* yacc.c:1646 */ break; case 1425: #line 10950 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44147 "gram.c" /* yacc.c:1646 */ break; case 1426: #line 10956 "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 44157 "gram.c" /* yacc.c:1646 */ break; case 1427: #line 10962 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 44167 "gram.c" /* yacc.c:1646 */ break; case 1433: #line 10978 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44173 "gram.c" /* yacc.c:1646 */ break; case 1434: #line 10979 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 44179 "gram.c" /* yacc.c:1646 */ break; case 1435: #line 10982 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_SELECT; } #line 44185 "gram.c" /* yacc.c:1646 */ break; case 1436: #line 10983 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_UPDATE; } #line 44191 "gram.c" /* yacc.c:1646 */ break; case 1437: #line 10984 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_DELETE; } #line 44197 "gram.c" /* yacc.c:1646 */ break; case 1438: #line 10985 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_INSERT; } #line 44203 "gram.c" /* yacc.c:1646 */ break; case 1439: #line 10989 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44209 "gram.c" /* yacc.c:1646 */ break; case 1440: #line 10990 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44215 "gram.c" /* yacc.c:1646 */ break; case 1441: #line 10991 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44221 "gram.c" /* yacc.c:1646 */ break; case 1442: #line 11004 "gram.y" /* yacc.c:1646 */ { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44233 "gram.c" /* yacc.c:1646 */ break; case 1443: #line 11014 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44239 "gram.c" /* yacc.c:1646 */ break; case 1444: #line 11015 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 44245 "gram.c" /* yacc.c:1646 */ break; case 1445: #line 11019 "gram.y" /* yacc.c:1646 */ { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44256 "gram.c" /* yacc.c:1646 */ break; case 1446: #line 11029 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44267 "gram.c" /* yacc.c:1646 */ break; case 1447: #line 11036 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *) n; } #line 44278 "gram.c" /* yacc.c:1646 */ break; case 1448: #line 11056 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44292 "gram.c" /* yacc.c:1646 */ break; case 1449: #line 11066 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 44305 "gram.c" /* yacc.c:1646 */ break; case 1450: #line 11075 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44319 "gram.c" /* yacc.c:1646 */ break; case 1451: #line 11085 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44333 "gram.c" /* yacc.c:1646 */ break; case 1452: #line 11095 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44346 "gram.c" /* yacc.c:1646 */ break; case 1453: #line 11104 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44359 "gram.c" /* yacc.c:1646 */ break; case 1454: #line 11113 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44372 "gram.c" /* yacc.c:1646 */ break; case 1455: #line 11122 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44385 "gram.c" /* yacc.c:1646 */ break; case 1456: #line 11131 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44398 "gram.c" /* yacc.c:1646 */ break; case 1457: #line 11140 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44411 "gram.c" /* yacc.c:1646 */ break; case 1458: #line 11149 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44424 "gram.c" /* yacc.c:1646 */ break; case 1459: #line 11158 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44437 "gram.c" /* yacc.c:1646 */ break; case 1460: #line 11170 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 44450 "gram.c" /* yacc.c:1646 */ break; case 1461: #line 11179 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44464 "gram.c" /* yacc.c:1646 */ break; case 1465: #line 11197 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 44471 "gram.c" /* yacc.c:1646 */ break; case 1466: #line 11200 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 44478 "gram.c" /* yacc.c:1646 */ break; case 1467: #line 11203 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 44485 "gram.c" /* yacc.c:1646 */ break; case 1468: #line 11206 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 44492 "gram.c" /* yacc.c:1646 */ break; case 1469: #line 11209 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 44499 "gram.c" /* yacc.c:1646 */ break; case 1470: #line 11216 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 44505 "gram.c" /* yacc.c:1646 */ break; case 1471: #line 11218 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 44511 "gram.c" /* yacc.c:1646 */ break; case 1472: #line 11220 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 44517 "gram.c" /* yacc.c:1646 */ break; case 1474: #line 11226 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44523 "gram.c" /* yacc.c:1646 */ break; case 1475: #line 11230 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44529 "gram.c" /* yacc.c:1646 */ break; case 1476: #line 11231 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44535 "gram.c" /* yacc.c:1646 */ break; case 1477: #line 11232 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44541 "gram.c" /* yacc.c:1646 */ break; case 1478: #line 11246 "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 44558 "gram.c" /* yacc.c:1646 */ break; case 1479: #line 11260 "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 44575 "gram.c" /* yacc.c:1646 */ break; case 1480: #line 11274 "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 44597 "gram.c" /* yacc.c:1646 */ break; case 1481: #line 11293 "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 44619 "gram.c" /* yacc.c:1646 */ break; case 1482: #line 11313 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 44625 "gram.c" /* yacc.c:1646 */ break; case 1483: #line 11314 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 44631 "gram.c" /* yacc.c:1646 */ break; case 1484: #line 11315 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 44637 "gram.c" /* yacc.c:1646 */ break; case 1485: #line 11316 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = NO_CHECK_OPTION; } #line 44643 "gram.c" /* yacc.c:1646 */ break; case 1486: #line 11327 "gram.y" /* yacc.c:1646 */ { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44654 "gram.c" /* yacc.c:1646 */ break; case 1487: #line 11344 "gram.y" /* yacc.c:1646 */ { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44666 "gram.c" /* yacc.c:1646 */ break; case 1488: #line 11354 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44672 "gram.c" /* yacc.c:1646 */ break; case 1489: #line 11355 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44678 "gram.c" /* yacc.c:1646 */ break; case 1490: #line 11359 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 44684 "gram.c" /* yacc.c:1646 */ break; case 1491: #line 11360 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 44690 "gram.c" /* yacc.c:1646 */ break; case 1492: #line 11365 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (yyvsp[0].node), (yylsp[-2])); } #line 44698 "gram.c" /* yacc.c:1646 */ break; case 1493: #line 11369 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 44706 "gram.c" /* yacc.c:1646 */ break; case 1494: #line 11373 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 44714 "gram.c" /* yacc.c:1646 */ break; case 1495: #line 11390 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44720 "gram.c" /* yacc.c:1646 */ break; case 1496: #line 11391 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("connection_limit"); } #line 44726 "gram.c" /* yacc.c:1646 */ break; case 1497: #line 11392 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44732 "gram.c" /* yacc.c:1646 */ break; case 1498: #line 11393 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44738 "gram.c" /* yacc.c:1646 */ break; case 1499: #line 11394 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44744 "gram.c" /* yacc.c:1646 */ break; case 1500: #line 11395 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44750 "gram.c" /* yacc.c:1646 */ break; case 1501: #line 11396 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44756 "gram.c" /* yacc.c:1646 */ break; case 1504: #line 11416 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44768 "gram.c" /* yacc.c:1646 */ break; case 1505: #line 11424 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 44780 "gram.c" /* yacc.c:1646 */ break; case 1506: #line 11432 "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 44793 "gram.c" /* yacc.c:1646 */ break; case 1507: #line 11441 "gram.y" /* yacc.c:1646 */ { AlterDatabaseRefreshCollStmt *n = makeNode(AlterDatabaseRefreshCollStmt); n->dbname = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 44804 "gram.c" /* yacc.c:1646 */ break; case 1508: #line 11451 "gram.y" /* yacc.c:1646 */ { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 44816 "gram.c" /* yacc.c:1646 */ break; case 1509: #line 11469 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; n->options = NULL; (yyval.node) = (Node *) n; } #line 44829 "gram.c" /* yacc.c:1646 */ break; case 1510: #line 11478 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; n->options = NULL; (yyval.node) = (Node *) n; } #line 44842 "gram.c" /* yacc.c:1646 */ break; case 1511: #line 11487 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = false; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44855 "gram.c" /* yacc.c:1646 */ break; case 1512: #line 11496 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = true; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44868 "gram.c" /* yacc.c:1646 */ break; case 1513: #line 11508 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((Node *) (yyvsp[0].defelt)); } #line 44876 "gram.c" /* yacc.c:1646 */ break; case 1514: #line 11512 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (Node *) (yyvsp[0].defelt)); } #line 44884 "gram.c" /* yacc.c:1646 */ break; case 1515: #line 11523 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force", NULL, (yylsp[0])); } #line 44892 "gram.c" /* yacc.c:1646 */ break; case 1516: #line 11535 "gram.y" /* yacc.c:1646 */ { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 44903 "gram.c" /* yacc.c:1646 */ break; case 1517: #line 11553 "gram.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 44914 "gram.c" /* yacc.c:1646 */ break; case 1518: #line 11560 "gram.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 44925 "gram.c" /* yacc.c:1646 */ break; case 1519: #line 11577 "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 44939 "gram.c" /* yacc.c:1646 */ break; case 1520: #line 11591 "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 44952 "gram.c" /* yacc.c:1646 */ break; case 1521: #line 11601 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 44964 "gram.c" /* yacc.c:1646 */ break; case 1522: #line 11610 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 44976 "gram.c" /* yacc.c:1646 */ break; case 1523: #line 11619 "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 44989 "gram.c" /* yacc.c:1646 */ break; case 1524: #line 11629 "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 45004 "gram.c" /* yacc.c:1646 */ break; case 1525: #line 11641 "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 45019 "gram.c" /* yacc.c:1646 */ break; case 1526: #line 11653 "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 45032 "gram.c" /* yacc.c:1646 */ break; case 1529: #line 11676 "gram.y" /* yacc.c:1646 */ { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45044 "gram.c" /* yacc.c:1646 */ break; case 1530: #line 11687 "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 45060 "gram.c" /* yacc.c:1646 */ break; case 1531: #line 11699 "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 45076 "gram.c" /* yacc.c:1646 */ break; case 1532: #line 11711 "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 45092 "gram.c" /* yacc.c:1646 */ break; case 1533: #line 11723 "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 45108 "gram.c" /* yacc.c:1646 */ break; case 1534: #line 11735 "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 45122 "gram.c" /* yacc.c:1646 */ break; case 1535: #line 11745 "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 45136 "gram.c" /* yacc.c:1646 */ break; case 1538: #line 11774 "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 45151 "gram.c" /* yacc.c:1646 */ break; case 1539: #line 11797 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 45164 "gram.c" /* yacc.c:1646 */ break; case 1540: #line 11806 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 45177 "gram.c" /* yacc.c:1646 */ break; case 1541: #line 11816 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = NIL; if ((yyvsp[-2].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[-2]))); (yyval.node) = (Node *) n; } #line 45192 "gram.c" /* yacc.c:1646 */ break; case 1542: #line 11828 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = NIL; if ((yyvsp[0].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[0]))); (yyval.node) = (Node *) n; } #line 45207 "gram.c" /* yacc.c:1646 */ break; case 1543: #line 11840 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[0].range); n->indexname = (yyvsp[-2].str); n->params = NIL; if ((yyvsp[-3].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 45222 "gram.c" /* yacc.c:1646 */ break; case 1544: #line 11853 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45228 "gram.c" /* yacc.c:1646 */ break; case 1545: #line 11854 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 45234 "gram.c" /* yacc.c:1646 */ break; case 1546: #line 11867 "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 45259 "gram.c" /* yacc.c:1646 */ break; case 1547: #line 11888 "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 45272 "gram.c" /* yacc.c:1646 */ break; case 1548: #line 11899 "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 45288 "gram.c" /* yacc.c:1646 */ break; case 1549: #line 11911 "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 45301 "gram.c" /* yacc.c:1646 */ break; case 1550: #line 11923 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 45309 "gram.c" /* yacc.c:1646 */ break; case 1551: #line 11927 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 45317 "gram.c" /* yacc.c:1646 */ break; case 1554: #line 11939 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 45325 "gram.c" /* yacc.c:1646 */ break; case 1555: #line 11945 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45331 "gram.c" /* yacc.c:1646 */ break; case 1556: #line 11946 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 45337 "gram.c" /* yacc.c:1646 */ break; case 1557: #line 11947 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "format"; } #line 45343 "gram.c" /* yacc.c:1646 */ break; case 1558: #line 11951 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 45349 "gram.c" /* yacc.c:1646 */ break; case 1559: #line 11952 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 45355 "gram.c" /* yacc.c:1646 */ break; case 1560: #line 11953 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45361 "gram.c" /* yacc.c:1646 */ break; case 1561: #line 11957 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45367 "gram.c" /* yacc.c:1646 */ break; case 1562: #line 11958 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45373 "gram.c" /* yacc.c:1646 */ break; case 1563: #line 11962 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45379 "gram.c" /* yacc.c:1646 */ break; case 1564: #line 11963 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45385 "gram.c" /* yacc.c:1646 */ break; case 1565: #line 11966 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45391 "gram.c" /* yacc.c:1646 */ break; case 1566: #line 11967 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45397 "gram.c" /* yacc.c:1646 */ break; case 1567: #line 11970 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45403 "gram.c" /* yacc.c:1646 */ break; case 1568: #line 11971 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45409 "gram.c" /* yacc.c:1646 */ break; case 1569: #line 11975 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45415 "gram.c" /* yacc.c:1646 */ break; case 1570: #line 11976 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45421 "gram.c" /* yacc.c:1646 */ break; case 1571: #line 11981 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 45429 "gram.c" /* yacc.c:1646 */ break; case 1572: #line 11988 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45435 "gram.c" /* yacc.c:1646 */ break; case 1573: #line 11990 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45441 "gram.c" /* yacc.c:1646 */ break; case 1574: #line 11994 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45447 "gram.c" /* yacc.c:1646 */ break; case 1575: #line 11995 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45453 "gram.c" /* yacc.c:1646 */ break; case 1576: #line 12009 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 45465 "gram.c" /* yacc.c:1646 */ break; case 1577: #line 12017 "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 45480 "gram.c" /* yacc.c:1646 */ break; case 1578: #line 12028 "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 45492 "gram.c" /* yacc.c:1646 */ break; case 1579: #line 12036 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 45504 "gram.c" /* yacc.c:1646 */ break; case 1590: #line 12066 "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 45517 "gram.c" /* yacc.c:1646 */ break; case 1591: #line 12076 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45523 "gram.c" /* yacc.c:1646 */ break; case 1592: #line 12077 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45529 "gram.c" /* yacc.c:1646 */ break; case 1598: #line 12096 "gram.y" /* yacc.c:1646 */ { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 45541 "gram.c" /* yacc.c:1646 */ break; case 1599: #line 12105 "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->objtype = 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 45562 "gram.c" /* yacc.c:1646 */ break; case 1600: #line 12123 "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->objtype = 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 45583 "gram.c" /* yacc.c:1646 */ break; case 1601: #line 12141 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45589 "gram.c" /* yacc.c:1646 */ break; case 1602: #line 12142 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45595 "gram.c" /* yacc.c:1646 */ break; case 1603: #line 12153 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45608 "gram.c" /* yacc.c:1646 */ break; case 1604: #line 12162 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45621 "gram.c" /* yacc.c:1646 */ break; case 1605: #line 12171 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 45634 "gram.c" /* yacc.c:1646 */ break; case 1606: #line 12180 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 45647 "gram.c" /* yacc.c:1646 */ break; case 1607: #line 12200 "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 45659 "gram.c" /* yacc.c:1646 */ break; case 1608: #line 12217 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 45667 "gram.c" /* yacc.c:1646 */ break; case 1609: #line 12221 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 45676 "gram.c" /* yacc.c:1646 */ break; case 1610: #line 12229 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 45686 "gram.c" /* yacc.c:1646 */ break; case 1611: #line 12235 "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 45697 "gram.c" /* yacc.c:1646 */ break; case 1612: #line 12242 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 45707 "gram.c" /* yacc.c:1646 */ break; case 1613: #line 12248 "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 45718 "gram.c" /* yacc.c:1646 */ break; case 1614: #line 12255 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 45728 "gram.c" /* yacc.c:1646 */ break; case 1615: #line 12263 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 45734 "gram.c" /* yacc.c:1646 */ break; case 1616: #line 12264 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 45740 "gram.c" /* yacc.c:1646 */ break; case 1617: #line 12269 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 45746 "gram.c" /* yacc.c:1646 */ break; case 1618: #line 12271 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 45752 "gram.c" /* yacc.c:1646 */ break; case 1619: #line 12276 "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 45764 "gram.c" /* yacc.c:1646 */ break; case 1620: #line 12287 "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 45777 "gram.c" /* yacc.c:1646 */ break; case 1621: #line 12297 "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 45790 "gram.c" /* yacc.c:1646 */ break; case 1622: #line 12306 "gram.y" /* yacc.c:1646 */ { (yyval.onconflict) = NULL; } #line 45798 "gram.c" /* yacc.c:1646 */ break; case 1623: #line 12313 "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 45810 "gram.c" /* yacc.c:1646 */ break; case 1624: #line 12322 "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 45822 "gram.c" /* yacc.c:1646 */ break; case 1625: #line 12330 "gram.y" /* yacc.c:1646 */ { (yyval.infer) = NULL; } #line 45830 "gram.c" /* yacc.c:1646 */ break; case 1626: #line 12336 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45836 "gram.c" /* yacc.c:1646 */ break; case 1627: #line 12337 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45842 "gram.c" /* yacc.c:1646 */ break; case 1628: #line 12350 "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 45857 "gram.c" /* yacc.c:1646 */ break; case 1629: #line 12363 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45863 "gram.c" /* yacc.c:1646 */ break; case 1630: #line 12364 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45869 "gram.c" /* yacc.c:1646 */ break; case 1631: #line 12376 "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 45882 "gram.c" /* yacc.c:1646 */ break; case 1632: #line 12386 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival); } #line 45888 "gram.c" /* yacc.c:1646 */ break; case 1633: #line 12387 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 45894 "gram.c" /* yacc.c:1646 */ break; case 1634: #line 12390 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessShareLock; } #line 45900 "gram.c" /* yacc.c:1646 */ break; case 1635: #line 12391 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowShareLock; } #line 45906 "gram.c" /* yacc.c:1646 */ break; case 1636: #line 12392 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowExclusiveLock; } #line 45912 "gram.c" /* yacc.c:1646 */ break; case 1637: #line 12393 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareUpdateExclusiveLock; } #line 45918 "gram.c" /* yacc.c:1646 */ break; case 1638: #line 12394 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareLock; } #line 45924 "gram.c" /* yacc.c:1646 */ break; case 1639: #line 12395 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareRowExclusiveLock; } #line 45930 "gram.c" /* yacc.c:1646 */ break; case 1640: #line 12396 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ExclusiveLock; } #line 45936 "gram.c" /* yacc.c:1646 */ break; case 1641: #line 12397 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 45942 "gram.c" /* yacc.c:1646 */ break; case 1642: #line 12400 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45948 "gram.c" /* yacc.c:1646 */ break; case 1643: #line 12401 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45954 "gram.c" /* yacc.c:1646 */ break; case 1644: #line 12405 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitError; } #line 45960 "gram.c" /* yacc.c:1646 */ break; case 1645: #line 12406 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitSkip; } #line 45966 "gram.c" /* yacc.c:1646 */ break; case 1646: #line 12407 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitBlock; } #line 45972 "gram.c" /* yacc.c:1646 */ break; case 1647: #line 12423 "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 45988 "gram.c" /* yacc.c:1646 */ break; case 1648: #line 12436 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45994 "gram.c" /* yacc.c:1646 */ break; case 1649: #line 12437 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 46000 "gram.c" /* yacc.c:1646 */ break; case 1650: #line 12442 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 46009 "gram.c" /* yacc.c:1646 */ break; case 1651: #line 12447 "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 46034 "gram.c" /* yacc.c:1646 */ break; case 1652: #line 12471 "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 46046 "gram.c" /* yacc.c:1646 */ break; case 1653: #line 12481 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 46052 "gram.c" /* yacc.c:1646 */ break; case 1654: #line 12482 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 46058 "gram.c" /* yacc.c:1646 */ break; case 1655: #line 12499 "gram.y" /* yacc.c:1646 */ { MergeStmt *m = makeNode(MergeStmt); m->withClause = (yyvsp[-9].with); m->relation = (yyvsp[-6].range); m->sourceRelation = (yyvsp[-4].node); m->joinCondition = (yyvsp[-2].node); m->mergeWhenClauses = (yyvsp[-1].list); m->returningList = (yyvsp[0].list); (yyval.node) = (Node *) m; } #line 46075 "gram.c" /* yacc.c:1646 */ break; case 1656: #line 12514 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 46081 "gram.c" /* yacc.c:1646 */ break; case 1657: #line 12515 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list),(yyvsp[0].node)); } #line 46087 "gram.c" /* yacc.c:1646 */ break; case 1658: #line 12526 "gram.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 46098 "gram.c" /* yacc.c:1646 */ break; case 1659: #line 12533 "gram.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 46109 "gram.c" /* yacc.c:1646 */ break; case 1660: #line 12540 "gram.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 46120 "gram.c" /* yacc.c:1646 */ break; case 1661: #line 12547 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 46134 "gram.c" /* yacc.c:1646 */ break; case 1662: #line 12557 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 46148 "gram.c" /* yacc.c:1646 */ break; case 1663: #line 12569 "gram.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_MATCHED; } #line 46154 "gram.c" /* yacc.c:1646 */ break; case 1664: #line 12570 "gram.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_SOURCE; } #line 46160 "gram.c" /* yacc.c:1646 */ break; case 1665: #line 12574 "gram.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 46166 "gram.c" /* yacc.c:1646 */ break; case 1666: #line 12575 "gram.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 46172 "gram.c" /* yacc.c:1646 */ break; case 1667: #line 12579 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46178 "gram.c" /* yacc.c:1646 */ break; case 1668: #line 12580 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46184 "gram.c" /* yacc.c:1646 */ break; case 1669: #line 12585 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_UPDATE; n->override = OVERRIDING_NOT_SET; n->targetList = (yyvsp[0].list); n->values = NIL; (yyval.mergewhen) = n; } #line 46198 "gram.c" /* yacc.c:1646 */ break; case 1670: #line 12598 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_DELETE; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 46212 "gram.c" /* yacc.c:1646 */ break; case 1671: #line 12611 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46225 "gram.c" /* yacc.c:1646 */ break; case 1672: #line 12620 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = (yyvsp[-2].ival); n->targetList = NIL; n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46238 "gram.c" /* yacc.c:1646 */ break; case 1673: #line 12629 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = (yyvsp[-2].list); n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46251 "gram.c" /* yacc.c:1646 */ break; case 1674: #line 12638 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = (yyvsp[-2].ival); n->targetList = (yyvsp[-5].list); n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46264 "gram.c" /* yacc.c:1646 */ break; case 1675: #line 12647 "gram.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 46277 "gram.c" /* yacc.c:1646 */ break; case 1676: #line 12659 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 46285 "gram.c" /* yacc.c:1646 */ break; case 1677: #line 12671 "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 46299 "gram.c" /* yacc.c:1646 */ break; case 1678: #line 12682 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46305 "gram.c" /* yacc.c:1646 */ break; case 1679: #line 12685 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46311 "gram.c" /* yacc.c:1646 */ break; case 1680: #line 12686 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 46317 "gram.c" /* yacc.c:1646 */ break; case 1681: #line 12687 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 46323 "gram.c" /* yacc.c:1646 */ break; case 1682: #line 12688 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 46329 "gram.c" /* yacc.c:1646 */ break; case 1683: #line 12689 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_ASENSITIVE; } #line 46335 "gram.c" /* yacc.c:1646 */ break; case 1684: #line 12690 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 46341 "gram.c" /* yacc.c:1646 */ break; case 1685: #line 12693 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46347 "gram.c" /* yacc.c:1646 */ break; case 1686: #line 12694 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CURSOR_OPT_HOLD; } #line 46353 "gram.c" /* yacc.c:1646 */ break; case 1687: #line 12695 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46359 "gram.c" /* yacc.c:1646 */ break; case 1690: #line 12748 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 46365 "gram.c" /* yacc.c:1646 */ break; case 1691: #line 12749 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 46371 "gram.c" /* yacc.c:1646 */ break; case 1692: #line 12764 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46377 "gram.c" /* yacc.c:1646 */ break; case 1693: #line 12766 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 46388 "gram.c" /* yacc.c:1646 */ break; case 1694: #line 12773 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46400 "gram.c" /* yacc.c:1646 */ break; case 1695: #line 12781 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46412 "gram.c" /* yacc.c:1646 */ break; case 1696: #line 12789 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 46424 "gram.c" /* yacc.c:1646 */ break; case 1697: #line 12797 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, (yyvsp[-2].with), yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 46436 "gram.c" /* yacc.c:1646 */ break; case 1698: #line 12805 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46448 "gram.c" /* yacc.c:1646 */ break; case 1699: #line 12813 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46460 "gram.c" /* yacc.c:1646 */ break; case 1700: #line 12823 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46466 "gram.c" /* yacc.c:1646 */ break; case 1701: #line 12824 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46472 "gram.c" /* yacc.c:1646 */ break; case 1702: #line 12859 "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].groupclause))->list; n->groupDistinct = ((yyvsp[-2].groupclause))->distinct; n->havingClause = (yyvsp[-1].node); n->windowClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46490 "gram.c" /* yacc.c:1646 */ break; case 1703: #line 12875 "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].groupclause))->list; n->groupDistinct = ((yyvsp[-2].groupclause))->distinct; n->havingClause = (yyvsp[-1].node); n->windowClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46509 "gram.c" /* yacc.c:1646 */ break; case 1704: #line 12889 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46515 "gram.c" /* yacc.c:1646 */ break; case 1705: #line 12891 "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 46538 "gram.c" /* yacc.c:1646 */ break; case 1706: #line 12910 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46546 "gram.c" /* yacc.c:1646 */ break; case 1707: #line 12914 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46554 "gram.c" /* yacc.c:1646 */ break; case 1708: #line 12918 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46562 "gram.c" /* yacc.c:1646 */ break; case 1709: #line 12933 "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 46573 "gram.c" /* yacc.c:1646 */ break; case 1710: #line 12940 "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 46584 "gram.c" /* yacc.c:1646 */ break; case 1711: #line 12947 "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 46595 "gram.c" /* yacc.c:1646 */ break; case 1712: #line 12956 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 46601 "gram.c" /* yacc.c:1646 */ break; case 1713: #line 12957 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 46607 "gram.c" /* yacc.c:1646 */ break; case 1714: #line 12961 "gram.y" /* yacc.c:1646 */ { CommonTableExpr *n = makeNode(CommonTableExpr); n->ctename = (yyvsp[-8].str); n->aliascolnames = (yyvsp[-7].list); n->ctematerialized = (yyvsp[-5].ival); n->ctequery = (yyvsp[-3].node); n->search_clause = castNode(CTESearchClause, (yyvsp[-1].node)); n->cycle_clause = castNode(CTECycleClause, (yyvsp[0].node)); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 46624 "gram.c" /* yacc.c:1646 */ break; case 1715: #line 12976 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeAlways; } #line 46630 "gram.c" /* yacc.c:1646 */ break; case 1716: #line 12977 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeNever; } #line 46636 "gram.c" /* yacc.c:1646 */ break; case 1717: #line 12978 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeDefault; } #line 46642 "gram.c" /* yacc.c:1646 */ break; case 1718: #line 12983 "gram.y" /* yacc.c:1646 */ { CTESearchClause *n = makeNode(CTESearchClause); n->search_col_list = (yyvsp[-2].list); n->search_breadth_first = false; n->search_seq_column = (yyvsp[0].str); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 46656 "gram.c" /* yacc.c:1646 */ break; case 1719: #line 12993 "gram.y" /* yacc.c:1646 */ { CTESearchClause *n = makeNode(CTESearchClause); n->search_col_list = (yyvsp[-2].list); n->search_breadth_first = true; n->search_seq_column = (yyvsp[0].str); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 46670 "gram.c" /* yacc.c:1646 */ break; case 1720: #line 13003 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46678 "gram.c" /* yacc.c:1646 */ break; case 1721: #line 13010 "gram.y" /* yacc.c:1646 */ { CTECycleClause *n = makeNode(CTECycleClause); n->cycle_col_list = (yyvsp[-8].list); n->cycle_mark_column = (yyvsp[-6].str); n->cycle_mark_value = (yyvsp[-4].node); n->cycle_mark_default = (yyvsp[-2].node); n->cycle_path_column = (yyvsp[0].str); n->location = (yylsp[-9]); (yyval.node) = (Node *) n; } #line 46694 "gram.c" /* yacc.c:1646 */ break; case 1722: #line 13022 "gram.y" /* yacc.c:1646 */ { CTECycleClause *n = makeNode(CTECycleClause); n->cycle_col_list = (yyvsp[-4].list); n->cycle_mark_column = (yyvsp[-2].str); n->cycle_mark_value = makeBoolAConst(true, -1); n->cycle_mark_default = makeBoolAConst(false, -1); n->cycle_path_column = (yyvsp[0].str); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 46710 "gram.c" /* yacc.c:1646 */ break; case 1723: #line 13034 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46718 "gram.c" /* yacc.c:1646 */ break; case 1724: #line 13040 "gram.y" /* yacc.c:1646 */ { (yyval.with) = (yyvsp[0].with); } #line 46724 "gram.c" /* yacc.c:1646 */ break; case 1725: #line 13041 "gram.y" /* yacc.c:1646 */ { (yyval.with) = NULL; } #line 46730 "gram.c" /* yacc.c:1646 */ break; case 1726: #line 13046 "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 46745 "gram.c" /* yacc.c:1646 */ break; case 1727: #line 13057 "gram.y" /* yacc.c:1646 */ { (yyval.into) = NULL; } #line 46751 "gram.c" /* yacc.c:1646 */ break; case 1728: #line 13066 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46760 "gram.c" /* yacc.c:1646 */ break; case 1729: #line 13071 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46769 "gram.c" /* yacc.c:1646 */ break; case 1730: #line 13076 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46778 "gram.c" /* yacc.c:1646 */ break; case 1731: #line 13081 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46787 "gram.c" /* yacc.c:1646 */ break; case 1732: #line 13086 "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 46799 "gram.c" /* yacc.c:1646 */ break; case 1733: #line 13094 "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 46811 "gram.c" /* yacc.c:1646 */ break; case 1734: #line 13102 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 46820 "gram.c" /* yacc.c:1646 */ break; case 1735: #line 13107 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 46829 "gram.c" /* yacc.c:1646 */ break; case 1736: #line 13112 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 46838 "gram.c" /* yacc.c:1646 */ break; case 1739: #line 13123 "gram.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_ALL; } #line 46844 "gram.c" /* yacc.c:1646 */ break; case 1740: #line 13124 "gram.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_DISTINCT; } #line 46850 "gram.c" /* yacc.c:1646 */ break; case 1741: #line 13125 "gram.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_DEFAULT; } #line 46856 "gram.c" /* yacc.c:1646 */ break; case 1742: #line 13132 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(NIL); } #line 46862 "gram.c" /* yacc.c:1646 */ break; case 1743: #line 13133 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 46868 "gram.c" /* yacc.c:1646 */ break; case 1746: #line 13142 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46874 "gram.c" /* yacc.c:1646 */ break; case 1747: #line 13143 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 46880 "gram.c" /* yacc.c:1646 */ break; case 1748: #line 13147 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46886 "gram.c" /* yacc.c:1646 */ break; case 1749: #line 13148 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 46892 "gram.c" /* yacc.c:1646 */ break; case 1750: #line 13152 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46898 "gram.c" /* yacc.c:1646 */ break; case 1751: #line 13156 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 46904 "gram.c" /* yacc.c:1646 */ break; case 1752: #line 13157 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 46910 "gram.c" /* yacc.c:1646 */ break; case 1753: #line 13161 "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 46923 "gram.c" /* yacc.c:1646 */ break; case 1754: #line 13170 "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 46936 "gram.c" /* yacc.c:1646 */ break; case 1755: #line 13183 "gram.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[-1].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[0].node); } #line 46945 "gram.c" /* yacc.c:1646 */ break; case 1756: #line 13188 "gram.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[-1].node); } #line 46954 "gram.c" /* yacc.c:1646 */ break; case 1757: #line 13193 "gram.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 46962 "gram.c" /* yacc.c:1646 */ break; case 1758: #line 13197 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = (yyvsp[0].node); n->limitCount = NULL; n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 46975 "gram.c" /* yacc.c:1646 */ break; case 1759: #line 13208 "gram.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 46981 "gram.c" /* yacc.c:1646 */ break; case 1760: #line 13209 "gram.y" /* yacc.c:1646 */ { (yyval.selectlimit) = NULL; } #line 46987 "gram.c" /* yacc.c:1646 */ break; case 1761: #line 13214 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[0].node); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 47000 "gram.c" /* yacc.c:1646 */ break; case 1762: #line 13223 "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 47013 "gram.c" /* yacc.c:1646 */ break; case 1763: #line 13239 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-2].node); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 47026 "gram.c" /* yacc.c:1646 */ break; case 1764: #line 13248 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-3].node); n->limitOption = LIMIT_OPTION_WITH_TIES; (yyval.selectlimit) = n; } #line 47039 "gram.c" /* yacc.c:1646 */ break; case 1765: #line 13257 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 47052 "gram.c" /* yacc.c:1646 */ break; case 1766: #line 13266 "gram.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_WITH_TIES; (yyval.selectlimit) = n; } #line 47065 "gram.c" /* yacc.c:1646 */ break; case 1767: #line 13278 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47071 "gram.c" /* yacc.c:1646 */ break; case 1768: #line 13281 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 47077 "gram.c" /* yacc.c:1646 */ break; case 1769: #line 13285 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47083 "gram.c" /* yacc.c:1646 */ break; case 1770: #line 13287 "gram.y" /* yacc.c:1646 */ { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 47092 "gram.c" /* yacc.c:1646 */ break; case 1771: #line 13294 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47098 "gram.c" /* yacc.c:1646 */ break; case 1772: #line 13314 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47104 "gram.c" /* yacc.c:1646 */ break; case 1773: #line 13316 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 47110 "gram.c" /* yacc.c:1646 */ break; case 1774: #line 13318 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 47116 "gram.c" /* yacc.c:1646 */ break; case 1775: #line 13322 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 47122 "gram.c" /* yacc.c:1646 */ break; case 1776: #line 13323 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 47128 "gram.c" /* yacc.c:1646 */ break; case 1777: #line 13327 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 47134 "gram.c" /* yacc.c:1646 */ break; case 1778: #line 13328 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 47140 "gram.c" /* yacc.c:1646 */ break; case 1779: #line 13331 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 47146 "gram.c" /* yacc.c:1646 */ break; case 1780: #line 13332 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 47152 "gram.c" /* yacc.c:1646 */ break; case 1781: #line 13358 "gram.y" /* yacc.c:1646 */ { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = (yyvsp[-1].setquantifier) == SET_QUANTIFIER_DISTINCT; n->list = (yyvsp[0].list); (yyval.groupclause) = n; } #line 47164 "gram.c" /* yacc.c:1646 */ break; case 1782: #line 13366 "gram.y" /* yacc.c:1646 */ { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = false; n->list = NIL; (yyval.groupclause) = n; } #line 47176 "gram.c" /* yacc.c:1646 */ break; case 1783: #line 13376 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47182 "gram.c" /* yacc.c:1646 */ break; case 1784: #line 13377 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 47188 "gram.c" /* yacc.c:1646 */ break; case 1785: #line 13381 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47194 "gram.c" /* yacc.c:1646 */ break; case 1786: #line 13382 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47200 "gram.c" /* yacc.c:1646 */ break; case 1787: #line 13383 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47206 "gram.c" /* yacc.c:1646 */ break; case 1788: #line 13384 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47212 "gram.c" /* yacc.c:1646 */ break; case 1789: #line 13385 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47218 "gram.c" /* yacc.c:1646 */ break; case 1790: #line 13390 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 47226 "gram.c" /* yacc.c:1646 */ break; case 1791: #line 13403 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 47234 "gram.c" /* yacc.c:1646 */ break; case 1792: #line 13410 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 47242 "gram.c" /* yacc.c:1646 */ break; case 1793: #line 13417 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 47250 "gram.c" /* yacc.c:1646 */ break; case 1794: #line 13423 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47256 "gram.c" /* yacc.c:1646 */ break; case 1795: #line 13424 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47262 "gram.c" /* yacc.c:1646 */ break; case 1796: #line 13428 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47268 "gram.c" /* yacc.c:1646 */ break; case 1797: #line 13429 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47274 "gram.c" /* yacc.c:1646 */ break; case 1798: #line 13433 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47280 "gram.c" /* yacc.c:1646 */ break; case 1799: #line 13434 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47286 "gram.c" /* yacc.c:1646 */ break; case 1800: #line 13438 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47292 "gram.c" /* yacc.c:1646 */ break; case 1801: #line 13439 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 47298 "gram.c" /* yacc.c:1646 */ break; case 1802: #line 13444 "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 47311 "gram.c" /* yacc.c:1646 */ break; case 1803: #line 13455 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORUPDATE; } #line 47317 "gram.c" /* yacc.c:1646 */ break; case 1804: #line 13456 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 47323 "gram.c" /* yacc.c:1646 */ break; case 1805: #line 13457 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORSHARE; } #line 47329 "gram.c" /* yacc.c:1646 */ break; case 1806: #line 13458 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORKEYSHARE; } #line 47335 "gram.c" /* yacc.c:1646 */ break; case 1807: #line 13462 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47341 "gram.c" /* yacc.c:1646 */ break; case 1808: #line 13463 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47347 "gram.c" /* yacc.c:1646 */ break; case 1809: #line 13474 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 47358 "gram.c" /* yacc.c:1646 */ break; case 1810: #line 13481 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = (SelectStmt *) (yyvsp[-4].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 47369 "gram.c" /* yacc.c:1646 */ break; case 1811: #line 13499 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47375 "gram.c" /* yacc.c:1646 */ break; case 1812: #line 13500 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47381 "gram.c" /* yacc.c:1646 */ break; case 1813: #line 13504 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47387 "gram.c" /* yacc.c:1646 */ break; case 1814: #line 13505 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47393 "gram.c" /* yacc.c:1646 */ break; case 1815: #line 13512 "gram.y" /* yacc.c:1646 */ { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 47402 "gram.c" /* yacc.c:1646 */ break; case 1816: #line 13517 "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 47415 "gram.c" /* yacc.c:1646 */ break; case 1817: #line 13526 "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 47427 "gram.c" /* yacc.c:1646 */ break; case 1818: #line 13534 "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 47440 "gram.c" /* yacc.c:1646 */ break; case 1819: #line 13543 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47451 "gram.c" /* yacc.c:1646 */ break; case 1820: #line 13550 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->lateral = true; n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47463 "gram.c" /* yacc.c:1646 */ break; case 1821: #line 13558 "gram.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = false; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47476 "gram.c" /* yacc.c:1646 */ break; case 1822: #line 13567 "gram.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47489 "gram.c" /* yacc.c:1646 */ break; case 1823: #line 13576 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 47497 "gram.c" /* yacc.c:1646 */ break; case 1824: #line 13580 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 47506 "gram.c" /* yacc.c:1646 */ break; case 1825: #line 13585 "gram.y" /* yacc.c:1646 */ { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); (yyval.node) = (Node *) jt; } #line 47517 "gram.c" /* yacc.c:1646 */ break; case 1826: #line 13592 "gram.y" /* yacc.c:1646 */ { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); jt->lateral = true; (yyval.node) = (Node *) jt; } #line 47529 "gram.c" /* yacc.c:1646 */ break; case 1827: #line 13621 "gram.y" /* yacc.c:1646 */ { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 47537 "gram.c" /* yacc.c:1646 */ break; case 1828: #line 13625 "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->join_using_alias = NULL; n->quals = NULL; (yyval.jexpr) = n; } #line 47555 "gram.c" /* yacc.c:1646 */ break; case 1829: #line 13639 "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)) { /* USING clause */ n->usingClause = linitial_node(List, castNode(List, (yyvsp[0].node))); n->join_using_alias = lsecond_node(Alias, castNode(List, (yyvsp[0].node))); } else { /* ON clause */ n->quals = (yyvsp[0].node); } (yyval.jexpr) = n; } #line 47580 "gram.c" /* yacc.c:1646 */ break; case 1830: #line 13660 "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)) { /* USING clause */ n->usingClause = linitial_node(List, castNode(List, (yyvsp[0].node))); n->join_using_alias = lsecond_node(Alias, castNode(List, (yyvsp[0].node))); } else { /* ON clause */ n->quals = (yyvsp[0].node); } (yyval.jexpr) = n; } #line 47606 "gram.c" /* yacc.c:1646 */ break; case 1831: #line 13682 "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->join_using_alias = NULL; n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 47623 "gram.c" /* yacc.c:1646 */ break; case 1832: #line 13695 "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->join_using_alias = NULL; n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 47641 "gram.c" /* yacc.c:1646 */ break; case 1833: #line 13712 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 47651 "gram.c" /* yacc.c:1646 */ break; case 1834: #line 13718 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 47660 "gram.c" /* yacc.c:1646 */ break; case 1835: #line 13723 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 47670 "gram.c" /* yacc.c:1646 */ break; case 1836: #line 13729 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 47679 "gram.c" /* yacc.c:1646 */ break; case 1837: #line 13735 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = (yyvsp[0].alias); } #line 47685 "gram.c" /* yacc.c:1646 */ break; case 1838: #line 13736 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 47691 "gram.c" /* yacc.c:1646 */ break; case 1839: #line 13747 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); /* the column name list will be inserted later */ } #line 47701 "gram.c" /* yacc.c:1646 */ break; case 1840: #line 13752 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 47707 "gram.c" /* yacc.c:1646 */ break; case 1841: #line 13761 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 47715 "gram.c" /* yacc.c:1646 */ break; case 1842: #line 13765 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 47723 "gram.c" /* yacc.c:1646 */ break; case 1843: #line 13769 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 47734 "gram.c" /* yacc.c:1646 */ break; case 1844: #line 13776 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 47745 "gram.c" /* yacc.c:1646 */ break; case 1845: #line 13783 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NIL); } #line 47753 "gram.c" /* yacc.c:1646 */ break; case 1846: #line 13788 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_FULL; } #line 47759 "gram.c" /* yacc.c:1646 */ break; case 1847: #line 13789 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_LEFT; } #line 47765 "gram.c" /* yacc.c:1646 */ break; case 1848: #line 13790 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_RIGHT; } #line 47771 "gram.c" /* yacc.c:1646 */ break; case 1849: #line 13791 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_INNER; } #line 47777 "gram.c" /* yacc.c:1646 */ break; case 1852: #line 13812 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) list_make2((yyvsp[-2].list), (yyvsp[0].alias)); } #line 47785 "gram.c" /* yacc.c:1646 */ break; case 1853: #line 13816 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47793 "gram.c" /* yacc.c:1646 */ break; case 1854: #line 13824 "gram.y" /* yacc.c:1646 */ { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 47804 "gram.c" /* yacc.c:1646 */ break; case 1855: #line 13831 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 47812 "gram.c" /* yacc.c:1646 */ break; case 1856: #line 13838 "gram.y" /* yacc.c:1646 */ { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 47823 "gram.c" /* yacc.c:1646 */ break; case 1857: #line 13845 "gram.y" /* yacc.c:1646 */ { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 47834 "gram.c" /* yacc.c:1646 */ break; case 1858: #line 13852 "gram.y" /* yacc.c:1646 */ { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 47845 "gram.c" /* yacc.c:1646 */ break; case 1859: #line 13862 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 47851 "gram.c" /* yacc.c:1646 */ break; case 1860: #line 13863 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 47857 "gram.c" /* yacc.c:1646 */ break; case 1861: #line 13877 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 47865 "gram.c" /* yacc.c:1646 */ break; case 1862: #line 13881 "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 47877 "gram.c" /* yacc.c:1646 */ break; case 1863: #line 13889 "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 47889 "gram.c" /* yacc.c:1646 */ break; case 1864: #line 13903 "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 47904 "gram.c" /* yacc.c:1646 */ break; case 1865: #line 13916 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 47910 "gram.c" /* yacc.c:1646 */ break; case 1866: #line 13917 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47916 "gram.c" /* yacc.c:1646 */ break; case 1867: #line 13933 "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 47931 "gram.c" /* yacc.c:1646 */ break; case 1868: #line 13944 "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 47946 "gram.c" /* yacc.c:1646 */ break; case 1869: #line 13957 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 47952 "gram.c" /* yacc.c:1646 */ break; case 1870: #line 13961 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 47958 "gram.c" /* yacc.c:1646 */ break; case 1871: #line 13962 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 47964 "gram.c" /* yacc.c:1646 */ break; case 1872: #line 13965 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 47970 "gram.c" /* yacc.c:1646 */ break; case 1873: #line 13966 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47976 "gram.c" /* yacc.c:1646 */ break; case 1874: #line 13969 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 47982 "gram.c" /* yacc.c:1646 */ break; case 1875: #line 13970 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 47988 "gram.c" /* yacc.c:1646 */ break; case 1876: #line 13975 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47994 "gram.c" /* yacc.c:1646 */ break; case 1877: #line 13976 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 48000 "gram.c" /* yacc.c:1646 */ break; case 1878: #line 13981 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 48006 "gram.c" /* yacc.c:1646 */ break; case 1879: #line 13983 "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 48019 "gram.c" /* yacc.c:1646 */ break; case 1880: #line 13991 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 48025 "gram.c" /* yacc.c:1646 */ break; case 1881: #line 13996 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 48031 "gram.c" /* yacc.c:1646 */ break; case 1882: #line 13997 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48037 "gram.c" /* yacc.c:1646 */ break; case 1883: #line 14002 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48045 "gram.c" /* yacc.c:1646 */ break; case 1884: #line 14006 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48053 "gram.c" /* yacc.c:1646 */ break; case 1885: #line 14012 "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 48076 "gram.c" /* yacc.c:1646 */ break; case 1886: #line 14037 "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 48091 "gram.c" /* yacc.c:1646 */ break; case 1887: #line 14049 "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 48106 "gram.c" /* yacc.c:1646 */ break; case 1888: #line 14061 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48112 "gram.c" /* yacc.c:1646 */ break; case 1889: #line 14062 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48118 "gram.c" /* yacc.c:1646 */ break; case 1890: #line 14067 "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 48136 "gram.c" /* yacc.c:1646 */ break; case 1891: #line 14081 "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 = boolVal(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 48197 "gram.c" /* yacc.c:1646 */ break; case 1892: #line 14138 "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 48212 "gram.c" /* yacc.c:1646 */ break; case 1893: #line 14152 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 48218 "gram.c" /* yacc.c:1646 */ break; case 1894: #line 14154 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 48224 "gram.c" /* yacc.c:1646 */ break; case 1895: #line 14159 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 48230 "gram.c" /* yacc.c:1646 */ break; case 1896: #line 14161 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 48236 "gram.c" /* yacc.c:1646 */ break; case 1897: #line 14163 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeBoolean(true), (yylsp[-1])); } #line 48242 "gram.c" /* yacc.c:1646 */ break; case 1898: #line 14165 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeBoolean(false), (yylsp[0])); } #line 48248 "gram.c" /* yacc.c:1646 */ break; case 1899: #line 14167 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("path", (yyvsp[0].node), (yylsp[-1])); } #line 48254 "gram.c" /* yacc.c:1646 */ break; case 1900: #line 14172 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 48260 "gram.c" /* yacc.c:1646 */ break; case 1901: #line 14174 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 48266 "gram.c" /* yacc.c:1646 */ break; case 1902: #line 14179 "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 48278 "gram.c" /* yacc.c:1646 */ break; case 1903: #line 14187 "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 48290 "gram.c" /* yacc.c:1646 */ break; case 1904: #line 14203 "gram.y" /* yacc.c:1646 */ { JsonTable *n = makeNode(JsonTable); char *pathstring; n->context_item = (JsonValueExpr *) (yyvsp[-10].node); if (!IsA((yyvsp[-8].node), A_Const) || castNode(A_Const, (yyvsp[-8].node))->val.node.type != T_String) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("only string constants are supported in JSON_TABLE path specification"), parser_errposition((yylsp[-8])))); pathstring = castNode(A_Const, (yyvsp[-8].node))->val.sval.sval; n->pathspec = makeJsonTablePathSpec(pathstring, (yyvsp[-7].str), (yylsp[-8]), (yylsp[-7])); n->passing = (yyvsp[-6].list); n->columns = (yyvsp[-3].list); n->on_error = (JsonBehavior *) (yyvsp[-1].node); n->location = (yylsp[-12]); (yyval.node) = (Node *) n; } #line 48314 "gram.c" /* yacc.c:1646 */ break; case 1905: #line 14225 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 48320 "gram.c" /* yacc.c:1646 */ break; case 1906: #line 14226 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 48326 "gram.c" /* yacc.c:1646 */ break; case 1907: #line 14231 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48332 "gram.c" /* yacc.c:1646 */ break; case 1908: #line 14233 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48338 "gram.c" /* yacc.c:1646 */ break; case 1909: #line 14238 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FOR_ORDINALITY; n->name = (yyvsp[-2].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 48351 "gram.c" /* yacc.c:1646 */ break; case 1910: #line 14251 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_REGULAR; n->name = (yyvsp[-5].str); n->typeName = (yyvsp[-4].typnam); n->format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); n->pathspec = (JsonTablePathSpec *) (yyvsp[-3].node); n->wrapper = (yyvsp[-2].ival); n->quotes = (yyvsp[-1].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[0].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[0].list)); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 48371 "gram.c" /* yacc.c:1646 */ break; case 1911: #line 14271 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FORMATTED; n->name = (yyvsp[-6].str); n->typeName = (yyvsp[-5].typnam); n->format = (JsonFormat *) (yyvsp[-4].node); n->pathspec = (JsonTablePathSpec *) (yyvsp[-3].node); n->wrapper = (yyvsp[-2].ival); n->quotes = (yyvsp[-1].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[0].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[0].list)); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 48391 "gram.c" /* yacc.c:1646 */ break; case 1912: #line 14289 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_EXISTS; n->name = (yyvsp[-4].str); n->typeName = (yyvsp[-3].typnam); n->format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); n->wrapper = JSW_NONE; n->quotes = JS_QUOTES_UNSPEC; n->pathspec = (JsonTablePathSpec *) (yyvsp[-1].node); n->on_empty = NULL; n->on_error = (JsonBehavior *) (yyvsp[0].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 48411 "gram.c" /* yacc.c:1646 */ break; case 1913: #line 14306 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_NESTED; n->pathspec = (JsonTablePathSpec *) makeJsonTablePathSpec((yyvsp[-4].str), NULL, (yylsp[-4]), -1); n->columns = (yyvsp[-1].list); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 48426 "gram.c" /* yacc.c:1646 */ break; case 1914: #line 14318 "gram.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_NESTED; n->pathspec = (JsonTablePathSpec *) makeJsonTablePathSpec((yyvsp[-6].str), (yyvsp[-4].str), (yylsp[-6]), (yylsp[-4])); n->columns = (yyvsp[-1].list); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 48441 "gram.c" /* yacc.c:1646 */ break; case 1917: #line 14337 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonTablePathSpec((yyvsp[0].str), NULL, (yylsp[0]), -1); } #line 48447 "gram.c" /* yacc.c:1646 */ break; case 1918: #line 14339 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 48453 "gram.c" /* yacc.c:1646 */ break; case 1919: #line 14353 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 48462 "gram.c" /* yacc.c:1646 */ break; case 1920: #line 14358 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 48472 "gram.c" /* yacc.c:1646 */ break; case 1921: #line 14365 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 48481 "gram.c" /* yacc.c:1646 */ break; case 1922: #line 14370 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; } #line 48491 "gram.c" /* yacc.c:1646 */ break; case 1923: #line 14376 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 48500 "gram.c" /* yacc.c:1646 */ break; case 1924: #line 14381 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 48510 "gram.c" /* yacc.c:1646 */ break; case 1925: #line 14390 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 48516 "gram.c" /* yacc.c:1646 */ break; case 1926: #line 14392 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 48522 "gram.c" /* yacc.c:1646 */ break; case 1927: #line 14394 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48528 "gram.c" /* yacc.c:1646 */ break; case 1928: #line 14398 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48534 "gram.c" /* yacc.c:1646 */ break; case 1929: #line 14399 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48540 "gram.c" /* yacc.c:1646 */ break; case 1930: #line 14400 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48546 "gram.c" /* yacc.c:1646 */ break; case 1931: #line 14401 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48552 "gram.c" /* yacc.c:1646 */ break; case 1932: #line 14402 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48558 "gram.c" /* yacc.c:1646 */ break; case 1933: #line 14404 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 48567 "gram.c" /* yacc.c:1646 */ break; case 1934: #line 14409 "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 48577 "gram.c" /* yacc.c:1646 */ break; case 1935: #line 14414 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48583 "gram.c" /* yacc.c:1646 */ break; case 1936: #line 14429 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48589 "gram.c" /* yacc.c:1646 */ break; case 1937: #line 14430 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48595 "gram.c" /* yacc.c:1646 */ break; case 1938: #line 14431 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48601 "gram.c" /* yacc.c:1646 */ break; case 1939: #line 14432 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48607 "gram.c" /* yacc.c:1646 */ break; case 1940: #line 14433 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48613 "gram.c" /* yacc.c:1646 */ break; case 1941: #line 14445 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48623 "gram.c" /* yacc.c:1646 */ break; case 1942: #line 14451 "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 48633 "gram.c" /* yacc.c:1646 */ break; case 1943: #line 14458 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 48639 "gram.c" /* yacc.c:1646 */ break; case 1944: #line 14459 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48645 "gram.c" /* yacc.c:1646 */ break; case 1945: #line 14466 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 48654 "gram.c" /* yacc.c:1646 */ break; case 1946: #line 14471 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 48663 "gram.c" /* yacc.c:1646 */ break; case 1947: #line 14476 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 48672 "gram.c" /* yacc.c:1646 */ break; case 1948: #line 14481 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 48681 "gram.c" /* yacc.c:1646 */ break; case 1949: #line 14486 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 48690 "gram.c" /* yacc.c:1646 */ break; case 1950: #line 14491 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 48699 "gram.c" /* yacc.c:1646 */ break; case 1951: #line 14496 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 48708 "gram.c" /* yacc.c:1646 */ break; case 1952: #line 14501 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48718 "gram.c" /* yacc.c:1646 */ break; case 1953: #line 14507 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48728 "gram.c" /* yacc.c:1646 */ break; case 1954: #line 14513 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48738 "gram.c" /* yacc.c:1646 */ break; case 1955: #line 14519 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 48747 "gram.c" /* yacc.c:1646 */ break; case 1956: #line 14526 "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 48772 "gram.c" /* yacc.c:1646 */ break; case 1957: #line 14547 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); } #line 48780 "gram.c" /* yacc.c:1646 */ break; case 1958: #line 14557 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48788 "gram.c" /* yacc.c:1646 */ break; case 1959: #line 14561 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48796 "gram.c" /* yacc.c:1646 */ break; case 1960: #line 14569 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48804 "gram.c" /* yacc.c:1646 */ break; case 1961: #line 14573 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 48813 "gram.c" /* yacc.c:1646 */ break; case 1962: #line 14581 "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 48826 "gram.c" /* yacc.c:1646 */ break; case 1963: #line 14593 "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 48844 "gram.c" /* yacc.c:1646 */ break; case 1964: #line 14614 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48852 "gram.c" /* yacc.c:1646 */ break; case 1965: #line 14618 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48860 "gram.c" /* yacc.c:1646 */ break; case 1966: #line 14624 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48868 "gram.c" /* yacc.c:1646 */ break; case 1967: #line 14628 "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 48883 "gram.c" /* yacc.c:1646 */ break; case 1968: #line 14641 "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 48893 "gram.c" /* yacc.c:1646 */ break; case 1969: #line 14649 "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 48905 "gram.c" /* yacc.c:1646 */ break; case 1970: #line 14659 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48911 "gram.c" /* yacc.c:1646 */ break; case 1971: #line 14661 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48917 "gram.c" /* yacc.c:1646 */ break; case 1972: #line 14663 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "varchar"; } #line 48923 "gram.c" /* yacc.c:1646 */ break; case 1973: #line 14665 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48929 "gram.c" /* yacc.c:1646 */ break; case 1974: #line 14667 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48935 "gram.c" /* yacc.c:1646 */ break; case 1975: #line 14669 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48941 "gram.c" /* yacc.c:1646 */ break; case 1976: #line 14673 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 48947 "gram.c" /* yacc.c:1646 */ break; case 1977: #line 14674 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 48953 "gram.c" /* yacc.c:1646 */ break; case 1978: #line 14682 "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 48966 "gram.c" /* yacc.c:1646 */ break; case 1979: #line 14691 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 48978 "gram.c" /* yacc.c:1646 */ break; case 1980: #line 14699 "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 48991 "gram.c" /* yacc.c:1646 */ break; case 1981: #line 14708 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 49003 "gram.c" /* yacc.c:1646 */ break; case 1982: #line 14719 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 49012 "gram.c" /* yacc.c:1646 */ break; case 1983: #line 14726 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 49018 "gram.c" /* yacc.c:1646 */ break; case 1984: #line 14727 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 49024 "gram.c" /* yacc.c:1646 */ break; case 1985: #line 14728 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 49030 "gram.c" /* yacc.c:1646 */ break; case 1986: #line 14733 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 49036 "gram.c" /* yacc.c:1646 */ break; case 1987: #line 14735 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 49042 "gram.c" /* yacc.c:1646 */ break; case 1988: #line 14737 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 49048 "gram.c" /* yacc.c:1646 */ break; case 1989: #line 14739 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 49054 "gram.c" /* yacc.c:1646 */ break; case 1990: #line 14741 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 49060 "gram.c" /* yacc.c:1646 */ break; case 1991: #line 14743 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 49066 "gram.c" /* yacc.c:1646 */ break; case 1992: #line 14745 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 49075 "gram.c" /* yacc.c:1646 */ break; case 1993: #line 14750 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 49084 "gram.c" /* yacc.c:1646 */ break; case 1994: #line 14755 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 49094 "gram.c" /* yacc.c:1646 */ break; case 1995: #line 14761 "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 49106 "gram.c" /* yacc.c:1646 */ break; case 1996: #line 14769 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 49115 "gram.c" /* yacc.c:1646 */ break; case 1997: #line 14774 "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 49126 "gram.c" /* yacc.c:1646 */ break; case 1998: #line 14781 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 49136 "gram.c" /* yacc.c:1646 */ break; case 1999: #line 14787 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 49142 "gram.c" /* yacc.c:1646 */ break; case 2000: #line 14792 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 49150 "gram.c" /* yacc.c:1646 */ break; case 2001: #line 14796 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 49159 "gram.c" /* yacc.c:1646 */ break; case 2002: #line 14804 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("json"); (yyval.typnam)->location = (yylsp[0]); } #line 49168 "gram.c" /* yacc.c:1646 */ break; case 2003: #line 14838 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49174 "gram.c" /* yacc.c:1646 */ break; case 2004: #line 14840 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 49180 "gram.c" /* yacc.c:1646 */ break; case 2005: #line 14842 "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 49193 "gram.c" /* yacc.c:1646 */ break; case 2006: #line 14851 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 49204 "gram.c" /* yacc.c:1646 */ break; case 2007: #line 14858 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, -1); } #line 49215 "gram.c" /* yacc.c:1646 */ break; case 2008: #line 14874 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49221 "gram.c" /* yacc.c:1646 */ break; case 2009: #line 14876 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 49227 "gram.c" /* yacc.c:1646 */ break; case 2010: #line 14878 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49233 "gram.c" /* yacc.c:1646 */ break; case 2011: #line 14880 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49239 "gram.c" /* yacc.c:1646 */ break; case 2012: #line 14882 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49245 "gram.c" /* yacc.c:1646 */ break; case 2013: #line 14884 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49251 "gram.c" /* yacc.c:1646 */ break; case 2014: #line 14886 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49257 "gram.c" /* yacc.c:1646 */ break; case 2015: #line 14888 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49263 "gram.c" /* yacc.c:1646 */ break; case 2016: #line 14890 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49269 "gram.c" /* yacc.c:1646 */ break; case 2017: #line 14892 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49275 "gram.c" /* yacc.c:1646 */ break; case 2018: #line 14894 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49281 "gram.c" /* yacc.c:1646 */ break; case 2019: #line 14896 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49287 "gram.c" /* yacc.c:1646 */ break; case 2020: #line 14898 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49293 "gram.c" /* yacc.c:1646 */ break; case 2021: #line 14900 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49299 "gram.c" /* yacc.c:1646 */ break; case 2022: #line 14903 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49305 "gram.c" /* yacc.c:1646 */ break; case 2023: #line 14905 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49311 "gram.c" /* yacc.c:1646 */ break; case 2024: #line 14908 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49317 "gram.c" /* yacc.c:1646 */ break; case 2025: #line 14910 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49323 "gram.c" /* yacc.c:1646 */ break; case 2026: #line 14912 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 49329 "gram.c" /* yacc.c:1646 */ break; case 2027: #line 14914 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 49335 "gram.c" /* yacc.c:1646 */ break; case 2028: #line 14917 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49344 "gram.c" /* yacc.c:1646 */ break; case 2029: #line 14922 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49357 "gram.c" /* yacc.c:1646 */ break; case 2030: #line 14931 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 49366 "gram.c" /* yacc.c:1646 */ break; case 2031: #line 14936 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49379 "gram.c" /* yacc.c:1646 */ break; case 2032: #line 14945 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49388 "gram.c" /* yacc.c:1646 */ break; case 2033: #line 14950 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49401 "gram.c" /* yacc.c:1646 */ break; case 2034: #line 14959 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 49410 "gram.c" /* yacc.c:1646 */ break; case 2035: #line 14964 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49423 "gram.c" /* yacc.c:1646 */ break; case 2036: #line 14974 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make1((yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-2])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "~", (yyvsp[-3].node), (Node *) n, (yylsp[-2])); } #line 49436 "gram.c" /* yacc.c:1646 */ break; case 2037: #line 14983 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49449 "gram.c" /* yacc.c:1646 */ break; case 2038: #line 14992 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make1((yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "!~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49462 "gram.c" /* yacc.c:1646 */ break; case 2039: #line 15001 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "!~", (yyvsp[-6].node), (Node *) n, (yylsp[-5])); } #line 49475 "gram.c" /* yacc.c:1646 */ break; case 2040: #line 15020 "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 49488 "gram.c" /* yacc.c:1646 */ break; case 2041: #line 15029 "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 49501 "gram.c" /* yacc.c:1646 */ break; case 2042: #line 15038 "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 49514 "gram.c" /* yacc.c:1646 */ break; case 2043: #line 15047 "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 49527 "gram.c" /* yacc.c:1646 */ break; case 2044: #line 15056 "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)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 49548 "gram.c" /* yacc.c:1646 */ break; case 2045: #line 15073 "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 49561 "gram.c" /* yacc.c:1646 */ break; case 2046: #line 15082 "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 49574 "gram.c" /* yacc.c:1646 */ break; case 2047: #line 15091 "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 49587 "gram.c" /* yacc.c:1646 */ break; case 2048: #line 15100 "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 49600 "gram.c" /* yacc.c:1646 */ break; case 2049: #line 15109 "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 49613 "gram.c" /* yacc.c:1646 */ break; case 2050: #line 15118 "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 49626 "gram.c" /* yacc.c:1646 */ break; case 2051: #line 15127 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 49634 "gram.c" /* yacc.c:1646 */ break; case 2052: #line 15131 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 49642 "gram.c" /* yacc.c:1646 */ break; case 2053: #line 15135 "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 49654 "gram.c" /* yacc.c:1646 */ break; case 2054: #line 15143 "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 49666 "gram.c" /* yacc.c:1646 */ break; case 2055: #line 15151 "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 49678 "gram.c" /* yacc.c:1646 */ break; case 2056: #line 15159 "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 49690 "gram.c" /* yacc.c:1646 */ break; case 2057: #line 15167 "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 49715 "gram.c" /* yacc.c:1646 */ break; case 2058: #line 15188 "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 49742 "gram.c" /* yacc.c:1646 */ break; case 2059: #line 15211 "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 49758 "gram.c" /* yacc.c:1646 */ break; case 2060: #line 15223 "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 49769 "gram.c" /* yacc.c:1646 */ break; case 2061: #line 15230 "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[-2])))); } #line 49789 "gram.c" /* yacc.c:1646 */ break; case 2062: #line 15246 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 49798 "gram.c" /* yacc.c:1646 */ break; case 2063: #line 15251 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 49808 "gram.c" /* yacc.c:1646 */ break; case 2064: #line 15257 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 49819 "gram.c" /* yacc.c:1646 */ break; case 2065: #line 15264 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-2])); } #line 49830 "gram.c" /* yacc.c:1646 */ break; case 2066: #line 15271 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-3].node)), COERCE_SQL_SYNTAX, (yylsp[-2])), (yylsp[-2])); } #line 49842 "gram.c" /* yacc.c:1646 */ break; case 2067: #line 15279 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-4].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-3])), (yylsp[-3])); } #line 49854 "gram.c" /* yacc.c:1646 */ break; case 2068: #line 15288 "gram.y" /* yacc.c:1646 */ { JsonFormat *format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); (yyval.node) = makeJsonIsPredicate((yyvsp[-3].node), format, (yyvsp[-1].ival), (yyvsp[0].boolean), (yylsp[-3])); } #line 49864 "gram.c" /* yacc.c:1646 */ break; case 2069: #line 15306 "gram.y" /* yacc.c:1646 */ { JsonFormat *format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); (yyval.node) = makeNotExpr(makeJsonIsPredicate((yyvsp[-4].node), format, (yyvsp[-1].ival), (yyvsp[0].boolean), (yylsp[-4])), (yylsp[-4])); } #line 49874 "gram.c" /* yacc.c:1646 */ break; case 2070: #line 15323 "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 49893 "gram.c" /* yacc.c:1646 */ break; case 2071: #line 15349 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49899 "gram.c" /* yacc.c:1646 */ break; case 2072: #line 15351 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 49905 "gram.c" /* yacc.c:1646 */ break; case 2073: #line 15353 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49911 "gram.c" /* yacc.c:1646 */ break; case 2074: #line 15355 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 49917 "gram.c" /* yacc.c:1646 */ break; case 2075: #line 15357 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49923 "gram.c" /* yacc.c:1646 */ break; case 2076: #line 15359 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49929 "gram.c" /* yacc.c:1646 */ break; case 2077: #line 15361 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49935 "gram.c" /* yacc.c:1646 */ break; case 2078: #line 15363 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49941 "gram.c" /* yacc.c:1646 */ break; case 2079: #line 15365 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49947 "gram.c" /* yacc.c:1646 */ break; case 2080: #line 15367 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49953 "gram.c" /* yacc.c:1646 */ break; case 2081: #line 15369 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49959 "gram.c" /* yacc.c:1646 */ break; case 2082: #line 15371 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49965 "gram.c" /* yacc.c:1646 */ break; case 2083: #line 15373 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49971 "gram.c" /* yacc.c:1646 */ break; case 2084: #line 15375 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49977 "gram.c" /* yacc.c:1646 */ break; case 2085: #line 15377 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49983 "gram.c" /* yacc.c:1646 */ break; case 2086: #line 15379 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49989 "gram.c" /* yacc.c:1646 */ break; case 2087: #line 15381 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49995 "gram.c" /* yacc.c:1646 */ break; case 2088: #line 15383 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 50001 "gram.c" /* yacc.c:1646 */ break; case 2089: #line 15385 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 50009 "gram.c" /* yacc.c:1646 */ break; case 2090: #line 15389 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 50017 "gram.c" /* yacc.c:1646 */ break; case 2091: #line 15393 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 50026 "gram.c" /* yacc.c:1646 */ break; case 2092: #line 15398 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 50036 "gram.c" /* yacc.c:1646 */ break; case 2093: #line 15413 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50042 "gram.c" /* yacc.c:1646 */ break; case 2094: #line 15414 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50048 "gram.c" /* yacc.c:1646 */ break; case 2095: #line 15416 "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 50069 "gram.c" /* yacc.c:1646 */ break; case 2096: #line 15433 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].list)) { A_Indirection *n = makeNode(A_Indirection); n->arg = (yyvsp[-2].node); n->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (Node *) n; } else (yyval.node) = (yyvsp[-2].node); } #line 50086 "gram.c" /* yacc.c:1646 */ break; case 2097: #line 15446 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50092 "gram.c" /* yacc.c:1646 */ break; case 2098: #line 15448 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50098 "gram.c" /* yacc.c:1646 */ break; case 2099: #line 15450 "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 50114 "gram.c" /* yacc.c:1646 */ break; case 2100: #line 15462 "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 50143 "gram.c" /* yacc.c:1646 */ break; case 2101: #line 15487 "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 50159 "gram.c" /* yacc.c:1646 */ break; case 2102: #line 15499 "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 50175 "gram.c" /* yacc.c:1646 */ break; case 2103: #line 15511 "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 50187 "gram.c" /* yacc.c:1646 */ break; case 2104: #line 15519 "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 50202 "gram.c" /* yacc.c:1646 */ break; case 2105: #line 15530 "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 50217 "gram.c" /* yacc.c:1646 */ break; case 2106: #line 15541 "gram.y" /* yacc.c:1646 */ { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *) g; } #line 50229 "gram.c" /* yacc.c:1646 */ break; case 2107: #line 15551 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, COERCE_EXPLICIT_CALL, (yylsp[-2])); } #line 50239 "gram.c" /* yacc.c:1646 */ break; case 2108: #line 15557 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-4].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (yylsp[-4])); n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50252 "gram.c" /* yacc.c:1646 */ break; case 2109: #line 15566 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), list_make1((yyvsp[-2].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); n->func_variadic = true; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50266 "gram.c" /* yacc.c:1646 */ break; case 2110: #line 15576 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-7].list), lappend((yyvsp[-5].list), (yyvsp[-2].node)), COERCE_EXPLICIT_CALL, (yylsp[-7])); n->func_variadic = true; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50280 "gram.c" /* yacc.c:1646 */ break; case 2111: #line 15586 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (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 50297 "gram.c" /* yacc.c:1646 */ break; case 2112: #line 15599 "gram.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (yylsp[-5])); n->agg_order = (yyvsp[-1].list); n->agg_distinct = true; (yyval.node) = (Node *) n; } #line 50311 "gram.c" /* yacc.c:1646 */ break; case 2113: #line 15609 "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, COERCE_EXPLICIT_CALL, (yylsp[-3])); n->agg_star = true; (yyval.node) = (Node *) n; } #line 50334 "gram.c" /* yacc.c:1646 */ break; case 2114: #line 15640 "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 50374 "gram.c" /* yacc.c:1646 */ break; case 2115: #line 15676 "gram.y" /* yacc.c:1646 */ { JsonAggConstructor *n = IsA((yyvsp[-2].node), JsonObjectAgg) ? ((JsonObjectAgg *) (yyvsp[-2].node))->constructor : ((JsonArrayAgg *) (yyvsp[-2].node))->constructor; n->agg_filter = (yyvsp[-1].node); n->over = (yyvsp[0].windef); (yyval.node) = (Node *) (yyvsp[-2].node); } #line 50388 "gram.c" /* yacc.c:1646 */ break; case 2116: #line 15686 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50394 "gram.c" /* yacc.c:1646 */ break; case 2117: #line 15696 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50400 "gram.c" /* yacc.c:1646 */ break; case 2118: #line 15697 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50406 "gram.c" /* yacc.c:1646 */ break; case 2119: #line 15698 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50412 "gram.c" /* yacc.c:1646 */ break; case 2120: #line 15706 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50423 "gram.c" /* yacc.c:1646 */ break; case 2121: #line 15713 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 50431 "gram.c" /* yacc.c:1646 */ break; case 2122: #line 15717 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 50439 "gram.c" /* yacc.c:1646 */ break; case 2123: #line 15721 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50447 "gram.c" /* yacc.c:1646 */ break; case 2124: #line 15725 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 50455 "gram.c" /* yacc.c:1646 */ break; case 2125: #line 15729 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50463 "gram.c" /* yacc.c:1646 */ break; case 2126: #line 15733 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 50471 "gram.c" /* yacc.c:1646 */ break; case 2127: #line 15737 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50479 "gram.c" /* yacc.c:1646 */ break; case 2128: #line 15741 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 50487 "gram.c" /* yacc.c:1646 */ break; case 2129: #line 15745 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50495 "gram.c" /* yacc.c:1646 */ break; case 2130: #line 15749 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 50503 "gram.c" /* yacc.c:1646 */ break; case 2131: #line 15753 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 50511 "gram.c" /* yacc.c:1646 */ break; case 2132: #line 15757 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 50519 "gram.c" /* yacc.c:1646 */ break; case 2133: #line 15761 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("system_user"), NIL, COERCE_SQL_SYNTAX, (yylsp[0])); } #line 50530 "gram.c" /* yacc.c:1646 */ break; case 2134: #line 15768 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 50538 "gram.c" /* yacc.c:1646 */ break; case 2135: #line 15772 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 50546 "gram.c" /* yacc.c:1646 */ break; case 2136: #line 15776 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 50554 "gram.c" /* yacc.c:1646 */ break; case 2137: #line 15780 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 50560 "gram.c" /* yacc.c:1646 */ break; case 2138: #line 15782 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("extract"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50571 "gram.c" /* yacc.c:1646 */ break; case 2139: #line 15789 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50582 "gram.c" /* yacc.c:1646 */ break; case 2140: #line 15796 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-5])); } #line 50593 "gram.c" /* yacc.c:1646 */ break; case 2141: #line 15803 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50604 "gram.c" /* yacc.c:1646 */ break; case 2142: #line 15810 "gram.y" /* yacc.c:1646 */ { /* * allow functions named overlay() to be called without * special syntax */ (yyval.node) = (Node *) makeFuncCall(list_make1(makeString("overlay")), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50619 "gram.c" /* yacc.c:1646 */ break; case 2143: #line 15821 "gram.y" /* yacc.c:1646 */ { /* * position(A in B) is converted to position(B, A) * * We deliberately don't offer a "plain syntax" option * for position(), because the reversal of the arguments * creates too much risk of confusion. */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("position"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50637 "gram.c" /* yacc.c:1646 */ break; case 2144: #line 15835 "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), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50651 "gram.c" /* yacc.c:1646 */ break; case 2145: #line 15845 "gram.y" /* yacc.c:1646 */ { /* * allow functions named substring() to be called without * special syntax */ (yyval.node) = (Node *) makeFuncCall(list_make1(makeString("substring")), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50666 "gram.c" /* yacc.c:1646 */ break; case 2146: #line 15856 "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(strVal(llast((yyvsp[-1].typnam)->names))), list_make1((yyvsp[-3].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); } #line 50686 "gram.c" /* yacc.c:1646 */ break; case 2147: #line 15872 "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), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50700 "gram.c" /* yacc.c:1646 */ break; case 2148: #line 15882 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50711 "gram.c" /* yacc.c:1646 */ break; case 2149: #line 15889 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50722 "gram.c" /* yacc.c:1646 */ break; case 2150: #line 15896 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50733 "gram.c" /* yacc.c:1646 */ break; case 2151: #line 15903 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 50741 "gram.c" /* yacc.c:1646 */ break; case 2152: #line 15907 "gram.y" /* yacc.c:1646 */ { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *) c; } #line 50753 "gram.c" /* yacc.c:1646 */ break; case 2153: #line 15915 "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 50766 "gram.c" /* yacc.c:1646 */ break; case 2154: #line 15924 "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 50779 "gram.c" /* yacc.c:1646 */ break; case 2155: #line 15933 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 50787 "gram.c" /* yacc.c:1646 */ break; case 2156: #line 15937 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 50795 "gram.c" /* yacc.c:1646 */ break; case 2157: #line 15941 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 50803 "gram.c" /* yacc.c:1646 */ break; case 2158: #line 15945 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 50811 "gram.c" /* yacc.c:1646 */ break; case 2159: #line 15949 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 50819 "gram.c" /* yacc.c:1646 */ break; case 2160: #line 15953 "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)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50832 "gram.c" /* yacc.c:1646 */ break; case 2161: #line 15962 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 50840 "gram.c" /* yacc.c:1646 */ break; case 2162: #line 15966 "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 50854 "gram.c" /* yacc.c:1646 */ break; case 2163: #line 15976 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 50862 "gram.c" /* yacc.c:1646 */ break; case 2164: #line 15980 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 50870 "gram.c" /* yacc.c:1646 */ break; case 2165: #line 15984 "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 50879 "gram.c" /* yacc.c:1646 */ break; case 2166: #line 15989 "gram.y" /* yacc.c:1646 */ { XmlSerialize *n = makeNode(XmlSerialize); n->xmloption = (yyvsp[-5].ival); n->expr = (yyvsp[-4].node); n->typeName = (yyvsp[-2].typnam); n->indent = (yyvsp[-1].boolean); n->location = (yylsp[-7]); (yyval.node) = (Node *) n; } #line 50894 "gram.c" /* yacc.c:1646 */ break; case 2167: #line 16000 "gram.y" /* yacc.c:1646 */ { /* Support for legacy (non-standard) json_object() */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("json_object"), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50904 "gram.c" /* yacc.c:1646 */ break; case 2168: #line 16009 "gram.y" /* yacc.c:1646 */ { JsonObjectConstructor *n = makeNode(JsonObjectConstructor); n->exprs = (yyvsp[-4].list); n->absent_on_null = (yyvsp[-3].boolean); n->unique = (yyvsp[-2].boolean); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 50919 "gram.c" /* yacc.c:1646 */ break; case 2169: #line 16020 "gram.y" /* yacc.c:1646 */ { JsonObjectConstructor *n = makeNode(JsonObjectConstructor); n->exprs = NULL; n->absent_on_null = false; n->unique = false; n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 50934 "gram.c" /* yacc.c:1646 */ break; case 2170: #line 16035 "gram.y" /* yacc.c:1646 */ { JsonArrayConstructor *n = makeNode(JsonArrayConstructor); n->exprs = (yyvsp[-3].list); n->absent_on_null = (yyvsp[-2].boolean); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 50948 "gram.c" /* yacc.c:1646 */ break; case 2171: #line 16050 "gram.y" /* yacc.c:1646 */ { JsonArrayQueryConstructor *n = makeNode(JsonArrayQueryConstructor); n->query = (yyvsp[-3].node); n->format = (JsonFormat *) (yyvsp[-2].node); n->absent_on_null = true; /* XXX */ n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 50963 "gram.c" /* yacc.c:1646 */ break; case 2172: #line 16063 "gram.y" /* yacc.c:1646 */ { JsonArrayConstructor *n = makeNode(JsonArrayConstructor); n->exprs = NIL; n->absent_on_null = true; n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 50977 "gram.c" /* yacc.c:1646 */ break; case 2173: #line 16073 "gram.y" /* yacc.c:1646 */ { JsonParseExpr *n = makeNode(JsonParseExpr); n->expr = (JsonValueExpr *) (yyvsp[-2].node); n->unique_keys = (yyvsp[-1].boolean); n->output = NULL; n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 50991 "gram.c" /* yacc.c:1646 */ break; case 2174: #line 16083 "gram.y" /* yacc.c:1646 */ { JsonScalarExpr *n = makeNode(JsonScalarExpr); n->expr = (Expr *) (yyvsp[-1].node); n->output = NULL; n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 51004 "gram.c" /* yacc.c:1646 */ break; case 2175: #line 16092 "gram.y" /* yacc.c:1646 */ { JsonSerializeExpr *n = makeNode(JsonSerializeExpr); n->expr = (JsonValueExpr *) (yyvsp[-2].node); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 51017 "gram.c" /* yacc.c:1646 */ break; case 2176: #line 16101 "gram.y" /* yacc.c:1646 */ { MergeSupportFunc *m = makeNode(MergeSupportFunc); m->msftype = TEXTOID; m->location = (yylsp[-2]); (yyval.node) = (Node *) m; } #line 51029 "gram.c" /* yacc.c:1646 */ break; case 2177: #line 16115 "gram.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_QUERY_OP; n->context_item = (JsonValueExpr *) (yyvsp[-8].node); n->pathspec = (yyvsp[-6].node); n->passing = (yyvsp[-5].list); n->output = (JsonOutput *) (yyvsp[-4].node); n->wrapper = (yyvsp[-3].ival); n->quotes = (yyvsp[-2].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[-1].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[-1].list)); n->location = (yylsp[-10]); (yyval.node) = (Node *) n; } #line 51049 "gram.c" /* yacc.c:1646 */ break; case 2178: #line 16134 "gram.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_EXISTS_OP; n->context_item = (JsonValueExpr *) (yyvsp[-5].node); n->pathspec = (yyvsp[-3].node); n->passing = (yyvsp[-2].list); n->output = NULL; n->on_error = (JsonBehavior *) (yyvsp[-1].node); n->location = (yylsp[-7]); (yyval.node) = (Node *) n; } #line 51066 "gram.c" /* yacc.c:1646 */ break; case 2179: #line 16151 "gram.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_VALUE_OP; n->context_item = (JsonValueExpr *) (yyvsp[-6].node); n->pathspec = (yyvsp[-4].node); n->passing = (yyvsp[-3].list); n->output = (JsonOutput *) (yyvsp[-2].node); n->on_empty = (JsonBehavior *) linitial((yyvsp[-1].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[-1].list)); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 51084 "gram.c" /* yacc.c:1646 */ break; case 2180: #line 16171 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51090 "gram.c" /* yacc.c:1646 */ break; case 2181: #line 16173 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst(-1); } #line 51096 "gram.c" /* yacc.c:1646 */ break; case 2182: #line 16177 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 51102 "gram.c" /* yacc.c:1646 */ break; case 2183: #line 16179 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 51108 "gram.c" /* yacc.c:1646 */ break; case 2184: #line 16181 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 51114 "gram.c" /* yacc.c:1646 */ break; case 2185: #line 16183 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 51120 "gram.c" /* yacc.c:1646 */ break; case 2186: #line 16186 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51126 "gram.c" /* yacc.c:1646 */ break; case 2187: #line 16189 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 51132 "gram.c" /* yacc.c:1646 */ break; case 2188: #line 16190 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 51138 "gram.c" /* yacc.c:1646 */ break; case 2189: #line 16194 "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 51150 "gram.c" /* yacc.c:1646 */ break; case 2190: #line 16202 "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 51162 "gram.c" /* yacc.c:1646 */ break; case 2191: #line 16211 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 51168 "gram.c" /* yacc.c:1646 */ break; case 2192: #line 16212 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_CONTENT; } #line 51174 "gram.c" /* yacc.c:1646 */ break; case 2193: #line 16215 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 51180 "gram.c" /* yacc.c:1646 */ break; case 2194: #line 16216 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51186 "gram.c" /* yacc.c:1646 */ break; case 2195: #line 16217 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51192 "gram.c" /* yacc.c:1646 */ break; case 2196: #line 16220 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 51198 "gram.c" /* yacc.c:1646 */ break; case 2197: #line 16221 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51204 "gram.c" /* yacc.c:1646 */ break; case 2198: #line 16222 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51210 "gram.c" /* yacc.c:1646 */ break; case 2199: #line 16228 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51218 "gram.c" /* yacc.c:1646 */ break; case 2200: #line 16232 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51226 "gram.c" /* yacc.c:1646 */ break; case 2201: #line 16236 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51234 "gram.c" /* yacc.c:1646 */ break; case 2202: #line 16240 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51242 "gram.c" /* yacc.c:1646 */ break; case 2205: #line 16255 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51248 "gram.c" /* yacc.c:1646 */ break; case 2206: #line 16256 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51254 "gram.c" /* yacc.c:1646 */ break; case 2207: #line 16260 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51260 "gram.c" /* yacc.c:1646 */ break; case 2208: #line 16261 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 51266 "gram.c" /* yacc.c:1646 */ break; case 2209: #line 16269 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51272 "gram.c" /* yacc.c:1646 */ break; case 2210: #line 16270 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51278 "gram.c" /* yacc.c:1646 */ break; case 2211: #line 16274 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 51284 "gram.c" /* yacc.c:1646 */ break; case 2212: #line 16276 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 51290 "gram.c" /* yacc.c:1646 */ break; case 2213: #line 16281 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 51301 "gram.c" /* yacc.c:1646 */ break; case 2214: #line 16290 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = (yyvsp[0].windef); } #line 51307 "gram.c" /* yacc.c:1646 */ break; case 2215: #line 16292 "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 51325 "gram.c" /* yacc.c:1646 */ break; case 2216: #line 16306 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = NULL; } #line 51331 "gram.c" /* yacc.c:1646 */ break; case 2217: #line 16311 "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 51350 "gram.c" /* yacc.c:1646 */ break; case 2218: #line 16337 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51356 "gram.c" /* yacc.c:1646 */ break; case 2219: #line 16338 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 51362 "gram.c" /* yacc.c:1646 */ break; case 2220: #line 16341 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51368 "gram.c" /* yacc.c:1646 */ break; case 2221: #line 16342 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51374 "gram.c" /* yacc.c:1646 */ break; case 2222: #line 16351 "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 51386 "gram.c" /* yacc.c:1646 */ break; case 2223: #line 16359 "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 51398 "gram.c" /* yacc.c:1646 */ break; case 2224: #line 16367 "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 51410 "gram.c" /* yacc.c:1646 */ break; case 2225: #line 16375 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 51423 "gram.c" /* yacc.c:1646 */ break; case 2226: #line 16386 "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 51445 "gram.c" /* yacc.c:1646 */ break; case 2227: #line 16404 "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 51487 "gram.c" /* yacc.c:1646 */ break; case 2228: #line 16450 "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 51500 "gram.c" /* yacc.c:1646 */ break; case 2229: #line 16459 "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 51513 "gram.c" /* yacc.c:1646 */ break; case 2230: #line 16468 "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 51526 "gram.c" /* yacc.c:1646 */ break; case 2231: #line 16477 "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 51539 "gram.c" /* yacc.c:1646 */ break; case 2232: #line 16486 "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 51552 "gram.c" /* yacc.c:1646 */ break; case 2233: #line 16497 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 51558 "gram.c" /* yacc.c:1646 */ break; case 2234: #line 16498 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 51564 "gram.c" /* yacc.c:1646 */ break; case 2235: #line 16499 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 51570 "gram.c" /* yacc.c:1646 */ break; case 2236: #line 16500 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 51576 "gram.c" /* yacc.c:1646 */ break; case 2237: #line 16501 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 51582 "gram.c" /* yacc.c:1646 */ break; case 2238: #line 16515 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51588 "gram.c" /* yacc.c:1646 */ break; case 2239: #line 16516 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51594 "gram.c" /* yacc.c:1646 */ break; case 2240: #line 16517 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 51600 "gram.c" /* yacc.c:1646 */ break; case 2241: #line 16520 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51606 "gram.c" /* yacc.c:1646 */ break; case 2242: #line 16521 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51612 "gram.c" /* yacc.c:1646 */ break; case 2243: #line 16524 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 51618 "gram.c" /* yacc.c:1646 */ break; case 2244: #line 16527 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 51624 "gram.c" /* yacc.c:1646 */ break; case 2245: #line 16528 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 51630 "gram.c" /* yacc.c:1646 */ break; case 2246: #line 16529 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ALL_SUBLINK; } #line 51636 "gram.c" /* yacc.c:1646 */ break; case 2247: #line 16532 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51642 "gram.c" /* yacc.c:1646 */ break; case 2248: #line 16533 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51648 "gram.c" /* yacc.c:1646 */ break; case 2249: #line 16536 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "+"; } #line 51654 "gram.c" /* yacc.c:1646 */ break; case 2250: #line 16537 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "-"; } #line 51660 "gram.c" /* yacc.c:1646 */ break; case 2251: #line 16538 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "*"; } #line 51666 "gram.c" /* yacc.c:1646 */ break; case 2252: #line 16539 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "/"; } #line 51672 "gram.c" /* yacc.c:1646 */ break; case 2253: #line 16540 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "%"; } #line 51678 "gram.c" /* yacc.c:1646 */ break; case 2254: #line 16541 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "^"; } #line 51684 "gram.c" /* yacc.c:1646 */ break; case 2255: #line 16542 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<"; } #line 51690 "gram.c" /* yacc.c:1646 */ break; case 2256: #line 16543 "gram.y" /* yacc.c:1646 */ { (yyval.str) = ">"; } #line 51696 "gram.c" /* yacc.c:1646 */ break; case 2257: #line 16544 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "="; } #line 51702 "gram.c" /* yacc.c:1646 */ break; case 2258: #line 16545 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<="; } #line 51708 "gram.c" /* yacc.c:1646 */ break; case 2259: #line 16546 "gram.y" /* yacc.c:1646 */ { (yyval.str) = ">="; } #line 51714 "gram.c" /* yacc.c:1646 */ break; case 2260: #line 16547 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<>"; } #line 51720 "gram.c" /* yacc.c:1646 */ break; case 2261: #line 16551 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51726 "gram.c" /* yacc.c:1646 */ break; case 2262: #line 16553 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51732 "gram.c" /* yacc.c:1646 */ break; case 2263: #line 16558 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51738 "gram.c" /* yacc.c:1646 */ break; case 2264: #line 16560 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51744 "gram.c" /* yacc.c:1646 */ break; case 2265: #line 16565 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51750 "gram.c" /* yacc.c:1646 */ break; case 2266: #line 16567 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51756 "gram.c" /* yacc.c:1646 */ break; case 2267: #line 16569 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~")); } #line 51762 "gram.c" /* yacc.c:1646 */ break; case 2268: #line 16571 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~")); } #line 51768 "gram.c" /* yacc.c:1646 */ break; case 2269: #line 16573 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~*")); } #line 51774 "gram.c" /* yacc.c:1646 */ break; case 2270: #line 16575 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~*")); } #line 51780 "gram.c" /* yacc.c:1646 */ break; case 2271: #line 16587 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51788 "gram.c" /* yacc.c:1646 */ break; case 2272: #line 16591 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51796 "gram.c" /* yacc.c:1646 */ break; case 2273: #line 16598 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51804 "gram.c" /* yacc.c:1646 */ break; case 2274: #line 16602 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51812 "gram.c" /* yacc.c:1646 */ break; case 2275: #line 16608 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51820 "gram.c" /* yacc.c:1646 */ break; case 2276: #line 16612 "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 51834 "gram.c" /* yacc.c:1646 */ break; case 2277: #line 16622 "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 51848 "gram.c" /* yacc.c:1646 */ break; case 2278: #line 16633 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51854 "gram.c" /* yacc.c:1646 */ break; case 2279: #line 16634 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51860 "gram.c" /* yacc.c:1646 */ break; case 2280: #line 16637 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 51866 "gram.c" /* yacc.c:1646 */ break; case 2281: #line 16638 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 51872 "gram.c" /* yacc.c:1646 */ break; case 2282: #line 16642 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 51880 "gram.c" /* yacc.c:1646 */ break; case 2283: #line 16646 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 51888 "gram.c" /* yacc.c:1646 */ break; case 2284: #line 16650 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1])); } #line 51896 "gram.c" /* yacc.c:1646 */ break; case 2285: #line 16655 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51902 "gram.c" /* yacc.c:1646 */ break; case 2286: #line 16656 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51908 "gram.c" /* yacc.c:1646 */ break; case 2287: #line 16662 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 51916 "gram.c" /* yacc.c:1646 */ break; case 2288: #line 16671 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51922 "gram.c" /* yacc.c:1646 */ break; case 2289: #line 16672 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "year"; } #line 51928 "gram.c" /* yacc.c:1646 */ break; case 2290: #line 16673 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "month"; } #line 51934 "gram.c" /* yacc.c:1646 */ break; case 2291: #line 16674 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "day"; } #line 51940 "gram.c" /* yacc.c:1646 */ break; case 2292: #line 16675 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "hour"; } #line 51946 "gram.c" /* yacc.c:1646 */ break; case 2293: #line 16676 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "minute"; } #line 51952 "gram.c" /* yacc.c:1646 */ break; case 2294: #line 16677 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "second"; } #line 51958 "gram.c" /* yacc.c:1646 */ break; case 2295: #line 16678 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51964 "gram.c" /* yacc.c:1646 */ break; case 2296: #line 16682 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "NFC"; } #line 51970 "gram.c" /* yacc.c:1646 */ break; case 2297: #line 16683 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "NFD"; } #line 51976 "gram.c" /* yacc.c:1646 */ break; case 2298: #line 16684 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "NFKC"; } #line 51982 "gram.c" /* yacc.c:1646 */ break; case 2299: #line 16685 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "NFKD"; } #line 51988 "gram.c" /* yacc.c:1646 */ break; case 2300: #line 16691 "gram.y" /* yacc.c:1646 */ { /* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */ (yyval.list) = list_make4((yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 51997 "gram.c" /* yacc.c:1646 */ break; case 2301: #line 16696 "gram.y" /* yacc.c:1646 */ { /* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 52006 "gram.c" /* yacc.c:1646 */ break; case 2302: #line 16704 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 52012 "gram.c" /* yacc.c:1646 */ break; case 2303: #line 16726 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 52020 "gram.c" /* yacc.c:1646 */ break; case 2304: #line 16730 "gram.y" /* yacc.c:1646 */ { /* not legal per SQL, but might as well allow it */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[0].node), (yyvsp[-2].node)); } #line 52029 "gram.c" /* yacc.c:1646 */ break; case 2305: #line 16735 "gram.y" /* yacc.c:1646 */ { /* * Because we aren't restricting data types here, this * syntax can end up resolving to textregexsubstr(). * We've historically allowed that to happen, so continue * to accept it. However, ruleutils.c will reverse-list * such a call in regular function call syntax. */ (yyval.list) = list_make2((yyvsp[-2].node), (yyvsp[0].node)); } #line 52044 "gram.c" /* yacc.c:1646 */ break; case 2306: #line 16746 "gram.y" /* yacc.c:1646 */ { /* not legal per SQL */ /* * 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[-2].node), makeIntConst(1, -1), makeTypeCast((yyvsp[0].node), SystemTypeName("int4"), -1)); } #line 52065 "gram.c" /* yacc.c:1646 */ break; case 2307: #line 16763 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 52073 "gram.c" /* yacc.c:1646 */ break; case 2308: #line 16768 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 52079 "gram.c" /* yacc.c:1646 */ break; case 2309: #line 16769 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52085 "gram.c" /* yacc.c:1646 */ break; case 2310: #line 16770 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52091 "gram.c" /* yacc.c:1646 */ break; case 2311: #line 16774 "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 52103 "gram.c" /* yacc.c:1646 */ break; case 2312: #line 16781 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 52109 "gram.c" /* yacc.c:1646 */ break; case 2313: #line 16792 "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 52124 "gram.c" /* yacc.c:1646 */ break; case 2314: #line 16806 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52130 "gram.c" /* yacc.c:1646 */ break; case 2315: #line 16807 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 52136 "gram.c" /* yacc.c:1646 */ break; case 2316: #line 16812 "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 52149 "gram.c" /* yacc.c:1646 */ break; case 2317: #line 16823 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52155 "gram.c" /* yacc.c:1646 */ break; case 2318: #line 16824 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52161 "gram.c" /* yacc.c:1646 */ break; case 2319: #line 16827 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52167 "gram.c" /* yacc.c:1646 */ break; case 2320: #line 16828 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52173 "gram.c" /* yacc.c:1646 */ break; case 2321: #line 16832 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 52181 "gram.c" /* yacc.c:1646 */ break; case 2322: #line 16836 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 52189 "gram.c" /* yacc.c:1646 */ break; case 2323: #line 16843 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 52197 "gram.c" /* yacc.c:1646 */ break; case 2324: #line 16847 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 52205 "gram.c" /* yacc.c:1646 */ break; case 2325: #line 16851 "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 52218 "gram.c" /* yacc.c:1646 */ break; case 2326: #line 16860 "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 52231 "gram.c" /* yacc.c:1646 */ break; case 2327: #line 16871 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52237 "gram.c" /* yacc.c:1646 */ break; case 2328: #line 16872 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52243 "gram.c" /* yacc.c:1646 */ break; case 2329: #line 16876 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52249 "gram.c" /* yacc.c:1646 */ break; case 2330: #line 16877 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 52255 "gram.c" /* yacc.c:1646 */ break; case 2331: #line 16881 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52261 "gram.c" /* yacc.c:1646 */ break; case 2332: #line 16882 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 52267 "gram.c" /* yacc.c:1646 */ break; case 2335: #line 16891 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52273 "gram.c" /* yacc.c:1646 */ break; case 2336: #line 16892 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52279 "gram.c" /* yacc.c:1646 */ break; case 2337: #line 16896 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52285 "gram.c" /* yacc.c:1646 */ break; case 2338: #line 16897 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 52291 "gram.c" /* yacc.c:1646 */ break; case 2339: #line 16902 "gram.y" /* yacc.c:1646 */ { JsonArgument *n = makeNode(JsonArgument); n->val = (JsonValueExpr *) (yyvsp[-2].node); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 52303 "gram.c" /* yacc.c:1646 */ break; case 2340: #line 16913 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_NONE; } #line 52309 "gram.c" /* yacc.c:1646 */ break; case 2341: #line 16914 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_NONE; } #line 52315 "gram.c" /* yacc.c:1646 */ break; case 2342: #line 16915 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52321 "gram.c" /* yacc.c:1646 */ break; case 2343: #line 16916 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52327 "gram.c" /* yacc.c:1646 */ break; case 2344: #line 16917 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_CONDITIONAL; } #line 52333 "gram.c" /* yacc.c:1646 */ break; case 2345: #line 16918 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52339 "gram.c" /* yacc.c:1646 */ break; case 2346: #line 16919 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_CONDITIONAL; } #line 52345 "gram.c" /* yacc.c:1646 */ break; case 2347: #line 16920 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52351 "gram.c" /* yacc.c:1646 */ break; case 2348: #line 16921 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNSPEC; } #line 52357 "gram.c" /* yacc.c:1646 */ break; case 2349: #line 16926 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonBehavior(JSON_BEHAVIOR_DEFAULT, (yyvsp[0].node), (yylsp[-1])); } #line 52363 "gram.c" /* yacc.c:1646 */ break; case 2350: #line 16928 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonBehavior((yyvsp[0].ival), NULL, (yylsp[0])); } #line 52369 "gram.c" /* yacc.c:1646 */ break; case 2351: #line 16932 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_ERROR; } #line 52375 "gram.c" /* yacc.c:1646 */ break; case 2352: #line 16933 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_NULL; } #line 52381 "gram.c" /* yacc.c:1646 */ break; case 2353: #line 16934 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_TRUE; } #line 52387 "gram.c" /* yacc.c:1646 */ break; case 2354: #line 16935 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_FALSE; } #line 52393 "gram.c" /* yacc.c:1646 */ break; case 2355: #line 16936 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_UNKNOWN; } #line 52399 "gram.c" /* yacc.c:1646 */ break; case 2356: #line 16937 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 52405 "gram.c" /* yacc.c:1646 */ break; case 2357: #line 16938 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_OBJECT; } #line 52411 "gram.c" /* yacc.c:1646 */ break; case 2358: #line 16940 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 52417 "gram.c" /* yacc.c:1646 */ break; case 2359: #line 16945 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].node), NULL); } #line 52423 "gram.c" /* yacc.c:1646 */ break; case 2360: #line 16947 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-2].node)); } #line 52429 "gram.c" /* yacc.c:1646 */ break; case 2361: #line 16949 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].node), (yyvsp[-2].node)); } #line 52435 "gram.c" /* yacc.c:1646 */ break; case 2362: #line 16951 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NULL); } #line 52441 "gram.c" /* yacc.c:1646 */ break; case 2363: #line 16956 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 52447 "gram.c" /* yacc.c:1646 */ break; case 2364: #line 16958 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52453 "gram.c" /* yacc.c:1646 */ break; case 2365: #line 16963 "gram.y" /* yacc.c:1646 */ { /* formatted_expr will be set during parse-analysis. */ (yyval.node) = (Node *) makeJsonValueExpr((Expr *) (yyvsp[-1].node), NULL, castNode(JsonFormat, (yyvsp[0].node))); } #line 52463 "gram.c" /* yacc.c:1646 */ break; case 2366: #line 16972 "gram.y" /* yacc.c:1646 */ { int encoding; if (!pg_strcasecmp((yyvsp[0].str), "utf8")) encoding = JS_ENC_UTF8; else if (!pg_strcasecmp((yyvsp[0].str), "utf16")) encoding = JS_ENC_UTF16; else if (!pg_strcasecmp((yyvsp[0].str), "utf32")) encoding = JS_ENC_UTF32; else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized JSON encoding: %s", (yyvsp[0].str)))); (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, (yylsp[-3])); } #line 52484 "gram.c" /* yacc.c:1646 */ break; case 2367: #line 16989 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, JS_ENC_DEFAULT, (yylsp[-1])); } #line 52492 "gram.c" /* yacc.c:1646 */ break; case 2368: #line 16996 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52500 "gram.c" /* yacc.c:1646 */ break; case 2369: #line 17000 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); } #line 52508 "gram.c" /* yacc.c:1646 */ break; case 2370: #line 17006 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_KEEP; } #line 52514 "gram.c" /* yacc.c:1646 */ break; case 2371: #line 17007 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_KEEP; } #line 52520 "gram.c" /* yacc.c:1646 */ break; case 2372: #line 17008 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_OMIT; } #line 52526 "gram.c" /* yacc.c:1646 */ break; case 2373: #line 17009 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_OMIT; } #line 52532 "gram.c" /* yacc.c:1646 */ break; case 2374: #line 17010 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_UNSPEC; } #line 52538 "gram.c" /* yacc.c:1646 */ break; case 2375: #line 17015 "gram.y" /* yacc.c:1646 */ { JsonOutput *n = makeNode(JsonOutput); n->typeName = (yyvsp[-1].typnam); n->returning = makeNode(JsonReturning); n->returning->format = (JsonFormat *) (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 52551 "gram.c" /* yacc.c:1646 */ break; case 2376: #line 17023 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52557 "gram.c" /* yacc.c:1646 */ break; case 2377: #line 17037 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ANY; } #line 52563 "gram.c" /* yacc.c:1646 */ break; case 2378: #line 17038 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ANY; } #line 52569 "gram.c" /* yacc.c:1646 */ break; case 2379: #line 17039 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ARRAY; } #line 52575 "gram.c" /* yacc.c:1646 */ break; case 2380: #line 17040 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_OBJECT; } #line 52581 "gram.c" /* yacc.c:1646 */ break; case 2381: #line 17041 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_SCALAR; } #line 52587 "gram.c" /* yacc.c:1646 */ break; case 2382: #line 17050 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52593 "gram.c" /* yacc.c:1646 */ break; case 2383: #line 17051 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52599 "gram.c" /* yacc.c:1646 */ break; case 2384: #line 17052 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52605 "gram.c" /* yacc.c:1646 */ break; case 2385: #line 17053 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52611 "gram.c" /* yacc.c:1646 */ break; case 2386: #line 17054 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52617 "gram.c" /* yacc.c:1646 */ break; case 2387: #line 17059 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52623 "gram.c" /* yacc.c:1646 */ break; case 2388: #line 17061 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 52629 "gram.c" /* yacc.c:1646 */ break; case 2389: #line 17071 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 52635 "gram.c" /* yacc.c:1646 */ break; case 2390: #line 17074 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 52641 "gram.c" /* yacc.c:1646 */ break; case 2391: #line 17079 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52647 "gram.c" /* yacc.c:1646 */ break; case 2392: #line 17080 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52653 "gram.c" /* yacc.c:1646 */ break; case 2393: #line 17081 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52659 "gram.c" /* yacc.c:1646 */ break; case 2394: #line 17085 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52665 "gram.c" /* yacc.c:1646 */ break; case 2395: #line 17086 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52671 "gram.c" /* yacc.c:1646 */ break; case 2396: #line 17087 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52677 "gram.c" /* yacc.c:1646 */ break; case 2397: #line 17091 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52683 "gram.c" /* yacc.c:1646 */ break; case 2398: #line 17092 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node));} #line 52689 "gram.c" /* yacc.c:1646 */ break; case 2399: #line 17102 "gram.y" /* yacc.c:1646 */ { JsonObjectAgg *n = makeNode(JsonObjectAgg); n->arg = (JsonKeyValue *) (yyvsp[-4].node); n->absent_on_null = (yyvsp[-3].boolean); n->unique = (yyvsp[-2].boolean); n->constructor = makeNode(JsonAggConstructor); n->constructor->output = (JsonOutput *) (yyvsp[-1].node); n->constructor->agg_order = NULL; n->constructor->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 52706 "gram.c" /* yacc.c:1646 */ break; case 2400: #line 17120 "gram.y" /* yacc.c:1646 */ { JsonArrayAgg *n = makeNode(JsonArrayAgg); n->arg = (JsonValueExpr *) (yyvsp[-4].node); n->absent_on_null = (yyvsp[-2].boolean); n->constructor = makeNode(JsonAggConstructor); n->constructor->agg_order = (yyvsp[-3].list); n->constructor->output = (JsonOutput *) (yyvsp[-1].node); n->constructor->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 52722 "gram.c" /* yacc.c:1646 */ break; case 2401: #line 17134 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52728 "gram.c" /* yacc.c:1646 */ break; case 2402: #line 17135 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52734 "gram.c" /* yacc.c:1646 */ break; case 2403: #line 17144 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52740 "gram.c" /* yacc.c:1646 */ break; case 2404: #line 17145 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52746 "gram.c" /* yacc.c:1646 */ break; case 2405: #line 17149 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 52752 "gram.c" /* yacc.c:1646 */ break; case 2406: #line 17150 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 52758 "gram.c" /* yacc.c:1646 */ break; case 2407: #line 17154 "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 52770 "gram.c" /* yacc.c:1646 */ break; case 2408: #line 17162 "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 52782 "gram.c" /* yacc.c:1646 */ break; case 2409: #line 17170 "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 52794 "gram.c" /* yacc.c:1646 */ break; case 2410: #line 17178 "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 52811 "gram.c" /* yacc.c:1646 */ break; case 2411: #line 17200 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 52817 "gram.c" /* yacc.c:1646 */ break; case 2412: #line 17201 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 52823 "gram.c" /* yacc.c:1646 */ break; case 2413: #line 17213 "gram.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 52831 "gram.c" /* yacc.c:1646 */ break; case 2414: #line 17217 "gram.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVarFromQualifiedName((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 52839 "gram.c" /* yacc.c:1646 */ break; case 2415: #line 17223 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 52845 "gram.c" /* yacc.c:1646 */ break; case 2416: #line 17225 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 52851 "gram.c" /* yacc.c:1646 */ break; case 2417: #line 17229 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52857 "gram.c" /* yacc.c:1646 */ break; case 2418: #line 17231 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52863 "gram.c" /* yacc.c:1646 */ break; case 2419: #line 17233 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52869 "gram.c" /* yacc.c:1646 */ break; case 2420: #line 17244 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 52875 "gram.c" /* yacc.c:1646 */ break; case 2421: #line 17246 "gram.y" /* yacc.c:1646 */ { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 52884 "gram.c" /* yacc.c:1646 */ break; case 2422: #line 17257 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 52892 "gram.c" /* yacc.c:1646 */ break; case 2423: #line 17261 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 52900 "gram.c" /* yacc.c:1646 */ break; case 2424: #line 17265 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 52908 "gram.c" /* yacc.c:1646 */ break; case 2425: #line 17269 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 52916 "gram.c" /* yacc.c:1646 */ break; case 2426: #line 17273 "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 52929 "gram.c" /* yacc.c:1646 */ break; case 2427: #line 17282 "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 52941 "gram.c" /* yacc.c:1646 */ break; case 2428: #line 17290 "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 52977 "gram.c" /* yacc.c:1646 */ break; case 2429: #line 17322 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 52985 "gram.c" /* yacc.c:1646 */ break; case 2430: #line 17326 "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 52996 "gram.c" /* yacc.c:1646 */ break; case 2431: #line 17333 "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 53008 "gram.c" /* yacc.c:1646 */ break; case 2432: #line 17341 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 53016 "gram.c" /* yacc.c:1646 */ break; case 2433: #line 17345 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 53024 "gram.c" /* yacc.c:1646 */ break; case 2434: #line 17349 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst((yylsp[0])); } #line 53032 "gram.c" /* yacc.c:1646 */ break; case 2435: #line 17354 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 53038 "gram.c" /* yacc.c:1646 */ break; case 2436: #line 17355 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53044 "gram.c" /* yacc.c:1646 */ break; case 2437: #line 17357 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 53050 "gram.c" /* yacc.c:1646 */ break; case 2438: #line 17358 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = + (yyvsp[0].ival); } #line 53056 "gram.c" /* yacc.c:1646 */ break; case 2439: #line 17359 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = - (yyvsp[0].ival); } #line 53062 "gram.c" /* yacc.c:1646 */ break; case 2440: #line 17364 "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; case ROLESPEC_CURRENT_ROLE: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "CURRENT_ROLE"), parser_errposition((yylsp[0])))); break; } } #line 53105 "gram.c" /* yacc.c:1646 */ break; case 2441: #line 17405 "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 53137 "gram.c" /* yacc.c:1646 */ break; case 2442: #line 17433 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_ROLE, (yylsp[0])); } #line 53145 "gram.c" /* yacc.c:1646 */ break; case 2443: #line 17437 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 53153 "gram.c" /* yacc.c:1646 */ break; case 2444: #line 17441 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 53161 "gram.c" /* yacc.c:1646 */ break; case 2445: #line 17447 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 53167 "gram.c" /* yacc.c:1646 */ break; case 2446: #line 17449 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 53173 "gram.c" /* yacc.c:1646 */ break; case 2447: #line 17466 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->distinctClause = (yyvsp[-9].list); n->targetList = (yyvsp[-8].list); n->fromClause = (yyvsp[-7].list); n->whereClause = (yyvsp[-6].node); n->groupClause = ((yyvsp[-5].groupclause))->list; n->groupDistinct = ((yyvsp[-5].groupclause))->distinct; n->havingClause = (yyvsp[-4].node); n->windowClause = (yyvsp[-3].list); n->sortClause = (yyvsp[-2].list); if ((yyvsp[-1].selectlimit)) { n->limitOffset = (yyvsp[-1].selectlimit)->limitOffset; n->limitCount = (yyvsp[-1].selectlimit)->limitCount; if (!n->sortClause && (yyvsp[-1].selectlimit)->limitOption == LIMIT_OPTION_WITH_TIES) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WITH TIES cannot be specified without ORDER BY clause"))); n->limitOption = (yyvsp[-1].selectlimit)->limitOption; } n->lockingClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 53204 "gram.c" /* yacc.c:1646 */ break; case 2448: #line 17499 "gram.y" /* yacc.c:1646 */ { PLAssignStmt *n = makeNode(PLAssignStmt); n->name = (yyvsp[-3].str); n->indirection = check_indirection((yyvsp[-2].list), yyscanner); /* nnames will be filled by calling production */ n->val = (SelectStmt *) (yyvsp[0].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 53219 "gram.c" /* yacc.c:1646 */ break; case 2449: #line 17511 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53225 "gram.c" /* yacc.c:1646 */ break; case 2450: #line 17512 "gram.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("$%d", (yyvsp[0].ival)); } #line 53231 "gram.c" /* yacc.c:1646 */ break; case 2453: #line 17533 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53237 "gram.c" /* yacc.c:1646 */ break; case 2454: #line 17534 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53243 "gram.c" /* yacc.c:1646 */ break; case 2455: #line 17535 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53249 "gram.c" /* yacc.c:1646 */ break; case 2456: #line 17540 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53255 "gram.c" /* yacc.c:1646 */ break; case 2457: #line 17541 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53261 "gram.c" /* yacc.c:1646 */ break; case 2458: #line 17542 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53267 "gram.c" /* yacc.c:1646 */ break; case 2459: #line 17547 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53273 "gram.c" /* yacc.c:1646 */ break; case 2460: #line 17548 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53279 "gram.c" /* yacc.c:1646 */ break; case 2461: #line 17549 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53285 "gram.c" /* yacc.c:1646 */ break; case 2462: #line 17550 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53291 "gram.c" /* yacc.c:1646 */ break; case 2463: #line 17556 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53297 "gram.c" /* yacc.c:1646 */ break; case 2464: #line 17557 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53303 "gram.c" /* yacc.c:1646 */ break; case 2465: #line 17558 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53309 "gram.c" /* yacc.c:1646 */ break; case 2466: #line 17559 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53315 "gram.c" /* yacc.c:1646 */ break; case 2467: #line 17560 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53321 "gram.c" /* yacc.c:1646 */ break; case 2468: #line 17566 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53327 "gram.c" /* yacc.c:1646 */ break; case 2469: #line 17567 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53333 "gram.c" /* yacc.c:1646 */ break; #line 53337 "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 18579 "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(indirection, 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; } 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.ival.type = T_Integer; n->val.ival.ival = val; n->location = location; return (Node *)n; } static Node * makeFloatConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.fval.type = T_Float; n->val.fval.fval = str; n->location = location; return (Node *)n; } static Node * makeBoolAConst(bool state, int location) { A_Const *n = makeNode(A_Const); n->val.boolval.type = T_Boolean; n->val.boolval.boolval = state; n->location = location; return (Node *) n; } static Node * makeBitStringConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.bsval.type = T_BitString; n->val.bsval.bsval = str; n->location = location; return (Node *)n; } static Node * makeNullAConst(int location) { A_Const *n = makeNode(A_Const); n->isnull = true; n->location = location; return (Node *)n; } static Node * makeAConst(Node *v, int location) { Node *n; switch (v->type) { case T_Float: n = makeFloatConst(castNode(Float, v)->fval, location); break; case T_Integer: n = makeIntConst(castNode(Integer, v)->ival, location); break; default: /* currently not used */ Assert(false); n = NULL; } return n; } /* 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(indirection, 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); Integer *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 = makeInteger(list_length(directargs)); return list_make2(list_concat(directargs, orderedargs), 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, SelectLimit *limitClause, 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 (limitClause && limitClause->limitOffset) { if (stmt->limitOffset) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple OFFSET clauses not allowed"), parser_errposition(exprLocation(limitClause->limitOffset)))); stmt->limitOffset = limitClause->limitOffset; } if (limitClause && limitClause->limitCount) { if (stmt->limitCount) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple LIMIT clauses not allowed"), parser_errposition(exprLocation(limitClause->limitCount)))); stmt->limitCount = limitClause->limitCount; } if (limitClause) { if (stmt->limitOption) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple limit options not allowed"))); if (!stmt->sortClause && limitClause->limitOption == LIMIT_OPTION_WITH_TIES) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WITH TIES cannot be specified without ORDER BY clause"))); if (limitClause->limitOption == LIMIT_OPTION_WITH_TIES && stmt->lockingClause) { ListCell *lc; foreach(lc, stmt->lockingClause) { LockingClause *lock = lfirst_node(LockingClause, lc); if (lock->waitPolicy == LockWaitSkip) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("%s and %s options cannot be used together", "SKIP LOCKED", "WITH TIES"))); } } stmt->limitOption = limitClause->limitOption; } 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 (IsA(&con->val, Integer)) { con->val.ival.ival = -con->val.ival.ival; return n; } if (IsA(&con->val, Float)) { doNegateFloat(&con->val.fval); return n; } } return (Node *) makeSimpleA_Expr(AEXPR_OP, "-", NULL, n, location); } static void doNegateFloat(Float *v) { char *oldval = v->fval; if (*oldval == '+') oldval++; if (*oldval == '-') v->fval = oldval+1; /* just strip the '-' */ else v->fval = psprintf("-%s", oldval); } static Node * makeAndExpr(Node *lexpr, Node *rexpr, int location) { /* Flatten "a AND b AND c ..." to a single BoolExpr on sight */ if (IsA(lexpr, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexpr; 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) { /* Flatten "a OR b OR c ..." to a single BoolExpr on sight */ if (IsA(lexpr, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexpr; 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_DEFAULT && 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; } /* * Convert a relation_name with name and namelist to a RangeVar using * makeRangeVar. */ static RangeVar * makeRangeVarFromQualifiedName(char *name, List *namelist, int location, core_yyscan_t yyscanner) { RangeVar *r; check_qualified_name(namelist, yyscanner); r = makeRangeVar(NULL, NULL, location); switch (list_length(namelist)) { case 1: r->catalogname = NULL; r->schemaname = name; r->relname = strVal(linitial(namelist)); break; case 2: r->catalogname = name; r->schemaname = strVal(linitial(namelist)); r->relname = strVal(lsecond(namelist)); break; default: ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", NameListToString(lcons(makeString(name), namelist))), parser_errposition(location))); break; } 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; *collClause = NULL; foreach(cell, qualList) { Node *n = (Node *) lfirst(cell); if (IsA(n, Constraint)) { /* keep it in list */ 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 = foreach_delete_current(qualList, cell); } *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))); } } /* * Parse a user-supplied partition strategy string into parse node * PartitionStrategy representation, or die trying. */ static PartitionStrategy parsePartitionStrategy(char *strategy) { if (pg_strcasecmp(strategy, "list") == 0) return PARTITION_STRATEGY_LIST; else if (pg_strcasecmp(strategy, "range") == 0) return PARTITION_STRATEGY_RANGE; else if (pg_strcasecmp(strategy, "hash") == 0) return PARTITION_STRATEGY_HASH; ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized partitioning strategy \"%s\"", strategy))); return PARTITION_STRATEGY_LIST; /* keep compiler quiet */ } /* * Process pubobjspec_list to check for errors in any of the objects and * convert PUBLICATIONOBJ_CONTINUATION into appropriate PublicationObjSpecType. */ static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner) { ListCell *cell; PublicationObjSpec *pubobj; PublicationObjSpecType prevobjtype = PUBLICATIONOBJ_CONTINUATION; if (!pubobjspec_list) return; pubobj = (PublicationObjSpec *) linitial(pubobjspec_list); if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid publication object list"), errdetail("One of TABLE or TABLES IN SCHEMA must be specified before a standalone table or schema name."), parser_errposition(pubobj->location))); foreach(cell, pubobjspec_list) { pubobj = (PublicationObjSpec *) lfirst(cell); if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION) pubobj->pubobjtype = prevobjtype; if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLE) { /* relation name or pubtable must be set for this type of object */ if (!pubobj->name && !pubobj->pubtable) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid table name"), parser_errposition(pubobj->location))); if (pubobj->name) { /* convert it to PublicationTable */ PublicationTable *pubtable = makeNode(PublicationTable); pubtable->relation = makeRangeVar(NULL, pubobj->name, pubobj->location); pubobj->pubtable = pubtable; pubobj->name = NULL; } } else if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_SCHEMA || pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA) { /* WHERE clause is not allowed on a schema object */ if (pubobj->pubtable && pubobj->pubtable->whereClause) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WHERE clause not allowed for schema"), parser_errposition(pubobj->location))); /* Column list is not allowed on a schema object */ if (pubobj->pubtable && pubobj->pubtable->columns) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("column specification not allowed for schema"), parser_errposition(pubobj->location))); /* * We can distinguish between the different type of schema * objects based on whether name and pubtable is set. */ if (pubobj->name) pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; else if (!pubobj->name && !pubobj->pubtable) pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid schema name"), parser_errposition(pubobj->location))); } prevobjtype = pubobj->pubobjtype; } } /*---------- * 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.6.0/src/parser/gram_minimal.h0000664000175000017500000005705514760010077015151 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, UIDENT = 259, FCONST = 260, SCONST = 261, USCONST = 262, BCONST = 263, XCONST = 264, Op = 265, ICONST = 266, PARAM = 267, TYPECAST = 268, DOT_DOT = 269, COLON_EQUALS = 270, EQUALS_GREATER = 271, LESS_EQUALS = 272, GREATER_EQUALS = 273, NOT_EQUALS = 274, ABORT_P = 275, ABSENT = 276, ABSOLUTE_P = 277, ACCESS = 278, ACTION = 279, ADD_P = 280, ADMIN = 281, AFTER = 282, AGGREGATE = 283, ALL = 284, ALSO = 285, ALTER = 286, ALWAYS = 287, ANALYSE = 288, ANALYZE = 289, AND = 290, ANY = 291, ARRAY = 292, AS = 293, ASC = 294, ASENSITIVE = 295, ASSERTION = 296, ASSIGNMENT = 297, ASYMMETRIC = 298, ATOMIC = 299, AT = 300, ATTACH = 301, ATTRIBUTE = 302, AUTHORIZATION = 303, BACKWARD = 304, BEFORE = 305, BEGIN_P = 306, BETWEEN = 307, BIGINT = 308, BINARY = 309, BIT = 310, BOOLEAN_P = 311, BOTH = 312, BREADTH = 313, BY = 314, CACHE = 315, CALL = 316, CALLED = 317, CASCADE = 318, CASCADED = 319, CASE = 320, CAST = 321, CATALOG_P = 322, CHAIN = 323, CHAR_P = 324, CHARACTER = 325, CHARACTERISTICS = 326, CHECK = 327, CHECKPOINT = 328, CLASS = 329, CLOSE = 330, CLUSTER = 331, COALESCE = 332, COLLATE = 333, COLLATION = 334, COLUMN = 335, COLUMNS = 336, COMMENT = 337, COMMENTS = 338, COMMIT = 339, COMMITTED = 340, COMPRESSION = 341, CONCURRENTLY = 342, CONDITIONAL = 343, CONFIGURATION = 344, CONFLICT = 345, CONNECTION = 346, CONSTRAINT = 347, CONSTRAINTS = 348, CONTENT_P = 349, CONTINUE_P = 350, CONVERSION_P = 351, COPY = 352, COST = 353, CREATE = 354, CROSS = 355, CSV = 356, CUBE = 357, CURRENT_P = 358, CURRENT_CATALOG = 359, CURRENT_DATE = 360, CURRENT_ROLE = 361, CURRENT_SCHEMA = 362, CURRENT_TIME = 363, CURRENT_TIMESTAMP = 364, CURRENT_USER = 365, CURSOR = 366, CYCLE = 367, DATA_P = 368, DATABASE = 369, DAY_P = 370, DEALLOCATE = 371, DEC = 372, DECIMAL_P = 373, DECLARE = 374, DEFAULT = 375, DEFAULTS = 376, DEFERRABLE = 377, DEFERRED = 378, DEFINER = 379, DELETE_P = 380, DELIMITER = 381, DELIMITERS = 382, DEPENDS = 383, DEPTH = 384, DESC = 385, DETACH = 386, DICTIONARY = 387, DISABLE_P = 388, DISCARD = 389, DISTINCT = 390, DO = 391, DOCUMENT_P = 392, DOMAIN_P = 393, DOUBLE_P = 394, DROP = 395, EACH = 396, ELSE = 397, EMPTY_P = 398, ENABLE_P = 399, ENCODING = 400, ENCRYPTED = 401, END_P = 402, ENUM_P = 403, ERROR_P = 404, ESCAPE = 405, EVENT = 406, EXCEPT = 407, EXCLUDE = 408, EXCLUDING = 409, EXCLUSIVE = 410, EXECUTE = 411, EXISTS = 412, EXPLAIN = 413, EXPRESSION = 414, EXTENSION = 415, EXTERNAL = 416, EXTRACT = 417, FALSE_P = 418, FAMILY = 419, FETCH = 420, FILTER = 421, FINALIZE = 422, FIRST_P = 423, FLOAT_P = 424, FOLLOWING = 425, FOR = 426, FORCE = 427, FOREIGN = 428, FORMAT = 429, FORWARD = 430, FREEZE = 431, FROM = 432, FULL = 433, FUNCTION = 434, FUNCTIONS = 435, GENERATED = 436, GLOBAL = 437, GRANT = 438, GRANTED = 439, GREATEST = 440, GROUP_P = 441, GROUPING = 442, GROUPS = 443, HANDLER = 444, HAVING = 445, HEADER_P = 446, HOLD = 447, HOUR_P = 448, IDENTITY_P = 449, IF_P = 450, ILIKE = 451, IMMEDIATE = 452, IMMUTABLE = 453, IMPLICIT_P = 454, IMPORT_P = 455, IN_P = 456, INCLUDE = 457, INCLUDING = 458, INCREMENT = 459, INDENT = 460, INDEX = 461, INDEXES = 462, INHERIT = 463, INHERITS = 464, INITIALLY = 465, INLINE_P = 466, INNER_P = 467, INOUT = 468, INPUT_P = 469, INSENSITIVE = 470, INSERT = 471, INSTEAD = 472, INT_P = 473, INTEGER = 474, INTERSECT = 475, INTERVAL = 476, INTO = 477, INVOKER = 478, IS = 479, ISNULL = 480, ISOLATION = 481, JOIN = 482, JSON = 483, JSON_ARRAY = 484, JSON_ARRAYAGG = 485, JSON_EXISTS = 486, JSON_OBJECT = 487, JSON_OBJECTAGG = 488, JSON_QUERY = 489, JSON_SCALAR = 490, JSON_SERIALIZE = 491, JSON_TABLE = 492, JSON_VALUE = 493, KEEP = 494, KEY = 495, KEYS = 496, LABEL = 497, LANGUAGE = 498, LARGE_P = 499, LAST_P = 500, LATERAL_P = 501, LEADING = 502, LEAKPROOF = 503, LEAST = 504, LEFT = 505, LEVEL = 506, LIKE = 507, LIMIT = 508, LISTEN = 509, LOAD = 510, LOCAL = 511, LOCALTIME = 512, LOCALTIMESTAMP = 513, LOCATION = 514, LOCK_P = 515, LOCKED = 516, LOGGED = 517, MAPPING = 518, MATCH = 519, MATCHED = 520, MATERIALIZED = 521, MAXVALUE = 522, MERGE = 523, MERGE_ACTION = 524, METHOD = 525, MINUTE_P = 526, MINVALUE = 527, MODE = 528, MONTH_P = 529, MOVE = 530, NAME_P = 531, NAMES = 532, NATIONAL = 533, NATURAL = 534, NCHAR = 535, NESTED = 536, NEW = 537, NEXT = 538, NFC = 539, NFD = 540, NFKC = 541, NFKD = 542, NO = 543, NONE = 544, NORMALIZE = 545, NORMALIZED = 546, NOT = 547, NOTHING = 548, NOTIFY = 549, NOTNULL = 550, NOWAIT = 551, NULL_P = 552, NULLIF = 553, NULLS_P = 554, NUMERIC = 555, OBJECT_P = 556, OF = 557, OFF = 558, OFFSET = 559, OIDS = 560, OLD = 561, OMIT = 562, ON = 563, ONLY = 564, OPERATOR = 565, OPTION = 566, OPTIONS = 567, OR = 568, ORDER = 569, ORDINALITY = 570, OTHERS = 571, OUT_P = 572, OUTER_P = 573, OVER = 574, OVERLAPS = 575, OVERLAY = 576, OVERRIDING = 577, OWNED = 578, OWNER = 579, PARALLEL = 580, PARAMETER = 581, PARSER = 582, PARTIAL = 583, PARTITION = 584, PASSING = 585, PASSWORD = 586, PATH = 587, PGPOOL = 588, PLACING = 589, PLAN = 590, PLANS = 591, POLICY = 592, POSITION = 593, PRECEDING = 594, PRECISION = 595, PRESERVE = 596, PREPARE = 597, PREPARED = 598, PRIMARY = 599, PRIOR = 600, PRIVILEGES = 601, PROCEDURAL = 602, PROCEDURE = 603, PROCEDURES = 604, PROGRAM = 605, PUBLICATION = 606, QUOTE = 607, QUOTES = 608, RANGE = 609, READ = 610, REAL = 611, REASSIGN = 612, RECHECK = 613, RECURSIVE = 614, REF_P = 615, REFERENCES = 616, REFERENCING = 617, REFRESH = 618, REINDEX = 619, RELATIVE_P = 620, RELEASE = 621, RENAME = 622, REPEATABLE = 623, REPLACE = 624, REPLICA = 625, RESET = 626, RESTART = 627, RESTRICT = 628, RETURN = 629, RETURNING = 630, RETURNS = 631, REVOKE = 632, RIGHT = 633, ROLE = 634, ROLLBACK = 635, ROLLUP = 636, ROUTINE = 637, ROUTINES = 638, ROW = 639, ROWS = 640, RULE = 641, SAVEPOINT = 642, SCALAR = 643, SCHEMA = 644, SCHEMAS = 645, SCROLL = 646, SEARCH = 647, SECOND_P = 648, SECURITY = 649, SELECT = 650, SEQUENCE = 651, SEQUENCES = 652, SERIALIZABLE = 653, SERVER = 654, SESSION = 655, SESSION_USER = 656, SET = 657, SETS = 658, SETOF = 659, SHARE = 660, SHOW = 661, SIMILAR = 662, SIMPLE = 663, SKIP = 664, SMALLINT = 665, SNAPSHOT = 666, SOME = 667, SOURCE = 668, SQL_P = 669, STABLE = 670, STANDALONE_P = 671, START = 672, STATEMENT = 673, STATISTICS = 674, STDIN = 675, STDOUT = 676, STORAGE = 677, STORED = 678, STRICT_P = 679, STRING_P = 680, STRIP_P = 681, SUBSCRIPTION = 682, SUBSTRING = 683, SUPPORT = 684, SYMMETRIC = 685, SYSID = 686, SYSTEM_P = 687, SYSTEM_USER = 688, TABLE = 689, TABLES = 690, TABLESAMPLE = 691, TABLESPACE = 692, TARGET = 693, TEMP = 694, TEMPLATE = 695, TEMPORARY = 696, TEXT_P = 697, THEN = 698, TIES = 699, TIME = 700, TIMESTAMP = 701, TO = 702, TRAILING = 703, TRANSACTION = 704, TRANSFORM = 705, TREAT = 706, TRIGGER = 707, TRIM = 708, TRUE_P = 709, TRUNCATE = 710, TRUSTED = 711, TYPE_P = 712, TYPES_P = 713, UESCAPE = 714, UNBOUNDED = 715, UNCONDITIONAL = 716, UNCOMMITTED = 717, UNENCRYPTED = 718, UNION = 719, UNIQUE = 720, UNKNOWN = 721, UNLISTEN = 722, UNLOGGED = 723, UNTIL = 724, UPDATE = 725, USER = 726, USING = 727, VACUUM = 728, VALID = 729, VALIDATE = 730, VALIDATOR = 731, VALUE_P = 732, VALUES = 733, VARCHAR = 734, VARIADIC = 735, VARYING = 736, VERBOSE = 737, VERSION_P = 738, VIEW = 739, VIEWS = 740, VOLATILE = 741, WHEN = 742, WHERE = 743, WHITESPACE_P = 744, WINDOW = 745, WITH = 746, WITHIN = 747, WITHOUT = 748, WORK = 749, WRAPPER = 750, WRITE = 751, XML_P = 752, XMLATTRIBUTES = 753, XMLCONCAT = 754, XMLELEMENT = 755, XMLEXISTS = 756, XMLFOREST = 757, XMLNAMESPACES = 758, XMLPARSE = 759, XMLPI = 760, XMLROOT = 761, XMLSERIALIZE = 762, XMLTABLE = 763, YEAR_P = 764, YES_P = 765, ZONE = 766, FORMAT_LA = 767, NOT_LA = 768, NULLS_LA = 769, WITH_LA = 770, WITHOUT_LA = 771, MODE_TYPE_NAME = 772, MODE_PLPGSQL_EXPR = 773, MODE_PLPGSQL_ASSIGN1 = 774, MODE_PLPGSQL_ASSIGN2 = 775, MODE_PLPGSQL_ASSIGN3 = 776, UMINUS = 777 }; #endif /* Tokens. */ #define IDENT 258 #define UIDENT 259 #define FCONST 260 #define SCONST 261 #define USCONST 262 #define BCONST 263 #define XCONST 264 #define Op 265 #define ICONST 266 #define PARAM 267 #define TYPECAST 268 #define DOT_DOT 269 #define COLON_EQUALS 270 #define EQUALS_GREATER 271 #define LESS_EQUALS 272 #define GREATER_EQUALS 273 #define NOT_EQUALS 274 #define ABORT_P 275 #define ABSENT 276 #define ABSOLUTE_P 277 #define ACCESS 278 #define ACTION 279 #define ADD_P 280 #define ADMIN 281 #define AFTER 282 #define AGGREGATE 283 #define ALL 284 #define ALSO 285 #define ALTER 286 #define ALWAYS 287 #define ANALYSE 288 #define ANALYZE 289 #define AND 290 #define ANY 291 #define ARRAY 292 #define AS 293 #define ASC 294 #define ASENSITIVE 295 #define ASSERTION 296 #define ASSIGNMENT 297 #define ASYMMETRIC 298 #define ATOMIC 299 #define AT 300 #define ATTACH 301 #define ATTRIBUTE 302 #define AUTHORIZATION 303 #define BACKWARD 304 #define BEFORE 305 #define BEGIN_P 306 #define BETWEEN 307 #define BIGINT 308 #define BINARY 309 #define BIT 310 #define BOOLEAN_P 311 #define BOTH 312 #define BREADTH 313 #define BY 314 #define CACHE 315 #define CALL 316 #define CALLED 317 #define CASCADE 318 #define CASCADED 319 #define CASE 320 #define CAST 321 #define CATALOG_P 322 #define CHAIN 323 #define CHAR_P 324 #define CHARACTER 325 #define CHARACTERISTICS 326 #define CHECK 327 #define CHECKPOINT 328 #define CLASS 329 #define CLOSE 330 #define CLUSTER 331 #define COALESCE 332 #define COLLATE 333 #define COLLATION 334 #define COLUMN 335 #define COLUMNS 336 #define COMMENT 337 #define COMMENTS 338 #define COMMIT 339 #define COMMITTED 340 #define COMPRESSION 341 #define CONCURRENTLY 342 #define CONDITIONAL 343 #define CONFIGURATION 344 #define CONFLICT 345 #define CONNECTION 346 #define CONSTRAINT 347 #define CONSTRAINTS 348 #define CONTENT_P 349 #define CONTINUE_P 350 #define CONVERSION_P 351 #define COPY 352 #define COST 353 #define CREATE 354 #define CROSS 355 #define CSV 356 #define CUBE 357 #define CURRENT_P 358 #define CURRENT_CATALOG 359 #define CURRENT_DATE 360 #define CURRENT_ROLE 361 #define CURRENT_SCHEMA 362 #define CURRENT_TIME 363 #define CURRENT_TIMESTAMP 364 #define CURRENT_USER 365 #define CURSOR 366 #define CYCLE 367 #define DATA_P 368 #define DATABASE 369 #define DAY_P 370 #define DEALLOCATE 371 #define DEC 372 #define DECIMAL_P 373 #define DECLARE 374 #define DEFAULT 375 #define DEFAULTS 376 #define DEFERRABLE 377 #define DEFERRED 378 #define DEFINER 379 #define DELETE_P 380 #define DELIMITER 381 #define DELIMITERS 382 #define DEPENDS 383 #define DEPTH 384 #define DESC 385 #define DETACH 386 #define DICTIONARY 387 #define DISABLE_P 388 #define DISCARD 389 #define DISTINCT 390 #define DO 391 #define DOCUMENT_P 392 #define DOMAIN_P 393 #define DOUBLE_P 394 #define DROP 395 #define EACH 396 #define ELSE 397 #define EMPTY_P 398 #define ENABLE_P 399 #define ENCODING 400 #define ENCRYPTED 401 #define END_P 402 #define ENUM_P 403 #define ERROR_P 404 #define ESCAPE 405 #define EVENT 406 #define EXCEPT 407 #define EXCLUDE 408 #define EXCLUDING 409 #define EXCLUSIVE 410 #define EXECUTE 411 #define EXISTS 412 #define EXPLAIN 413 #define EXPRESSION 414 #define EXTENSION 415 #define EXTERNAL 416 #define EXTRACT 417 #define FALSE_P 418 #define FAMILY 419 #define FETCH 420 #define FILTER 421 #define FINALIZE 422 #define FIRST_P 423 #define FLOAT_P 424 #define FOLLOWING 425 #define FOR 426 #define FORCE 427 #define FOREIGN 428 #define FORMAT 429 #define FORWARD 430 #define FREEZE 431 #define FROM 432 #define FULL 433 #define FUNCTION 434 #define FUNCTIONS 435 #define GENERATED 436 #define GLOBAL 437 #define GRANT 438 #define GRANTED 439 #define GREATEST 440 #define GROUP_P 441 #define GROUPING 442 #define GROUPS 443 #define HANDLER 444 #define HAVING 445 #define HEADER_P 446 #define HOLD 447 #define HOUR_P 448 #define IDENTITY_P 449 #define IF_P 450 #define ILIKE 451 #define IMMEDIATE 452 #define IMMUTABLE 453 #define IMPLICIT_P 454 #define IMPORT_P 455 #define IN_P 456 #define INCLUDE 457 #define INCLUDING 458 #define INCREMENT 459 #define INDENT 460 #define INDEX 461 #define INDEXES 462 #define INHERIT 463 #define INHERITS 464 #define INITIALLY 465 #define INLINE_P 466 #define INNER_P 467 #define INOUT 468 #define INPUT_P 469 #define INSENSITIVE 470 #define INSERT 471 #define INSTEAD 472 #define INT_P 473 #define INTEGER 474 #define INTERSECT 475 #define INTERVAL 476 #define INTO 477 #define INVOKER 478 #define IS 479 #define ISNULL 480 #define ISOLATION 481 #define JOIN 482 #define JSON 483 #define JSON_ARRAY 484 #define JSON_ARRAYAGG 485 #define JSON_EXISTS 486 #define JSON_OBJECT 487 #define JSON_OBJECTAGG 488 #define JSON_QUERY 489 #define JSON_SCALAR 490 #define JSON_SERIALIZE 491 #define JSON_TABLE 492 #define JSON_VALUE 493 #define KEEP 494 #define KEY 495 #define KEYS 496 #define LABEL 497 #define LANGUAGE 498 #define LARGE_P 499 #define LAST_P 500 #define LATERAL_P 501 #define LEADING 502 #define LEAKPROOF 503 #define LEAST 504 #define LEFT 505 #define LEVEL 506 #define LIKE 507 #define LIMIT 508 #define LISTEN 509 #define LOAD 510 #define LOCAL 511 #define LOCALTIME 512 #define LOCALTIMESTAMP 513 #define LOCATION 514 #define LOCK_P 515 #define LOCKED 516 #define LOGGED 517 #define MAPPING 518 #define MATCH 519 #define MATCHED 520 #define MATERIALIZED 521 #define MAXVALUE 522 #define MERGE 523 #define MERGE_ACTION 524 #define METHOD 525 #define MINUTE_P 526 #define MINVALUE 527 #define MODE 528 #define MONTH_P 529 #define MOVE 530 #define NAME_P 531 #define NAMES 532 #define NATIONAL 533 #define NATURAL 534 #define NCHAR 535 #define NESTED 536 #define NEW 537 #define NEXT 538 #define NFC 539 #define NFD 540 #define NFKC 541 #define NFKD 542 #define NO 543 #define NONE 544 #define NORMALIZE 545 #define NORMALIZED 546 #define NOT 547 #define NOTHING 548 #define NOTIFY 549 #define NOTNULL 550 #define NOWAIT 551 #define NULL_P 552 #define NULLIF 553 #define NULLS_P 554 #define NUMERIC 555 #define OBJECT_P 556 #define OF 557 #define OFF 558 #define OFFSET 559 #define OIDS 560 #define OLD 561 #define OMIT 562 #define ON 563 #define ONLY 564 #define OPERATOR 565 #define OPTION 566 #define OPTIONS 567 #define OR 568 #define ORDER 569 #define ORDINALITY 570 #define OTHERS 571 #define OUT_P 572 #define OUTER_P 573 #define OVER 574 #define OVERLAPS 575 #define OVERLAY 576 #define OVERRIDING 577 #define OWNED 578 #define OWNER 579 #define PARALLEL 580 #define PARAMETER 581 #define PARSER 582 #define PARTIAL 583 #define PARTITION 584 #define PASSING 585 #define PASSWORD 586 #define PATH 587 #define PGPOOL 588 #define PLACING 589 #define PLAN 590 #define PLANS 591 #define POLICY 592 #define POSITION 593 #define PRECEDING 594 #define PRECISION 595 #define PRESERVE 596 #define PREPARE 597 #define PREPARED 598 #define PRIMARY 599 #define PRIOR 600 #define PRIVILEGES 601 #define PROCEDURAL 602 #define PROCEDURE 603 #define PROCEDURES 604 #define PROGRAM 605 #define PUBLICATION 606 #define QUOTE 607 #define QUOTES 608 #define RANGE 609 #define READ 610 #define REAL 611 #define REASSIGN 612 #define RECHECK 613 #define RECURSIVE 614 #define REF_P 615 #define REFERENCES 616 #define REFERENCING 617 #define REFRESH 618 #define REINDEX 619 #define RELATIVE_P 620 #define RELEASE 621 #define RENAME 622 #define REPEATABLE 623 #define REPLACE 624 #define REPLICA 625 #define RESET 626 #define RESTART 627 #define RESTRICT 628 #define RETURN 629 #define RETURNING 630 #define RETURNS 631 #define REVOKE 632 #define RIGHT 633 #define ROLE 634 #define ROLLBACK 635 #define ROLLUP 636 #define ROUTINE 637 #define ROUTINES 638 #define ROW 639 #define ROWS 640 #define RULE 641 #define SAVEPOINT 642 #define SCALAR 643 #define SCHEMA 644 #define SCHEMAS 645 #define SCROLL 646 #define SEARCH 647 #define SECOND_P 648 #define SECURITY 649 #define SELECT 650 #define SEQUENCE 651 #define SEQUENCES 652 #define SERIALIZABLE 653 #define SERVER 654 #define SESSION 655 #define SESSION_USER 656 #define SET 657 #define SETS 658 #define SETOF 659 #define SHARE 660 #define SHOW 661 #define SIMILAR 662 #define SIMPLE 663 #define SKIP 664 #define SMALLINT 665 #define SNAPSHOT 666 #define SOME 667 #define SOURCE 668 #define SQL_P 669 #define STABLE 670 #define STANDALONE_P 671 #define START 672 #define STATEMENT 673 #define STATISTICS 674 #define STDIN 675 #define STDOUT 676 #define STORAGE 677 #define STORED 678 #define STRICT_P 679 #define STRING_P 680 #define STRIP_P 681 #define SUBSCRIPTION 682 #define SUBSTRING 683 #define SUPPORT 684 #define SYMMETRIC 685 #define SYSID 686 #define SYSTEM_P 687 #define SYSTEM_USER 688 #define TABLE 689 #define TABLES 690 #define TABLESAMPLE 691 #define TABLESPACE 692 #define TARGET 693 #define TEMP 694 #define TEMPLATE 695 #define TEMPORARY 696 #define TEXT_P 697 #define THEN 698 #define TIES 699 #define TIME 700 #define TIMESTAMP 701 #define TO 702 #define TRAILING 703 #define TRANSACTION 704 #define TRANSFORM 705 #define TREAT 706 #define TRIGGER 707 #define TRIM 708 #define TRUE_P 709 #define TRUNCATE 710 #define TRUSTED 711 #define TYPE_P 712 #define TYPES_P 713 #define UESCAPE 714 #define UNBOUNDED 715 #define UNCONDITIONAL 716 #define UNCOMMITTED 717 #define UNENCRYPTED 718 #define UNION 719 #define UNIQUE 720 #define UNKNOWN 721 #define UNLISTEN 722 #define UNLOGGED 723 #define UNTIL 724 #define UPDATE 725 #define USER 726 #define USING 727 #define VACUUM 728 #define VALID 729 #define VALIDATE 730 #define VALIDATOR 731 #define VALUE_P 732 #define VALUES 733 #define VARCHAR 734 #define VARIADIC 735 #define VARYING 736 #define VERBOSE 737 #define VERSION_P 738 #define VIEW 739 #define VIEWS 740 #define VOLATILE 741 #define WHEN 742 #define WHERE 743 #define WHITESPACE_P 744 #define WINDOW 745 #define WITH 746 #define WITHIN 747 #define WITHOUT 748 #define WORK 749 #define WRAPPER 750 #define WRITE 751 #define XML_P 752 #define XMLATTRIBUTES 753 #define XMLCONCAT 754 #define XMLELEMENT 755 #define XMLEXISTS 756 #define XMLFOREST 757 #define XMLNAMESPACES 758 #define XMLPARSE 759 #define XMLPI 760 #define XMLROOT 761 #define XMLSERIALIZE 762 #define XMLTABLE 763 #define YEAR_P 764 #define YES_P 765 #define ZONE 766 #define FORMAT_LA 767 #define NOT_LA 768 #define NULLS_LA 769 #define WITH_LA 770 #define WITHOUT_LA 771 #define MODE_TYPE_NAME 772 #define MODE_PLPGSQL_EXPR 773 #define MODE_PLPGSQL_ASSIGN1 774 #define MODE_PLPGSQL_ASSIGN2 775 #define MODE_PLPGSQL_ASSIGN3 776 #define UMINUS 777 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 263 "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; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; StatsElem *selem; 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; PublicationObjSpec *publicationobjectspec; struct SelectLimit *selectlimit; SetQuantifier setquantifier; struct GroupClause *groupclause; MergeMatchKind mergematch; MergeWhenClause *mergewhen; struct KeyActions *keyactions; struct KeyAction *keyaction; #line 1150 "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.6.0/src/parser/gram_minimal.c0000664000175000017500001242607714760010077015153 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-2024, PgPool Global Development Group * Portions Copyright (c) 1996-2024, 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 "utils/pgstrcasecmp.h" #include #include #include #include #include #include "nodes.h" #include "keywords.h" #include "gramparse.h" #include "makefuncs.h" #include "parser.h" #include "pg_class.h" #include "pg_trigger.h" /* * Definition taken from * postgreSQL source code file: src/include/commands/trigger.h */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' /* * Definition taken from * postgreSQL source code file: src/include/catalog/pg_class.h */ #define REPLICA_IDENTITY_DEFAULT 'd' #define REPLICA_IDENTITY_NOTHING 'n' #define REPLICA_IDENTITY_FULL 'f' #define REPLICA_IDENTITY_INDEX 'i' /* * Definition taken from * postgreSQL source code file: src/include/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. */ #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; /* Private struct for the result of opt_select_limit production */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; } SelectLimit; /* Private struct for the result of group_clause production */ typedef struct GroupClause { bool distinct; List *list; } GroupClause; /* Private structs for the result of key_actions and key_action productions */ typedef struct KeyAction { char action; List *cols; } KeyAction; typedef struct KeyActions { KeyAction *updateAction; KeyAction *deleteAction; } KeyActions; /* 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 *makeFloatConst(char *str, int location); static Node *makeBoolAConst(bool state, int location); static Node *makeBitStringConst(char *str, int location); static Node *makeNullAConst(int location); static Node *makeAConst(Node *v, 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, SelectLimit *limitClause, 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(Float *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 RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location, 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 PartitionStrategy parsePartitionStrategy(char *strategy); static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner); static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); #line 325 "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_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, UIDENT = 259, FCONST = 260, SCONST = 261, USCONST = 262, BCONST = 263, XCONST = 264, Op = 265, ICONST = 266, PARAM = 267, TYPECAST = 268, DOT_DOT = 269, COLON_EQUALS = 270, EQUALS_GREATER = 271, LESS_EQUALS = 272, GREATER_EQUALS = 273, NOT_EQUALS = 274, ABORT_P = 275, ABSENT = 276, ABSOLUTE_P = 277, ACCESS = 278, ACTION = 279, ADD_P = 280, ADMIN = 281, AFTER = 282, AGGREGATE = 283, ALL = 284, ALSO = 285, ALTER = 286, ALWAYS = 287, ANALYSE = 288, ANALYZE = 289, AND = 290, ANY = 291, ARRAY = 292, AS = 293, ASC = 294, ASENSITIVE = 295, ASSERTION = 296, ASSIGNMENT = 297, ASYMMETRIC = 298, ATOMIC = 299, AT = 300, ATTACH = 301, ATTRIBUTE = 302, AUTHORIZATION = 303, BACKWARD = 304, BEFORE = 305, BEGIN_P = 306, BETWEEN = 307, BIGINT = 308, BINARY = 309, BIT = 310, BOOLEAN_P = 311, BOTH = 312, BREADTH = 313, BY = 314, CACHE = 315, CALL = 316, CALLED = 317, CASCADE = 318, CASCADED = 319, CASE = 320, CAST = 321, CATALOG_P = 322, CHAIN = 323, CHAR_P = 324, CHARACTER = 325, CHARACTERISTICS = 326, CHECK = 327, CHECKPOINT = 328, CLASS = 329, CLOSE = 330, CLUSTER = 331, COALESCE = 332, COLLATE = 333, COLLATION = 334, COLUMN = 335, COLUMNS = 336, COMMENT = 337, COMMENTS = 338, COMMIT = 339, COMMITTED = 340, COMPRESSION = 341, CONCURRENTLY = 342, CONDITIONAL = 343, CONFIGURATION = 344, CONFLICT = 345, CONNECTION = 346, CONSTRAINT = 347, CONSTRAINTS = 348, CONTENT_P = 349, CONTINUE_P = 350, CONVERSION_P = 351, COPY = 352, COST = 353, CREATE = 354, CROSS = 355, CSV = 356, CUBE = 357, CURRENT_P = 358, CURRENT_CATALOG = 359, CURRENT_DATE = 360, CURRENT_ROLE = 361, CURRENT_SCHEMA = 362, CURRENT_TIME = 363, CURRENT_TIMESTAMP = 364, CURRENT_USER = 365, CURSOR = 366, CYCLE = 367, DATA_P = 368, DATABASE = 369, DAY_P = 370, DEALLOCATE = 371, DEC = 372, DECIMAL_P = 373, DECLARE = 374, DEFAULT = 375, DEFAULTS = 376, DEFERRABLE = 377, DEFERRED = 378, DEFINER = 379, DELETE_P = 380, DELIMITER = 381, DELIMITERS = 382, DEPENDS = 383, DEPTH = 384, DESC = 385, DETACH = 386, DICTIONARY = 387, DISABLE_P = 388, DISCARD = 389, DISTINCT = 390, DO = 391, DOCUMENT_P = 392, DOMAIN_P = 393, DOUBLE_P = 394, DROP = 395, EACH = 396, ELSE = 397, EMPTY_P = 398, ENABLE_P = 399, ENCODING = 400, ENCRYPTED = 401, END_P = 402, ENUM_P = 403, ERROR_P = 404, ESCAPE = 405, EVENT = 406, EXCEPT = 407, EXCLUDE = 408, EXCLUDING = 409, EXCLUSIVE = 410, EXECUTE = 411, EXISTS = 412, EXPLAIN = 413, EXPRESSION = 414, EXTENSION = 415, EXTERNAL = 416, EXTRACT = 417, FALSE_P = 418, FAMILY = 419, FETCH = 420, FILTER = 421, FINALIZE = 422, FIRST_P = 423, FLOAT_P = 424, FOLLOWING = 425, FOR = 426, FORCE = 427, FOREIGN = 428, FORMAT = 429, FORWARD = 430, FREEZE = 431, FROM = 432, FULL = 433, FUNCTION = 434, FUNCTIONS = 435, GENERATED = 436, GLOBAL = 437, GRANT = 438, GRANTED = 439, GREATEST = 440, GROUP_P = 441, GROUPING = 442, GROUPS = 443, HANDLER = 444, HAVING = 445, HEADER_P = 446, HOLD = 447, HOUR_P = 448, IDENTITY_P = 449, IF_P = 450, ILIKE = 451, IMMEDIATE = 452, IMMUTABLE = 453, IMPLICIT_P = 454, IMPORT_P = 455, IN_P = 456, INCLUDE = 457, INCLUDING = 458, INCREMENT = 459, INDENT = 460, INDEX = 461, INDEXES = 462, INHERIT = 463, INHERITS = 464, INITIALLY = 465, INLINE_P = 466, INNER_P = 467, INOUT = 468, INPUT_P = 469, INSENSITIVE = 470, INSERT = 471, INSTEAD = 472, INT_P = 473, INTEGER = 474, INTERSECT = 475, INTERVAL = 476, INTO = 477, INVOKER = 478, IS = 479, ISNULL = 480, ISOLATION = 481, JOIN = 482, JSON = 483, JSON_ARRAY = 484, JSON_ARRAYAGG = 485, JSON_EXISTS = 486, JSON_OBJECT = 487, JSON_OBJECTAGG = 488, JSON_QUERY = 489, JSON_SCALAR = 490, JSON_SERIALIZE = 491, JSON_TABLE = 492, JSON_VALUE = 493, KEEP = 494, KEY = 495, KEYS = 496, LABEL = 497, LANGUAGE = 498, LARGE_P = 499, LAST_P = 500, LATERAL_P = 501, LEADING = 502, LEAKPROOF = 503, LEAST = 504, LEFT = 505, LEVEL = 506, LIKE = 507, LIMIT = 508, LISTEN = 509, LOAD = 510, LOCAL = 511, LOCALTIME = 512, LOCALTIMESTAMP = 513, LOCATION = 514, LOCK_P = 515, LOCKED = 516, LOGGED = 517, MAPPING = 518, MATCH = 519, MATCHED = 520, MATERIALIZED = 521, MAXVALUE = 522, MERGE = 523, MERGE_ACTION = 524, METHOD = 525, MINUTE_P = 526, MINVALUE = 527, MODE = 528, MONTH_P = 529, MOVE = 530, NAME_P = 531, NAMES = 532, NATIONAL = 533, NATURAL = 534, NCHAR = 535, NESTED = 536, NEW = 537, NEXT = 538, NFC = 539, NFD = 540, NFKC = 541, NFKD = 542, NO = 543, NONE = 544, NORMALIZE = 545, NORMALIZED = 546, NOT = 547, NOTHING = 548, NOTIFY = 549, NOTNULL = 550, NOWAIT = 551, NULL_P = 552, NULLIF = 553, NULLS_P = 554, NUMERIC = 555, OBJECT_P = 556, OF = 557, OFF = 558, OFFSET = 559, OIDS = 560, OLD = 561, OMIT = 562, ON = 563, ONLY = 564, OPERATOR = 565, OPTION = 566, OPTIONS = 567, OR = 568, ORDER = 569, ORDINALITY = 570, OTHERS = 571, OUT_P = 572, OUTER_P = 573, OVER = 574, OVERLAPS = 575, OVERLAY = 576, OVERRIDING = 577, OWNED = 578, OWNER = 579, PARALLEL = 580, PARAMETER = 581, PARSER = 582, PARTIAL = 583, PARTITION = 584, PASSING = 585, PASSWORD = 586, PATH = 587, PGPOOL = 588, PLACING = 589, PLAN = 590, PLANS = 591, POLICY = 592, POSITION = 593, PRECEDING = 594, PRECISION = 595, PRESERVE = 596, PREPARE = 597, PREPARED = 598, PRIMARY = 599, PRIOR = 600, PRIVILEGES = 601, PROCEDURAL = 602, PROCEDURE = 603, PROCEDURES = 604, PROGRAM = 605, PUBLICATION = 606, QUOTE = 607, QUOTES = 608, RANGE = 609, READ = 610, REAL = 611, REASSIGN = 612, RECHECK = 613, RECURSIVE = 614, REF_P = 615, REFERENCES = 616, REFERENCING = 617, REFRESH = 618, REINDEX = 619, RELATIVE_P = 620, RELEASE = 621, RENAME = 622, REPEATABLE = 623, REPLACE = 624, REPLICA = 625, RESET = 626, RESTART = 627, RESTRICT = 628, RETURN = 629, RETURNING = 630, RETURNS = 631, REVOKE = 632, RIGHT = 633, ROLE = 634, ROLLBACK = 635, ROLLUP = 636, ROUTINE = 637, ROUTINES = 638, ROW = 639, ROWS = 640, RULE = 641, SAVEPOINT = 642, SCALAR = 643, SCHEMA = 644, SCHEMAS = 645, SCROLL = 646, SEARCH = 647, SECOND_P = 648, SECURITY = 649, SELECT = 650, SEQUENCE = 651, SEQUENCES = 652, SERIALIZABLE = 653, SERVER = 654, SESSION = 655, SESSION_USER = 656, SET = 657, SETS = 658, SETOF = 659, SHARE = 660, SHOW = 661, SIMILAR = 662, SIMPLE = 663, SKIP = 664, SMALLINT = 665, SNAPSHOT = 666, SOME = 667, SOURCE = 668, SQL_P = 669, STABLE = 670, STANDALONE_P = 671, START = 672, STATEMENT = 673, STATISTICS = 674, STDIN = 675, STDOUT = 676, STORAGE = 677, STORED = 678, STRICT_P = 679, STRING_P = 680, STRIP_P = 681, SUBSCRIPTION = 682, SUBSTRING = 683, SUPPORT = 684, SYMMETRIC = 685, SYSID = 686, SYSTEM_P = 687, SYSTEM_USER = 688, TABLE = 689, TABLES = 690, TABLESAMPLE = 691, TABLESPACE = 692, TARGET = 693, TEMP = 694, TEMPLATE = 695, TEMPORARY = 696, TEXT_P = 697, THEN = 698, TIES = 699, TIME = 700, TIMESTAMP = 701, TO = 702, TRAILING = 703, TRANSACTION = 704, TRANSFORM = 705, TREAT = 706, TRIGGER = 707, TRIM = 708, TRUE_P = 709, TRUNCATE = 710, TRUSTED = 711, TYPE_P = 712, TYPES_P = 713, UESCAPE = 714, UNBOUNDED = 715, UNCONDITIONAL = 716, UNCOMMITTED = 717, UNENCRYPTED = 718, UNION = 719, UNIQUE = 720, UNKNOWN = 721, UNLISTEN = 722, UNLOGGED = 723, UNTIL = 724, UPDATE = 725, USER = 726, USING = 727, VACUUM = 728, VALID = 729, VALIDATE = 730, VALIDATOR = 731, VALUE_P = 732, VALUES = 733, VARCHAR = 734, VARIADIC = 735, VARYING = 736, VERBOSE = 737, VERSION_P = 738, VIEW = 739, VIEWS = 740, VOLATILE = 741, WHEN = 742, WHERE = 743, WHITESPACE_P = 744, WINDOW = 745, WITH = 746, WITHIN = 747, WITHOUT = 748, WORK = 749, WRAPPER = 750, WRITE = 751, XML_P = 752, XMLATTRIBUTES = 753, XMLCONCAT = 754, XMLELEMENT = 755, XMLEXISTS = 756, XMLFOREST = 757, XMLNAMESPACES = 758, XMLPARSE = 759, XMLPI = 760, XMLROOT = 761, XMLSERIALIZE = 762, XMLTABLE = 763, YEAR_P = 764, YES_P = 765, ZONE = 766, FORMAT_LA = 767, NOT_LA = 768, NULLS_LA = 769, WITH_LA = 770, WITHOUT_LA = 771, MODE_TYPE_NAME = 772, MODE_PLPGSQL_EXPR = 773, MODE_PLPGSQL_ASSIGN1 = 774, MODE_PLPGSQL_ASSIGN2 = 775, MODE_PLPGSQL_ASSIGN3 = 776, UMINUS = 777 }; #endif /* Tokens. */ #define IDENT 258 #define UIDENT 259 #define FCONST 260 #define SCONST 261 #define USCONST 262 #define BCONST 263 #define XCONST 264 #define Op 265 #define ICONST 266 #define PARAM 267 #define TYPECAST 268 #define DOT_DOT 269 #define COLON_EQUALS 270 #define EQUALS_GREATER 271 #define LESS_EQUALS 272 #define GREATER_EQUALS 273 #define NOT_EQUALS 274 #define ABORT_P 275 #define ABSENT 276 #define ABSOLUTE_P 277 #define ACCESS 278 #define ACTION 279 #define ADD_P 280 #define ADMIN 281 #define AFTER 282 #define AGGREGATE 283 #define ALL 284 #define ALSO 285 #define ALTER 286 #define ALWAYS 287 #define ANALYSE 288 #define ANALYZE 289 #define AND 290 #define ANY 291 #define ARRAY 292 #define AS 293 #define ASC 294 #define ASENSITIVE 295 #define ASSERTION 296 #define ASSIGNMENT 297 #define ASYMMETRIC 298 #define ATOMIC 299 #define AT 300 #define ATTACH 301 #define ATTRIBUTE 302 #define AUTHORIZATION 303 #define BACKWARD 304 #define BEFORE 305 #define BEGIN_P 306 #define BETWEEN 307 #define BIGINT 308 #define BINARY 309 #define BIT 310 #define BOOLEAN_P 311 #define BOTH 312 #define BREADTH 313 #define BY 314 #define CACHE 315 #define CALL 316 #define CALLED 317 #define CASCADE 318 #define CASCADED 319 #define CASE 320 #define CAST 321 #define CATALOG_P 322 #define CHAIN 323 #define CHAR_P 324 #define CHARACTER 325 #define CHARACTERISTICS 326 #define CHECK 327 #define CHECKPOINT 328 #define CLASS 329 #define CLOSE 330 #define CLUSTER 331 #define COALESCE 332 #define COLLATE 333 #define COLLATION 334 #define COLUMN 335 #define COLUMNS 336 #define COMMENT 337 #define COMMENTS 338 #define COMMIT 339 #define COMMITTED 340 #define COMPRESSION 341 #define CONCURRENTLY 342 #define CONDITIONAL 343 #define CONFIGURATION 344 #define CONFLICT 345 #define CONNECTION 346 #define CONSTRAINT 347 #define CONSTRAINTS 348 #define CONTENT_P 349 #define CONTINUE_P 350 #define CONVERSION_P 351 #define COPY 352 #define COST 353 #define CREATE 354 #define CROSS 355 #define CSV 356 #define CUBE 357 #define CURRENT_P 358 #define CURRENT_CATALOG 359 #define CURRENT_DATE 360 #define CURRENT_ROLE 361 #define CURRENT_SCHEMA 362 #define CURRENT_TIME 363 #define CURRENT_TIMESTAMP 364 #define CURRENT_USER 365 #define CURSOR 366 #define CYCLE 367 #define DATA_P 368 #define DATABASE 369 #define DAY_P 370 #define DEALLOCATE 371 #define DEC 372 #define DECIMAL_P 373 #define DECLARE 374 #define DEFAULT 375 #define DEFAULTS 376 #define DEFERRABLE 377 #define DEFERRED 378 #define DEFINER 379 #define DELETE_P 380 #define DELIMITER 381 #define DELIMITERS 382 #define DEPENDS 383 #define DEPTH 384 #define DESC 385 #define DETACH 386 #define DICTIONARY 387 #define DISABLE_P 388 #define DISCARD 389 #define DISTINCT 390 #define DO 391 #define DOCUMENT_P 392 #define DOMAIN_P 393 #define DOUBLE_P 394 #define DROP 395 #define EACH 396 #define ELSE 397 #define EMPTY_P 398 #define ENABLE_P 399 #define ENCODING 400 #define ENCRYPTED 401 #define END_P 402 #define ENUM_P 403 #define ERROR_P 404 #define ESCAPE 405 #define EVENT 406 #define EXCEPT 407 #define EXCLUDE 408 #define EXCLUDING 409 #define EXCLUSIVE 410 #define EXECUTE 411 #define EXISTS 412 #define EXPLAIN 413 #define EXPRESSION 414 #define EXTENSION 415 #define EXTERNAL 416 #define EXTRACT 417 #define FALSE_P 418 #define FAMILY 419 #define FETCH 420 #define FILTER 421 #define FINALIZE 422 #define FIRST_P 423 #define FLOAT_P 424 #define FOLLOWING 425 #define FOR 426 #define FORCE 427 #define FOREIGN 428 #define FORMAT 429 #define FORWARD 430 #define FREEZE 431 #define FROM 432 #define FULL 433 #define FUNCTION 434 #define FUNCTIONS 435 #define GENERATED 436 #define GLOBAL 437 #define GRANT 438 #define GRANTED 439 #define GREATEST 440 #define GROUP_P 441 #define GROUPING 442 #define GROUPS 443 #define HANDLER 444 #define HAVING 445 #define HEADER_P 446 #define HOLD 447 #define HOUR_P 448 #define IDENTITY_P 449 #define IF_P 450 #define ILIKE 451 #define IMMEDIATE 452 #define IMMUTABLE 453 #define IMPLICIT_P 454 #define IMPORT_P 455 #define IN_P 456 #define INCLUDE 457 #define INCLUDING 458 #define INCREMENT 459 #define INDENT 460 #define INDEX 461 #define INDEXES 462 #define INHERIT 463 #define INHERITS 464 #define INITIALLY 465 #define INLINE_P 466 #define INNER_P 467 #define INOUT 468 #define INPUT_P 469 #define INSENSITIVE 470 #define INSERT 471 #define INSTEAD 472 #define INT_P 473 #define INTEGER 474 #define INTERSECT 475 #define INTERVAL 476 #define INTO 477 #define INVOKER 478 #define IS 479 #define ISNULL 480 #define ISOLATION 481 #define JOIN 482 #define JSON 483 #define JSON_ARRAY 484 #define JSON_ARRAYAGG 485 #define JSON_EXISTS 486 #define JSON_OBJECT 487 #define JSON_OBJECTAGG 488 #define JSON_QUERY 489 #define JSON_SCALAR 490 #define JSON_SERIALIZE 491 #define JSON_TABLE 492 #define JSON_VALUE 493 #define KEEP 494 #define KEY 495 #define KEYS 496 #define LABEL 497 #define LANGUAGE 498 #define LARGE_P 499 #define LAST_P 500 #define LATERAL_P 501 #define LEADING 502 #define LEAKPROOF 503 #define LEAST 504 #define LEFT 505 #define LEVEL 506 #define LIKE 507 #define LIMIT 508 #define LISTEN 509 #define LOAD 510 #define LOCAL 511 #define LOCALTIME 512 #define LOCALTIMESTAMP 513 #define LOCATION 514 #define LOCK_P 515 #define LOCKED 516 #define LOGGED 517 #define MAPPING 518 #define MATCH 519 #define MATCHED 520 #define MATERIALIZED 521 #define MAXVALUE 522 #define MERGE 523 #define MERGE_ACTION 524 #define METHOD 525 #define MINUTE_P 526 #define MINVALUE 527 #define MODE 528 #define MONTH_P 529 #define MOVE 530 #define NAME_P 531 #define NAMES 532 #define NATIONAL 533 #define NATURAL 534 #define NCHAR 535 #define NESTED 536 #define NEW 537 #define NEXT 538 #define NFC 539 #define NFD 540 #define NFKC 541 #define NFKD 542 #define NO 543 #define NONE 544 #define NORMALIZE 545 #define NORMALIZED 546 #define NOT 547 #define NOTHING 548 #define NOTIFY 549 #define NOTNULL 550 #define NOWAIT 551 #define NULL_P 552 #define NULLIF 553 #define NULLS_P 554 #define NUMERIC 555 #define OBJECT_P 556 #define OF 557 #define OFF 558 #define OFFSET 559 #define OIDS 560 #define OLD 561 #define OMIT 562 #define ON 563 #define ONLY 564 #define OPERATOR 565 #define OPTION 566 #define OPTIONS 567 #define OR 568 #define ORDER 569 #define ORDINALITY 570 #define OTHERS 571 #define OUT_P 572 #define OUTER_P 573 #define OVER 574 #define OVERLAPS 575 #define OVERLAY 576 #define OVERRIDING 577 #define OWNED 578 #define OWNER 579 #define PARALLEL 580 #define PARAMETER 581 #define PARSER 582 #define PARTIAL 583 #define PARTITION 584 #define PASSING 585 #define PASSWORD 586 #define PATH 587 #define PGPOOL 588 #define PLACING 589 #define PLAN 590 #define PLANS 591 #define POLICY 592 #define POSITION 593 #define PRECEDING 594 #define PRECISION 595 #define PRESERVE 596 #define PREPARE 597 #define PREPARED 598 #define PRIMARY 599 #define PRIOR 600 #define PRIVILEGES 601 #define PROCEDURAL 602 #define PROCEDURE 603 #define PROCEDURES 604 #define PROGRAM 605 #define PUBLICATION 606 #define QUOTE 607 #define QUOTES 608 #define RANGE 609 #define READ 610 #define REAL 611 #define REASSIGN 612 #define RECHECK 613 #define RECURSIVE 614 #define REF_P 615 #define REFERENCES 616 #define REFERENCING 617 #define REFRESH 618 #define REINDEX 619 #define RELATIVE_P 620 #define RELEASE 621 #define RENAME 622 #define REPEATABLE 623 #define REPLACE 624 #define REPLICA 625 #define RESET 626 #define RESTART 627 #define RESTRICT 628 #define RETURN 629 #define RETURNING 630 #define RETURNS 631 #define REVOKE 632 #define RIGHT 633 #define ROLE 634 #define ROLLBACK 635 #define ROLLUP 636 #define ROUTINE 637 #define ROUTINES 638 #define ROW 639 #define ROWS 640 #define RULE 641 #define SAVEPOINT 642 #define SCALAR 643 #define SCHEMA 644 #define SCHEMAS 645 #define SCROLL 646 #define SEARCH 647 #define SECOND_P 648 #define SECURITY 649 #define SELECT 650 #define SEQUENCE 651 #define SEQUENCES 652 #define SERIALIZABLE 653 #define SERVER 654 #define SESSION 655 #define SESSION_USER 656 #define SET 657 #define SETS 658 #define SETOF 659 #define SHARE 660 #define SHOW 661 #define SIMILAR 662 #define SIMPLE 663 #define SKIP 664 #define SMALLINT 665 #define SNAPSHOT 666 #define SOME 667 #define SOURCE 668 #define SQL_P 669 #define STABLE 670 #define STANDALONE_P 671 #define START 672 #define STATEMENT 673 #define STATISTICS 674 #define STDIN 675 #define STDOUT 676 #define STORAGE 677 #define STORED 678 #define STRICT_P 679 #define STRING_P 680 #define STRIP_P 681 #define SUBSCRIPTION 682 #define SUBSTRING 683 #define SUPPORT 684 #define SYMMETRIC 685 #define SYSID 686 #define SYSTEM_P 687 #define SYSTEM_USER 688 #define TABLE 689 #define TABLES 690 #define TABLESAMPLE 691 #define TABLESPACE 692 #define TARGET 693 #define TEMP 694 #define TEMPLATE 695 #define TEMPORARY 696 #define TEXT_P 697 #define THEN 698 #define TIES 699 #define TIME 700 #define TIMESTAMP 701 #define TO 702 #define TRAILING 703 #define TRANSACTION 704 #define TRANSFORM 705 #define TREAT 706 #define TRIGGER 707 #define TRIM 708 #define TRUE_P 709 #define TRUNCATE 710 #define TRUSTED 711 #define TYPE_P 712 #define TYPES_P 713 #define UESCAPE 714 #define UNBOUNDED 715 #define UNCONDITIONAL 716 #define UNCOMMITTED 717 #define UNENCRYPTED 718 #define UNION 719 #define UNIQUE 720 #define UNKNOWN 721 #define UNLISTEN 722 #define UNLOGGED 723 #define UNTIL 724 #define UPDATE 725 #define USER 726 #define USING 727 #define VACUUM 728 #define VALID 729 #define VALIDATE 730 #define VALIDATOR 731 #define VALUE_P 732 #define VALUES 733 #define VARCHAR 734 #define VARIADIC 735 #define VARYING 736 #define VERBOSE 737 #define VERSION_P 738 #define VIEW 739 #define VIEWS 740 #define VOLATILE 741 #define WHEN 742 #define WHERE 743 #define WHITESPACE_P 744 #define WINDOW 745 #define WITH 746 #define WITHIN 747 #define WITHOUT 748 #define WORK 749 #define WRAPPER 750 #define WRITE 751 #define XML_P 752 #define XMLATTRIBUTES 753 #define XMLCONCAT 754 #define XMLELEMENT 755 #define XMLEXISTS 756 #define XMLFOREST 757 #define XMLNAMESPACES 758 #define XMLPARSE 759 #define XMLPI 760 #define XMLROOT 761 #define XMLSERIALIZE 762 #define XMLTABLE 763 #define YEAR_P 764 #define YES_P 765 #define ZONE 766 #define FORMAT_LA 767 #define NOT_LA 768 #define NULLS_LA 769 #define WITH_LA 770 #define WITHOUT_LA 771 #define MODE_TYPE_NAME 772 #define MODE_PLPGSQL_EXPR 773 #define MODE_PLPGSQL_ASSIGN1 774 #define MODE_PLPGSQL_ASSIGN2 775 #define MODE_PLPGSQL_ASSIGN3 776 #define UMINUS 777 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 263 "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; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; StatsElem *selem; 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; PublicationObjSpec *publicationobjectspec; struct SelectLimit *selectlimit; SetQuantifier setquantifier; struct GroupClause *groupclause; MergeMatchKind mergematch; MergeWhenClause *mergewhen; struct KeyActions *keyactions; struct KeyAction *keyaction; #line 1461 "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_GRAM_MINIMAL_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 1491 "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 933 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 122895 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 540 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 730 /* YYNRULES -- Number of rules. */ #define YYNRULES 3412 /* YYNSTATES -- Number of states. */ #define YYNSTATES 6471 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 777 #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, 529, 2, 2, 534, 535, 527, 525, 538, 526, 536, 528, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 539, 537, 522, 524, 523, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 532, 2, 533, 530, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 531 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 955, 955, 960, 964, 969, 977, 985, 1005, 1017, 1031, 1032, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1161, 1168, 1169, 1173, 1174, 1178, 1179, 1183, 1184, 1185, 1194, 1210, 1222, 1223, 1224, 1233, 1234, 1238, 1239, 1243, 1248, 1252, 1262, 1270, 1274, 1278, 1283, 1287, 1335, 1337, 1341, 1345, 1349, 1353, 1367, 1386, 1395, 1407, 1408, 1412, 1421, 1430, 1439, 1461, 1469, 1477, 1485, 1493, 1501, 1519, 1538, 1550, 1551, 1562, 1573, 1584, 1600, 1619, 1626, 1634, 1635, 1636, 1637, 1638, 1639, 1653, 1660, 1667, 1674, 1684, 1693, 1702, 1706, 1715, 1724, 1732, 1743, 1744, 1753, 1765, 1773, 1782, 1794, 1803, 1812, 1820, 1830, 1841, 1842, 1846, 1847, 1850, 1852, 1856, 1857, 1858, 1859, 1863, 1864, 1865, 1871, 1883, 1887, 1891, 1908, 1916, 1917, 1918, 1922, 1923, 1924, 1928, 1929, 1933, 1934, 1943, 1944, 1952, 1960, 1971, 1979, 1990, 1991, 1996, 1997, 2003, 2009, 2015, 2022, 2029, 2036, 2043, 2054, 2065, 2066, 2070, 2071, 2079, 2095, 2102, 2109, 2116, 2123, 2143, 2153, 2163, 2173, 2183, 2195, 2207, 2217, 2227, 2237, 2249, 2261, 2271, 2281, 2291, 2301, 2311, 2321, 2333, 2345, 2355, 2368, 2369, 2374, 2388, 2401, 2417, 2434, 2444, 2454, 2464, 2474, 2484, 2493, 2502, 2512, 2521, 2531, 2541, 2557, 2567, 2577, 2587, 2597, 2614, 2624, 2634, 2644, 2655, 2669, 2685, 2694, 2703, 2718, 2727, 2738, 2749, 2757, 2766, 2775, 2783, 2791, 2800, 2809, 2818, 2826, 2834, 2843, 2851, 2859, 2868, 2877, 2886, 2895, 2904, 2913, 2924, 2932, 2941, 2950, 2959, 2968, 2977, 2986, 2994, 3002, 3010, 3017, 3028, 3029, 3033, 3042, 3046, 3047, 3051, 3059, 3067, 3075, 3086, 3089, 3090, 3094, 3095, 3100, 3104, 3108, 3113, 3120, 3122, 3127, 3131, 3135, 3146, 3153, 3154, 3158, 3159, 3164, 3217, 3230, 3244, 3256, 3263, 3267, 3281, 3294, 3295, 3300, 3310, 3321, 3332, 3359, 3366, 3400, 3436, 3459, 3460, 3464, 3465, 3474, 3475, 3476, 3479, 3480, 3485, 3486, 3490, 3494, 3498, 3502, 3506, 3510, 3514, 3518, 3522, 3526, 3530, 3534, 3538, 3542, 3546, 3555, 3559, 3563, 3567, 3571, 3572, 3577, 3581, 3588, 3595, 3596, 3597, 3598, 3599, 3600, 3604, 3608, 3616, 3627, 3647, 3667, 3688, 3709, 3730, 3764, 3765, 3766, 3767, 3768, 3775, 3782, 3783, 3787, 3788, 3792, 3793, 3797, 3801, 3808, 3812, 3819, 3820, 3821, 3825, 3826, 3829, 3853, 3872, 3894, 3895, 3899, 3900, 3904, 3905, 3909, 3910, 3914, 3915, 3919, 3927, 3928, 3929, 3961, 3969, 3977, 3990, 4002, 4015, 4027, 4037, 4061, 4081, 4082, 4083, 4087, 4088, 4107, 4115, 4123, 4131, 4143, 4155, 4156, 4157, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4179, 4187, 4191, 4205, 4223, 4239, 4256, 4272, 4292, 4327, 4335, 4339, 4353, 4369, 4370, 4374, 4375, 4379, 4380, 4383, 4389, 4390, 4393, 4397, 4405, 4410, 4416, 4417, 4421, 4426, 4433, 4434, 4438, 4448, 4458, 4466, 4475, 4488, 4500, 4507, 4515, 4523, 4531, 4539, 4549, 4550, 4554, 4555, 4558, 4570, 4571, 4574, 4585, 4596, 4610, 4611, 4616, 4617, 4618, 4621, 4622, 4623, 4624, 4627, 4628, 4631, 4632, 4635, 4655, 4668, 4690, 4691, 4694, 4700, 4706, 4723, 4732, 4754, 4768, 4785, 4801, 4802, 4803, 4815, 4829, 4846, 4860, 4861, 4873, 4894, 4905, 4919, 4928, 4940, 4941, 4944, 4945, 4948, 4949, 4952, 4956, 4960, 4964, 4968, 4972, 4976, 4980, 4984, 4988, 4992, 4997, 5001, 5005, 5011, 5012, 5016, 5017, 5018, 5025, 5028, 5029, 5041, 5057, 5073, 5074, 5082, 5083, 5087, 5088, 5092, 5093, 5097, 5098, 5102, 5103, 5113, 5125, 5126, 5139, 5147, 5165, 5174, 5186, 5189, 5193, 5197, 5201, 5208, 5220, 5231, 5234, 5238, 5251, 5261, 5271, 5281, 5291, 5301, 5311, 5321, 5331, 5341, 5351, 5361, 5371, 5390, 5402, 5403, 5404, 5405, 5409, 5410, 5414, 5415, 5425, 5434, 5447, 5448, 5452, 5456, 5464, 5468, 5472, 5479, 5483, 5488, 5493, 5500, 5507, 5512, 5522, 5535, 5551, 5552, 5557, 5558, 5562, 5563, 5573, 5583, 5592, 5610, 5631, 5652, 5674, 5708, 5724, 5725, 5729, 5738, 5753, 5763, 5776, 5777, 5789, 5798, 5816, 5841, 5859, 5874, 5875, 5879, 5880, 5884, 5885, 5889, 5890, 5894, 5908, 5912, 5913, 5917, 5918, 5919, 5920, 5921, 5931, 5943, 5944, 5955, 5978, 6010, 6011, 6012, 6016, 6018, 6040, 6042, 6044, 6046, 6048, 6053, 6054, 6058, 6059, 6063, 6075, 6076, 6080, 6089, 6093, 6097, 6102, 6112, 6113, 6117, 6118, 6122, 6123, 6127, 6128, 6132, 6133, 6134, 6138, 6142, 6143, 6144, 6148, 6149, 6154, 6155, 6182, 6183, 6184, 6185, 6186, 6187, 6200, 6211, 6226, 6228, 6233, 6238, 6240, 6245, 6256, 6257, 6258, 6259, 6270, 6289, 6301, 6314, 6325, 6336, 6348, 6357, 6365, 6373, 6383, 6393, 6403, 6413, 6423, 6434, 6444, 6457, 6460, 6461, 6464, 6468, 6475, 6476, 6477, 6478, 6479, 6480, 6483, 6486, 6487, 6495, 6502, 6503, 6506, 6508, 6519, 6531, 6543, 6555, 6567, 6596, 6597, 6613, 6629, 6630, 6634, 6647, 6658, 6667, 6677, 6687, 6688, 6691, 6692, 6695, 6696, 6697, 6700, 6714, 6719, 6730, 6740, 6753, 6754, 6758, 6767, 6780, 6791, 6805, 6816, 6839, 6850, 6869, 6880, 6891, 6902, 6913, 6924, 6935, 6946, 6957, 6968, 6979, 6990, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7027, 7028, 7029, 7030, 7031, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7047, 7048, 7049, 7053, 7054, 7057, 7058, 7061, 7063, 7068, 7069, 7080, 7092, 7093, 7094, 7104, 7113, 7122, 7131, 7140, 7149, 7158, 7167, 7176, 7185, 7199, 7208, 7217, 7226, 7235, 7244, 7253, 7262, 7274, 7275, 7289, 7300, 7311, 7322, 7333, 7344, 7355, 7366, 7377, 7388, 7401, 7402, 7405, 7406, 7416, 7423, 7432, 7441, 7450, 7459, 7468, 7477, 7486, 7495, 7504, 7513, 7522, 7531, 7540, 7549, 7558, 7567, 7578, 7579, 7582, 7583, 7593, 7611, 7627, 7655, 7657, 7659, 7661, 7669, 7679, 7680, 7683, 7691, 7699, 7707, 7714, 7725, 7729, 7736, 7740, 7751, 7760, 7769, 7778, 7787, 7796, 7805, 7814, 7823, 7832, 7841, 7850, 7859, 7867, 7876, 7885, 7894, 7903, 7912, 7921, 7930, 7943, 7944, 7948, 7949, 7954, 7955, 7965, 7976, 7990, 8002, 8020, 8021, 8025, 8032, 8033, 8034, 8037, 8038, 8048, 8059, 8060, 8064, 8068, 8072, 8083, 8097, 8112, 8130, 8131, 8132, 8133, 8134, 8135, 8147, 8179, 8214, 8215, 8219, 8220, 8223, 8224, 8229, 8241, 8260, 8265, 8270, 8277, 8278, 8281, 8282, 8285, 8286, 8290, 8291, 8292, 8295, 8296, 8297, 8313, 8327, 8342, 8356, 8373, 8374, 8377, 8378, 8382, 8383, 8387, 8388, 8393, 8407, 8415, 8423, 8439, 8440, 8444, 8445, 8460, 8470, 8480, 8490, 8500, 8513, 8514, 8515, 8516, 8517, 8523, 8527, 8542, 8543, 8549, 8559, 8563, 8568, 8576, 8618, 8622, 8626, 8630, 8638, 8639, 8643, 8655, 8656, 8661, 8662, 8667, 8668, 8675, 8679, 8683, 8687, 8691, 8695, 8699, 8703, 8707, 8711, 8715, 8719, 8723, 8727, 8731, 8735, 8740, 8747, 8751, 8755, 8759, 8763, 8769, 8770, 8776, 8786, 8790, 8801, 8807, 8816, 8822, 8823, 8827, 8828, 8832, 8833, 8836, 8849, 8853, 8868, 8877, 8886, 8899, 8900, 8905, 8906, 8923, 8934, 8945, 8956, 8967, 8978, 8992, 9003, 9017, 9028, 9042, 9050, 9052, 9054, 9059, 9061, 9066, 9067, 9072, 9091, 9101, 9102, 9106, 9110, 9122, 9134, 9146, 9160, 9161, 9162, 9166, 9179, 9180, 9190, 9203, 9207, 9211, 9215, 9222, 9244, 9257, 9270, 9285, 9286, 9289, 9290, 9293, 9294, 9304, 9314, 9332, 9342, 9352, 9362, 9372, 9382, 9392, 9402, 9412, 9422, 9432, 9442, 9452, 9463, 9474, 9484, 9494, 9504, 9514, 9524, 9534, 9545, 9556, 9567, 9578, 9589, 9600, 9611, 9622, 9633, 9644, 9655, 9666, 9678, 9690, 9702, 9714, 9726, 9738, 9749, 9760, 9772, 9784, 9795, 9806, 9815, 9825, 9835, 9845, 9855, 9865, 9875, 9885, 9895, 9905, 9920, 9921, 9924, 9925, 9935, 9945, 9955, 9965, 9976, 9986, 9998, 9999, 10009, 10019, 10029, 10039, 10049, 10059, 10069, 10079, 10089, 10099, 10109, 10119, 10129, 10139, 10149, 10159, 10169, 10179, 10189, 10199, 10209, 10219, 10229, 10239, 10249, 10259, 10269, 10288, 10298, 10299, 10302, 10304, 10306, 10312, 10313, 10314, 10315, 10316, 10328, 10344, 10353, 10362, 10371, 10380, 10389, 10398, 10407, 10416, 10425, 10434, 10443, 10452, 10461, 10470, 10479, 10488, 10497, 10506, 10515, 10524, 10533, 10542, 10551, 10579, 10587, 10596, 10622, 10631, 10638, 10644, 10671, 10682, 10691, 10699, 10701, 10723, 10731, 10741, 10751, 10770, 10789, 10799, 10809, 10819, 10830, 10841, 10852, 10863, 10874, 10892, 10901, 10918, 10936, 10937, 10938, 10943, 10949, 10958, 10959, 10960, 10961, 10962, 10966, 10967, 10970, 10971, 10972, 10973, 10977, 10978, 10979, 10991, 11002, 11003, 11006, 11016, 11023, 11043, 11053, 11062, 11072, 11082, 11091, 11100, 11109, 11118, 11127, 11136, 11145, 11157, 11166, 11178, 11179, 11180, 11184, 11187, 11190, 11193, 11196, 11203, 11205, 11207, 11212, 11214, 11218, 11219, 11220, 11232, 11246, 11260, 11279, 11301, 11302, 11303, 11304, 11314, 11331, 11342, 11343, 11347, 11348, 11352, 11356, 11360, 11378, 11379, 11380, 11381, 11382, 11383, 11384, 11391, 11392, 11403, 11411, 11419, 11428, 11438, 11456, 11465, 11474, 11483, 11495, 11499, 11510, 11522, 11540, 11547, 11564, 11578, 11588, 11597, 11606, 11616, 11628, 11640, 11651, 11652, 11663, 11674, 11686, 11698, 11710, 11722, 11732, 11745, 11746, 11760, 11784, 11793, 11803, 11815, 11827, 11841, 11842, 11854, 11875, 11886, 11898, 11910, 11914, 11921, 11922, 11926, 11933, 11934, 11935, 11939, 11940, 11941, 11945, 11946, 11950, 11951, 11954, 11955, 11958, 11959, 11963, 11964, 11968, 11975, 11977, 11982, 11983, 11996, 12004, 12015, 12023, 12034, 12035, 12036, 12037, 12038, 12039, 12040, 12041, 12042, 12043, 12053, 12064, 12065, 12069, 12070, 12071, 12072, 12073, 12083, 12091, 12109, 12129, 12130, 12140, 12149, 12158, 12167, 12186, 12197, 12218, 12222, 12230, 12236, 12243, 12249, 12256, 12265, 12266, 12270, 12272, 12277, 12288, 12298, 12308, 12314, 12323, 12332, 12338, 12339, 12350, 12365, 12366, 12377, 12388, 12389, 12392, 12393, 12394, 12395, 12396, 12397, 12398, 12399, 12402, 12403, 12407, 12408, 12409, 12420, 12437, 12452, 12453, 12457, 12462, 12486, 12497, 12498, 12510, 12530, 12531, 12541, 12548, 12555, 12562, 12572, 12585, 12586, 12590, 12591, 12595, 12596, 12600, 12613, 12626, 12635, 12644, 12653, 12662, 12674, 12686, 12698, 12701, 12702, 12703, 12704, 12705, 12706, 12709, 12710, 12711, 12759, 12760, 12764, 12765, 12780, 12781, 12788, 12796, 12804, 12812, 12820, 12828, 12839, 12840, 12872, 12888, 12905, 12906, 12925, 12929, 12933, 12948, 12955, 12962, 12972, 12973, 12976, 12992, 12993, 12994, 12998, 13008, 13019, 13025, 13037, 13050, 13056, 13057, 13061, 13073, 13081, 13086, 13091, 13096, 13101, 13109, 13117, 13122, 13127, 13134, 13135, 13139, 13140, 13141, 13148, 13149, 13153, 13154, 13158, 13159, 13163, 13164, 13168, 13172, 13173, 13176, 13185, 13198, 13203, 13208, 13212, 13224, 13225, 13229, 13238, 13254, 13263, 13272, 13281, 13293, 13296, 13301, 13302, 13310, 13330, 13331, 13333, 13338, 13339, 13343, 13344, 13347, 13348, 13373, 13382, 13392, 13393, 13397, 13398, 13399, 13400, 13401, 13405, 13418, 13425, 13432, 13439, 13440, 13444, 13445, 13449, 13450, 13454, 13455, 13459, 13471, 13472, 13473, 13474, 13478, 13479, 13489, 13496, 13515, 13516, 13520, 13521, 13527, 13532, 13541, 13549, 13558, 13565, 13573, 13582, 13591, 13595, 13600, 13607, 13636, 13640, 13654, 13675, 13697, 13710, 13727, 13733, 13738, 13744, 13751, 13752, 13762, 13768, 13776, 13780, 13784, 13791, 13799, 13804, 13805, 13806, 13807, 13811, 13812, 13827, 13831, 13839, 13846, 13853, 13860, 13867, 13878, 13879, 13892, 13896, 13904, 13918, 13932, 13933, 13948, 13959, 13972, 13977, 13978, 13981, 13982, 13985, 13986, 13991, 13992, 13997, 13998, 14007, 14012, 14013, 14017, 14021, 14027, 14052, 14063, 14077, 14078, 14082, 14096, 14153, 14167, 14169, 14174, 14176, 14178, 14180, 14182, 14187, 14189, 14194, 14202, 14213, 14241, 14242, 14246, 14248, 14253, 14262, 14282, 14302, 14320, 14332, 14347, 14348, 14352, 14355, 14368, 14373, 14380, 14385, 14391, 14396, 14405, 14407, 14410, 14414, 14415, 14416, 14417, 14418, 14419, 14424, 14430, 14445, 14446, 14447, 14448, 14449, 14460, 14466, 14474, 14475, 14481, 14486, 14491, 14496, 14501, 14506, 14511, 14516, 14522, 14528, 14534, 14541, 14563, 14572, 14576, 14584, 14588, 14596, 14608, 14629, 14633, 14639, 14643, 14656, 14664, 14674, 14676, 14678, 14680, 14682, 14684, 14689, 14690, 14697, 14706, 14714, 14723, 14734, 14742, 14743, 14744, 14748, 14750, 14752, 14754, 14756, 14758, 14760, 14765, 14770, 14776, 14784, 14789, 14796, 14803, 14807, 14811, 14819, 14854, 14855, 14857, 14866, 14873, 14889, 14891, 14893, 14895, 14897, 14899, 14901, 14903, 14905, 14907, 14909, 14911, 14913, 14915, 14918, 14920, 14923, 14925, 14927, 14929, 14932, 14937, 14946, 14951, 14960, 14965, 14974, 14979, 14989, 14998, 15007, 15016, 15035, 15044, 15053, 15062, 15071, 15088, 15097, 15106, 15115, 15124, 15133, 15142, 15146, 15150, 15158, 15166, 15174, 15182, 15203, 15226, 15238, 15245, 15261, 15266, 15272, 15279, 15286, 15294, 15302, 15319, 15338, 15364, 15366, 15368, 15370, 15372, 15374, 15376, 15378, 15380, 15382, 15384, 15386, 15388, 15390, 15392, 15394, 15396, 15398, 15400, 15404, 15408, 15413, 15429, 15430, 15431, 15448, 15461, 15463, 15465, 15477, 15502, 15514, 15526, 15534, 15545, 15556, 15566, 15572, 15581, 15591, 15601, 15614, 15624, 15655, 15691, 15701, 15712, 15713, 15714, 15721, 15728, 15732, 15736, 15740, 15744, 15748, 15752, 15756, 15760, 15764, 15768, 15772, 15776, 15783, 15787, 15791, 15795, 15797, 15804, 15811, 15818, 15825, 15836, 15850, 15860, 15871, 15887, 15897, 15904, 15911, 15918, 15922, 15930, 15939, 15948, 15952, 15956, 15960, 15964, 15968, 15977, 15981, 15991, 15995, 15999, 16004, 16015, 16021, 16035, 16046, 16060, 16076, 16088, 16098, 16107, 16116, 16124, 16146, 16162, 16186, 16188, 16192, 16194, 16196, 16199, 16202, 16205, 16206, 16209, 16217, 16227, 16228, 16231, 16232, 16233, 16236, 16237, 16238, 16243, 16247, 16251, 16255, 16262, 16263, 16271, 16272, 16276, 16277, 16285, 16286, 16290, 16291, 16296, 16305, 16307, 16322, 16325, 16353, 16354, 16357, 16358, 16366, 16374, 16382, 16391, 16401, 16419, 16465, 16474, 16483, 16492, 16501, 16513, 16514, 16515, 16516, 16517, 16531, 16532, 16533, 16536, 16537, 16540, 16543, 16544, 16545, 16548, 16549, 16552, 16553, 16554, 16555, 16556, 16557, 16558, 16559, 16560, 16561, 16562, 16563, 16566, 16568, 16573, 16575, 16580, 16582, 16584, 16586, 16588, 16590, 16602, 16606, 16613, 16617, 16623, 16627, 16637, 16649, 16650, 16653, 16654, 16657, 16661, 16665, 16671, 16672, 16677, 16687, 16688, 16689, 16690, 16691, 16692, 16693, 16694, 16698, 16699, 16700, 16701, 16706, 16711, 16720, 16741, 16745, 16750, 16761, 16778, 16784, 16785, 16786, 16789, 16797, 16807, 16822, 16823, 16827, 16839, 16840, 16843, 16844, 16847, 16851, 16858, 16862, 16866, 16875, 16887, 16888, 16892, 16893, 16897, 16898, 16901, 16902, 16907, 16908, 16912, 16913, 16917, 16929, 16930, 16931, 16932, 16933, 16934, 16935, 16936, 16937, 16941, 16943, 16948, 16949, 16950, 16951, 16952, 16953, 16954, 16956, 16960, 16962, 16964, 16967, 16971, 16974, 16978, 16987, 17004, 17011, 17016, 17022, 17023, 17024, 17025, 17026, 17030, 17039, 17053, 17054, 17055, 17056, 17057, 17066, 17067, 17068, 17069, 17070, 17074, 17076, 17086, 17089, 17095, 17096, 17097, 17101, 17102, 17103, 17107, 17108, 17112, 17130, 17150, 17151, 17160, 17161, 17165, 17166, 17169, 17177, 17185, 17193, 17216, 17217, 17228, 17232, 17238, 17240, 17245, 17247, 17249, 17259, 17261, 17272, 17276, 17280, 17284, 17288, 17297, 17305, 17337, 17341, 17348, 17356, 17360, 17364, 17370, 17371, 17373, 17374, 17375, 17379, 17420, 17448, 17452, 17456, 17462, 17464, 17478, 17514, 17527, 17528, 17531, 17532, 17549, 17550, 17551, 17556, 17557, 17558, 17563, 17564, 17565, 17566, 17572, 17573, 17574, 17575, 17576, 17582, 17583, 17603, 17604, 17605, 17606, 17607, 17608, 17609, 17610, 17611, 17612, 17613, 17614, 17615, 17616, 17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630, 17631, 17632, 17633, 17634, 17635, 17636, 17637, 17638, 17639, 17640, 17641, 17642, 17643, 17644, 17645, 17646, 17647, 17648, 17649, 17650, 17651, 17652, 17653, 17654, 17655, 17656, 17657, 17658, 17659, 17660, 17661, 17662, 17663, 17664, 17665, 17666, 17667, 17668, 17669, 17670, 17671, 17672, 17673, 17674, 17675, 17676, 17677, 17678, 17679, 17680, 17681, 17682, 17683, 17684, 17685, 17686, 17687, 17688, 17689, 17690, 17691, 17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17701, 17702, 17703, 17704, 17705, 17706, 17707, 17708, 17709, 17710, 17711, 17712, 17713, 17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 17722, 17723, 17724, 17725, 17726, 17727, 17728, 17729, 17730, 17731, 17732, 17733, 17734, 17735, 17736, 17737, 17738, 17739, 17740, 17741, 17742, 17743, 17744, 17745, 17746, 17747, 17748, 17749, 17750, 17751, 17752, 17753, 17754, 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770, 17771, 17772, 17773, 17774, 17775, 17776, 17777, 17778, 17779, 17780, 17781, 17782, 17783, 17784, 17785, 17786, 17787, 17788, 17789, 17790, 17791, 17792, 17793, 17794, 17795, 17796, 17797, 17798, 17799, 17800, 17801, 17802, 17803, 17804, 17805, 17806, 17807, 17808, 17809, 17810, 17811, 17812, 17813, 17814, 17815, 17816, 17817, 17818, 17819, 17820, 17821, 17822, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830, 17831, 17832, 17833, 17834, 17835, 17836, 17837, 17838, 17839, 17840, 17841, 17842, 17843, 17844, 17845, 17846, 17847, 17848, 17849, 17850, 17851, 17852, 17853, 17854, 17855, 17856, 17857, 17858, 17859, 17860, 17861, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880, 17881, 17882, 17883, 17884, 17885, 17886, 17887, 17888, 17889, 17890, 17891, 17892, 17893, 17894, 17895, 17896, 17897, 17898, 17899, 17900, 17901, 17902, 17903, 17904, 17905, 17906, 17907, 17908, 17909, 17910, 17911, 17912, 17913, 17914, 17915, 17916, 17917, 17918, 17919, 17920, 17921, 17922, 17923, 17924, 17925, 17926, 17927, 17928, 17929, 17943, 17944, 17945, 17946, 17947, 17948, 17949, 17950, 17951, 17952, 17953, 17954, 17955, 17956, 17957, 17958, 17959, 17960, 17961, 17962, 17963, 17964, 17965, 17966, 17967, 17968, 17969, 17970, 17971, 17972, 17973, 17974, 17975, 17976, 17977, 17978, 17979, 17980, 17981, 17982, 17983, 17984, 17985, 17986, 17987, 17988, 17989, 17990, 17991, 17992, 17993, 17994, 17995, 17996, 17997, 17998, 17999, 18000, 18001, 18002, 18003, 18004, 18005, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 18041, 18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089, 18090, 18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18109, 18110, 18111, 18112, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 18121, 18122, 18123, 18124, 18125, 18126, 18127, 18128, 18141, 18142, 18143, 18144, 18145, 18146, 18147, 18148, 18149, 18150, 18151, 18152, 18153, 18154, 18155, 18156, 18157, 18158, 18159, 18160, 18161, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200, 18201, 18202, 18203, 18204, 18205, 18206, 18207, 18208, 18209, 18210, 18211, 18212, 18213, 18214, 18215, 18216, 18217, 18218, 18219, 18220, 18221, 18222, 18223, 18224, 18225, 18226, 18227, 18228, 18229, 18230, 18231, 18232, 18233, 18234, 18235, 18236, 18237, 18238, 18239, 18240, 18241, 18242, 18243, 18244, 18245, 18246, 18247, 18248, 18249, 18250, 18251, 18252, 18253, 18254, 18255, 18256, 18257, 18258, 18259, 18260, 18261, 18262, 18263, 18264, 18265, 18266, 18267, 18268, 18269, 18270, 18271, 18272, 18273, 18274, 18275, 18276, 18277, 18278, 18279, 18280, 18281, 18282, 18283, 18284, 18285, 18286, 18287, 18288, 18289, 18290, 18291, 18292, 18293, 18294, 18295, 18296, 18297, 18298, 18299, 18300, 18301, 18302, 18303, 18304, 18305, 18306, 18307, 18308, 18309, 18310, 18311, 18312, 18313, 18314, 18315, 18316, 18317, 18318, 18319, 18320, 18321, 18322, 18323, 18324, 18325, 18326, 18327, 18328, 18329, 18330, 18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 18340, 18341, 18342, 18343, 18344, 18345, 18346, 18347, 18348, 18349, 18350, 18351, 18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361, 18362, 18363, 18364, 18365, 18366, 18367, 18368, 18369, 18370, 18371, 18372, 18373, 18374, 18375, 18376, 18377, 18378, 18379, 18380, 18381, 18382, 18383, 18384, 18385, 18386, 18387, 18388, 18389, 18390, 18391, 18392, 18393, 18394, 18395, 18396, 18397, 18398, 18399, 18400, 18401, 18402, 18403, 18404, 18405, 18406, 18407, 18408, 18409, 18410, 18411, 18412, 18413, 18414, 18415, 18416, 18417, 18418, 18419, 18420, 18421, 18422, 18423, 18424, 18425, 18426, 18427, 18428, 18429, 18430, 18431, 18432, 18433, 18434, 18435, 18436, 18437, 18438, 18439, 18440, 18441, 18442, 18443, 18444, 18445, 18446, 18447, 18448, 18449, 18450, 18451, 18452, 18453, 18454, 18455, 18456, 18457, 18458, 18459, 18460, 18461, 18462, 18463, 18464, 18465, 18466, 18467, 18468, 18469, 18470, 18471, 18472, 18473, 18474, 18475, 18476, 18477, 18478, 18479, 18480, 18481, 18482, 18483, 18484, 18485, 18486, 18487, 18488, 18489, 18490, 18491, 18492, 18493, 18494, 18495, 18496, 18497, 18498, 18499, 18500, 18501, 18502, 18503, 18504, 18505, 18506, 18507, 18508, 18509, 18510, 18511, 18512, 18513, 18514, 18515, 18516, 18517, 18518, 18519, 18520, 18521, 18522, 18523, 18524, 18525, 18526, 18527, 18528, 18529, 18530, 18531, 18532, 18533, 18534, 18535, 18536, 18537, 18538, 18539, 18540, 18541, 18542, 18543, 18544, 18545, 18546, 18547, 18548, 18549, 18550, 18551, 18552, 18553, 18554, 18555, 18556, 18557, 18558, 18559, 18560, 18561, 18562, 18563, 18564, 18565, 18566, 18567, 18568, 18569, 18570, 18571, 18572, 18573, 18574, 18575, 18576, 18577, 18578, 18579, 18580, 18581, 18582, 18583, 18584, 18585, 18586, 18587, 18588, 18589, 18590, 18591, 18592 }; #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", "UIDENT", "FCONST", "SCONST", "USCONST", "BCONST", "XCONST", "Op", "ICONST", "PARAM", "TYPECAST", "DOT_DOT", "COLON_EQUALS", "EQUALS_GREATER", "LESS_EQUALS", "GREATER_EQUALS", "NOT_EQUALS", "ABORT_P", "ABSENT", "ABSOLUTE_P", "ACCESS", "ACTION", "ADD_P", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANY", "ARRAY", "AS", "ASC", "ASENSITIVE", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "ATOMIC", "AT", "ATTACH", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BREADTH", "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", "COMPRESSION", "CONCURRENTLY", "CONDITIONAL", "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", "DEPTH", "DESC", "DETACH", "DICTIONARY", "DISABLE_P", "DISCARD", "DISTINCT", "DO", "DOCUMENT_P", "DOMAIN_P", "DOUBLE_P", "DROP", "EACH", "ELSE", "EMPTY_P", "ENABLE_P", "ENCODING", "ENCRYPTED", "END_P", "ENUM_P", "ERROR_P", "ESCAPE", "EVENT", "EXCEPT", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXECUTE", "EXISTS", "EXPLAIN", "EXPRESSION", "EXTENSION", "EXTERNAL", "EXTRACT", "FALSE_P", "FAMILY", "FETCH", "FILTER", "FINALIZE", "FIRST_P", "FLOAT_P", "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORMAT", "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", "INDENT", "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", "JSON", "JSON_ARRAY", "JSON_ARRAYAGG", "JSON_EXISTS", "JSON_OBJECT", "JSON_OBJECTAGG", "JSON_QUERY", "JSON_SCALAR", "JSON_SERIALIZE", "JSON_TABLE", "JSON_VALUE", "KEEP", "KEY", "KEYS", "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", "MATCHED", "MATERIALIZED", "MAXVALUE", "MERGE", "MERGE_ACTION", "METHOD", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NESTED", "NEW", "NEXT", "NFC", "NFD", "NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NORMALIZED", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", "OMIT", "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OTHERS", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNED", "OWNER", "PARALLEL", "PARAMETER", "PARSER", "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PATH", "PGPOOL", "PLACING", "PLAN", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "QUOTES", "RANGE", "READ", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF_P", "REFERENCES", "REFERENCING", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESTART", "RESTRICT", "RETURN", "RETURNING", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINES", "ROW", "ROWS", "RULE", "SAVEPOINT", "SCALAR", "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", "SOURCE", "SQL_P", "STABLE", "STANDALONE_P", "START", "STATEMENT", "STATISTICS", "STDIN", "STDOUT", "STORAGE", "STORED", "STRICT_P", "STRING_P", "STRIP_P", "SUBSCRIPTION", "SUBSTRING", "SUPPORT", "SYMMETRIC", "SYSID", "SYSTEM_P", "SYSTEM_USER", "TABLE", "TABLES", "TABLESAMPLE", "TABLESPACE", "TARGET", "TEMP", "TEMPLATE", "TEMPORARY", "TEXT_P", "THEN", "TIES", "TIME", "TIMESTAMP", "TO", "TRAILING", "TRANSACTION", "TRANSFORM", "TREAT", "TRIGGER", "TRIM", "TRUE_P", "TRUNCATE", "TRUSTED", "TYPE_P", "TYPES_P", "UESCAPE", "UNBOUNDED", "UNCONDITIONAL", "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", "FORMAT_LA", "NOT_LA", "NULLS_LA", "WITH_LA", "WITHOUT_LA", "MODE_TYPE_NAME", "MODE_PLPGSQL_EXPR", "MODE_PLPGSQL_ASSIGN1", "MODE_PLPGSQL_ASSIGN2", "MODE_PLPGSQL_ASSIGN3", "'<'", "'>'", "'='", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "':'", "$accept", "parse_toplevel", "stmtmulti", "toplevel_stmt", "stmt", "opt_single_name", "opt_qualified_name", "opt_concurrently", "opt_drop_behavior", "CallStmt", "CreateRoleStmt", "opt_with", "OptRoleList", "AlterOptRoleList", "AlterOptRoleElem", "CreateOptRoleElem", "CreateUserStmt", "AlterRoleStmt", "opt_in_database", "AlterRoleSetStmt", "DropRoleStmt", "CreateGroupStmt", "AlterGroupStmt", "add_drop", "CreateSchemaStmt", "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_collate_clause", "alter_using", "replica_identity", "reloptions", "opt_reloptions", "reloption_list", "reloption_elem", "alter_identity_column_option_list", "alter_identity_column_option", "set_statistics_value", "set_access_method_name", "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", "column_compression", "opt_column_compression", "column_storage", "opt_column_storage", "ColQualList", "ColConstraint", "ColConstraintElem", "opt_unique_null_treatment", "generated_when", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "DomainConstraint", "DomainConstraintElem", "opt_no_inherit", "opt_column_list", "columnList", "columnElem", "opt_c_include", "key_match", "ExclusionConstraintList", "ExclusionConstraintElem", "OptWhereClause", "key_actions", "key_update", "key_delete", "key_action", "OptInherit", "OptPartitionSpec", "PartitionSpec", "part_params", "part_elem", "table_access_method_clause", "OptWith", "OnCommitOption", "OptTableSpace", "OptConsTableSpace", "ExistingIndex", "CreateStatsStmt", "stats_params", "stats_param", "AlterStatsStmt", "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", "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", "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", "object_type_any_name", "object_type_name", "drop_type_name", "object_type_name_on_any_name", "any_name_list", "any_name", "attrs", "type_name_list", "TruncateStmt", "opt_restart_seqs", "CommentStmt", "comment_text", "SecLabelStmt", "opt_provider", "security_label", "FetchStmt", "fetch_args", "from_in", "opt_from_in", "GrantStmt", "RevokeStmt", "privileges", "privilege_list", "privilege", "parameter_name_list", "parameter_name", "privilege_target", "grantee_list", "grantee", "opt_grant_grant_option", "GrantRoleStmt", "RevokeRoleStmt", "grant_role_opt_list", "grant_role_opt", "grant_role_opt_value", "opt_granted_by", "AlterDefaultPrivilegesStmt", "DefACLOptionList", "DefACLOption", "DefACLAction", "defacl_privilege_target", "IndexStmt", "opt_unique", "access_method_clause", "index_params", "index_elem_options", "index_elem", "opt_include", "index_including_params", "opt_collate", "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", "opt_createfunc_opt_list", "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", "func_as", "ReturnStmt", "opt_routine_body", "routine_body_stmt_list", "routine_body_stmt", "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_relation", "reindex_target_all", "opt_reindex_option_list", "AlterTblSpcStmt", "RenameStmt", "opt_column", "opt_set_data", "AlterObjectDependsStmt", "opt_no", "AlterObjectSchemaStmt", "AlterOperatorStmt", "operator_def_list", "operator_def_elem", "operator_def_arg", "AlterTypeStmt", "AlterOwnerStmt", "CreatePublicationStmt", "PublicationObjSpec", "pub_obj_list", "AlterPublicationStmt", "CreateSubscriptionStmt", "AlterSubscriptionStmt", "DropSubscriptionStmt", "RuleStmt", "RuleActionList", "RuleActionMulti", "RuleActionStmt", "RuleActionStmtOrEmpty", "event", "opt_instead", "NotifyStmt", "notify_payload", "ListenStmt", "UnlistenStmt", "TransactionStmt", "TransactionStmtLegacy", "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", "drop_option_list", "drop_option", "AlterCollationStmt", "AlterSystemStmt", "CreateDomainStmt", "AlterDomainStmt", "opt_as", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "any_with", "CreateConversionStmt", "ClusterStmt", "cluster_index_specification", "VacuumStmt", "AnalyzeStmt", "utility_option_list", "analyze_keyword", "utility_option_elem", "utility_option_name", "utility_option_arg", "opt_analyze", "opt_verbose", "opt_full", "opt_freeze", "opt_name_list", "vacuum_relation", "vacuum_relation_list", "opt_vacuum_relation_list", "ExplainStmt", "ExplainableStmt", "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", "MergeStmt", "merge_when_list", "merge_when_clause", "merge_when_tgt_matched", "merge_when_tgt_not_matched", "opt_merge_when_condition", "merge_update", "merge_delete", "merge_insert", "merge_values_clause", "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_search_clause", "opt_cycle_clause", "opt_with_clause", "into_clause", "OptTempTableName", "opt_table", "set_quantifier", "distinct_clause", "opt_all_clause", "opt_distinct_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", "opt_alias_clause_for_join_using", "func_alias_clause", "join_type", "opt_outer", "join_qual", "relation_expr", "extended_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", "json_table", "json_table_path_name_opt", "json_table_column_definition_list", "json_table_column_definition", "path_opt", "json_table_column_path_clause_opt", "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", "JsonType", "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_indent_option", "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", "func_arg_list_opt", "type_list", "array_expr", "array_expr_list", "extract_list", "extract_arg", "unicode_normal_form", "overlay_list", "position_list", "substr_list", "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", "json_passing_clause_opt", "json_arguments", "json_argument", "json_wrapper_behavior", "json_behavior", "json_behavior_type", "json_behavior_clause_opt", "json_on_error_clause_opt", "json_value_expr", "json_format_clause", "json_format_clause_opt", "json_quotes_clause_opt", "json_returning_clause_opt", "json_predicate_type_constraint", "json_key_uniqueness_constraint_opt", "json_name_and_value_list", "json_name_and_value", "json_object_constructor_null_clause_opt", "json_array_constructor_null_clause_opt", "json_value_expr_list", "json_aggregate_func", "json_array_aggregate_order_by_clause_opt", "opt_target_list", "target_list", "target_el", "qualified_name_list", "qualified_name", "name_list", "name", "attr_name", "file_name", "func_name", "AexprConst", "Iconst", "Sconst", "SignedIconst", "RoleId", "RoleSpec", "role_list", "PLpgSQL_Expr", "PLAssignStmt", "plassign_target", "plassign_equals", "ColId", "type_function_name", "NonReservedWord", "ColLabel", "BareColLabel", "unreserved_keyword", "col_name_keyword", "type_func_name_keyword", "reserved_keyword", "bare_label_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, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 60, 62, 61, 43, 45, 42, 47, 37, 94, 777, 91, 93, 40, 41, 46, 59, 44, 58 }; # endif #define YYPACT_NINF -5899 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-5899))) #define YYTABLE_NINF -2992 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-2992))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 18453, 52, 15019, -5899, -5899, 52, 72147, -5899, 81818, 686, 895, 1351, 237, 21731, 82327, 93525, 723, 394, 16397, 52, 93525, 1501, 62475, 77746, 1509, 93525, 510, 1313, 62475, 93525, 1999, 94034, 1233, 1555, 1350, 94543, 82836, 76219, 1564, 93525, 1794, 433, 95052, 83345, 1617, 83854, 1313, 57396, 162, 1592, 95561, 93525,119909, 433, 84363, 84363, 84363, 2026, 2214, 1655, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 1377, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2044, -5899, 216, 2456, 1732, 238, 1698, -5899, -5899, 2212, 72147, 93525, 93525, 93525, 1919, 93525, 1880, 93525, 936, 72147, 68584, 84872, 2088, 1883, 53208, 96070, -5899, 72147, 93525, 66039, 72147, 93525, 93525, 96579, 93525, 97088, 93525, 810, 80291, 93525, 2037, 93525, 93525, 66548, 97597, 2153, 273, 308, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 1965, 2125, -5899, 320, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 62984, 93525, 18713, 510, 2212, -5899, 2026, 93525, 2333, 93525, 2005, 98106, 93525, -5899, 93525, 2165, 98615, 949, 2112, 68584, 2219, 53736, 2260, 93525, 93525, 68584, 99124, 99633,100142, 93525, 93525, -5899, -5899, 2250, 93525, -5899, 2369, 69093, 1631, 2401, 2577, 2473, 1229, -5899, 85381, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 71638, 394, -5899, -5899, 2430, 72656, 2496, -5899, -5899,100651,120404, 2262, -5899, 960, 73165, 69602, 2635, 2314, 54264, 2668, -5899, 73674, -5899, 70111, 74183, -5899, -5899, -5899, -5899, -5899,101160, -5899,101669, 2359, 2496, -5899,120899, 70620, -5899, 2565,102178,102687,103196, 2212, 2293, 1975, 2011, 47501, -5899, -5899, -5899, 2349, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 929, -5899, 359, 1624, 301, 262, 342, -5899, -5899, 265, 278, 288, 359, 2829, 2829, -5899, 93525, -5899, -5899, 1624, 739, 2423, 2341, 2341, 2341, 2558, 17, -5899, 2341, 2489, -5899, -5899, -5899, -5899, 83854, -5899, 2347, 85890, 93525, 86399, 510, 2362, 2848, 2429, 62984, 1428, 93525, -5899, -5899, 2869, 2416, 2725, 2424, -5899, -5899, -5899, 2622, 2659, 160, 113, 510, 282, -5899, 2821, -5899, 2678, 32344, 32344, 510, 86908,103705, 310, 71638, 510, 87417, 2485, 1565, 2709, -5899, -5899, -5899, 783, -5899, 2966, 2514, 2800, 2424, 273, 49561, -5899, -5899, 2504, 2125, 83854, -5899, -5899, -5899, 62984, 2863, 35506, 93525, 2502, -5899, 2512, 2502, -5899, -5899, 2564, -5899, 2564, 2564, 2517, 2517, 2712, 2522, -5899, -5899, -5899, -5899, 2114, 2564, 2517, -5899,121889, -5899, 1734, 2004, -5899, -5899, 3030, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2538, -5899, 1418, -5899, 1991, -5899, -5899, -5899, 32344, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2543, 2554, 1732, -5899, 7410, 62984, 93525, 1126, 1126, 3014, 1126, 1704, 1940, -5899, 2590, -5899, 2913, 2873, 2882, 83854, 2588, 1065, -5899, 1797, 2633, 2056, 2605, 1846, 2061, -5899, 979, 93525, 286, 2686, 87926, 10759, 2651, 2125, 2661, -5899, -5899, -5899, -5899, 2838, 452, -5899, -5899, -5899, -5899, 2946, 3054, 8031, 386, 88435, -5899, -5899, -5899, -5899, 93525, 93525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2694, 181, -5899, -5899, 2670, 3065, 2940, 11359, 1161, 3060, 2901, 1892, 12046, 2972, 2079, 3129, 7932, 1656, 3146, 2020, 2084, 85890, 93525, 3103, 3156, 3401, 2015, 1119, 3021, 1146, 3060, 3159, 2971, 1892, 3188, 6393, 93525, -5899, 3097, 3243, 785, -5899, 176, -5899, 25021, 35506, 56887, -5899, 2125, -5899, 989, -5899, -5899, 61966, -5899, 2896, 3061, 774, 72147, 2837, 93525, 93525, -5899,119909, 72147, -5899, 3072, 54792, 72147, -5899, 72147, -5899, -5899, 3203,119909, 93525, 93525, -5899, 93525, -5899, -5899, 2840, -5899, -5899, -5899, -5899, -5899, 2341, 93525, 3304,119909, 3086, 431, 1819, 3341, 93525, 3088, 1819, 2886,104214, -5899, -5899, 1819, -5899, -5899, -5899, 93525, 93525, 2850, 2089, 3077, 876, 1819, 3094, 3339, 3342, 3100, 2937, 3104, 2512, -5899, 3307, 3075, 1185, 247, 2267, 1819, 2918,104723,105232, 93525, 2919, 93525, 3318, 72147, 2954, 72147, 72147, 93525, 3236, 93525, -5899, 3062, -5899, -5899, 1985, -5899, -5899, -5899, -5899, -5899, 3251, -5899, 229, 3253, 2879, 3259, 1921, 3261, 244, -5899, -5899, 2924, -5899, 3265, 313, -5899, 3267, -5899, 2890,105741, -5899,106250,106759, 3272, 350, -5899, 68584, 3276, 313, 3277, 2890, 3278, 313, 3280, 1017, 3282, -5899, 1240, 3269, 3286, 244, 3287, 2269, 2890, -5899, 3288, 369, -5899, 3289, 387, -5899, 3291, 3143, -5899, 35506, -5899, 3018, -5899, 1592, 2152, 2011, 3231, 83854, 1624, -5899, 93525, 1624, 93525, 1624, 93525, 1624, 93525, 1624, 93525, 93525, 93525, 1624, -5899, -5899, -5899, 93525, 2923, 93525, -5899, 93525, -5899, -5899, -5899, 78764, 68584, 79273, -5899, 93525, -5899, 483, 510, -5899, -5899, -5899, 1365, -5899, 2424, -5899,119909, 3422, 68584, 3318, 2158, -5899, -5899, 3318, -5899, -5899, 3318, 3318, -5899, -5899, -5899, 3210, 93525, 3292, 78764, 68584, 3294, -5899,107268, -5899, 71638, 3161, 2936, -5899, -5899, -5899, -5899, -5899, 2140, 3468, 260, 3473, 35506, 2950, 260, 260, 2951, 3316, -5899, -5899, -5899, 341, 2956, 2959, -5899, 267, 267, -5899, 2961, 2962, -5899, 284, 2963, 2965, 3495, 3496, 298, 299, 2969, 2970, 2973, 2976, 2977, 2978, 2979, 2982, 2983, 2984, 2985, 2986, 2987, 2114, 260, 2988, 35506, -5899, 2994, 267, 2997, 2999, 3001, 3499, 3002, -5899, 3500, 3003, -5899, 271, 376, 3004, 3006, -5899, 3244, -5899, 322, 3008, 3010, 3012, 3015, 3016, 3017, 3019, 3020, 35506, 35506, 35506, -5899, 29704, 2125, 510, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 326, -5899, 51624, -5899, 3056, -5899, -5899, 3232, -5899, -5899, 35506, -5899, -5899, 3389, 151, -5899, 337, -5899, -5899, -5899, 2125, 3334, 3023, -5899, -5899, 1057, 3024, -5899, 2204, -5899, -5899, -5899, -5899, -5899, -5899, 71129, 3519, -5899, 383, 510, 176, 2296, 3455, 60439, 60948, -5899, -5899, 3308, -5899, 93525, -5899, -5899, 2125, 208, 2169, -5899, 2349, 21466, 2178, 2502, 93525, 93525, 3525, -5899, 3032, -5899, -5899, 35506, -5899, -5899, -5899, 2829, -5899, 2564, 2564, -5899, -5899, 3530, 3125, 3126, 2829, -5899, 2829, -5899, 3040, 3042, 2829, 3128, 3130, 3132, -5899, 3046, 3136, 2829, -5899, -5899, 64003, 2213, -5899, 3399, 391, -5899, -5899, -5899, 2183, -5899, 3047, -5899, 2512, -5899, -5899, 1732, 1732, 35506, 1732, 1612, 179, 32871, 36033, 3415, 3283, 1413, 1915, 3419, -5899, 3290, 1704, 1940, 83854, 93525, 83854,107777, -5899, 35506, -5899, 3526, 3151, 3153, 3204, 59432, -5899, 3157, 3120, 3158, 3219, 3074, 3165, 3167, 3228, -5899, 3365, -5899, -5899, 3172, 3250, 3543, 3179,108286, -5899, -5899, 1221, -5899, -5899, -5899, 1221, -5899, 3105, 1598, 1130, 324, 3181, 331, 283, 3538, -5899, 1451, -5899, -5899, 3242, -5899, 19578, 93525, 3475, 8407, 3326, 386, 3241, -5899, -5899, -5899, 3388, 3190, 93525, 3192, 3343, 386, 346,108795, -5899, -5899, 93525, -5899, -5899, -5899, -5899, 8503, 3513, 28185, -5899, 2119, 3198, 3175, 3211, 93525, 75201, 2239, 3322, 3345, 1912, 2414, 587, 3270, 93525, 1027, 3353, 93525, 3122, 3212, 3213, 3464, 3127, 722, 3572, 3134, -5899, -5899, -5899, 3539, -5899, 524, 2117, 3344, -5899, 3469, 3517, 9386, 3205, 3207,117929, -5899, 3229, 1133, 55320, 93525, 93525, 3233, 3237,109304, 8503, 3558, 79782, 79782, 3240, 3245, 49046, 3574, 1802, 3247, -5899, -5899, -5899, 1802, 3248, 3252,109813, 8503, 3562, 93525, 3255, 3257, 93525,121889, 386, -5899, 3632, 386, 386, 2066, 3638, 3260, 270, 3424, 699, 1819, 3134, 3960, -5899, 3262, 3263, 378, -5899, 3394, 93525, 3264, 3271, 120, 3357, 510, -5899, 3363, -5899, 3274, 3366, 3275, 1179, 2850, -5899, -5899, 3279, 83854, 3390, 3395, 1027, 274, 746, 3134, -5899, 3281, 3284, 3127, 3127, 93525, 93525, 93525, 93525, 93525, 334, 3676, 464, 3285, 272, 1143, 3191, -5899, 1802, 67057, 3293, -5899, 1802, 93525, 319, 1078, 3134, 2087, 1822, -5899, -5899, -5899, 273, -5899, 35506, 35506, 35506, 3200, -5899, 2578, 21466, 927, -5899, 343, 17058, 3187, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 93525, 62984, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 93525, -5899, 93525, 3509,119909, 3512, 3429, 3515, 3518, 386, 93525, 93525, 3522, 3523, 3524,119909, 3527, 3528, 3534, 3433, 3296, 210, 3297, 3215, 3712, 3602, 93525, 64003, -5899, 1221, -5899,119909, 3452, 3605, -5899, 93525, 3471, 86, -5899, 3644, 3295, -5899, -5899, 89, 93525, 78255, 2850, -5899, -5899, 3608, 68584, 1641, 3609, 510, 3309, 3616, 3466, 510, 68584, 3520, 93525, 93525, 93525, 93525, 204, -5899, 67057, 3488, -5899, 93525, 3501, 3960, 3502, 3757, 118, 2341,110322, 3626, -5899,110831, 3268, 93525, 3273, 3273, 3760,119909, 1526, 3556, -5899, -5899, 2283, -5899, 3413, -5899, 72147, -5899, -5899, 72147, -5899, -5899,119909, 93525, 3298,119909,119909, -5899, -5899, 72147, 72147, -5899, 68584, 68584, 3651, 369, 3653, 3329, 3654, 3340, 55320, 55320, -5899, 397, 72147, -5899, 68584, 72147, -5899, 93525, -5899, 93525, -5899, -5899, -5899, -5899,119909,119909, -5899, 68584, 67057, 3656, 93525, 93525, -5899, 93525, 93525, -5899, 93525, 93525, 2191,111340, 2011, -5899, 93525, 3412, 93525, -5899, 93525, -5899, 93525, -5899, 93525, -5899, 93525, -5899, -5899, -5899, 93525, -5899, 93525, 2202, -5899, -5899, 2208, 1167, 93525, 93525, 1061, 72147, 93525, 3514, 93525, 72147, 72147, 93525, 93525, 93525, 93525, 93525, 3369, 3024, 730, -5899, 1720, 1029, 83854, 3529, -5899, -5899, 2224, 2026, 22, 93525, -5899, 93525, 93525, 93525, -5899, -5899, 77746, 3641, 479, 79273, 93525, -5899, -5899, 9945, 35506, 2125, 31812, -5899, -5899, 21466, 3332, 35506, 35506, 3299, 2829, 2829, -5899, 1169, 35506, 35506, 35506, 29177, 35506, 35506, 33398, 35506, 35506, 35506, 35506, 35506, 35506, 2829, 2829, 3300, 35506, 6824, 35506, 55320, 35506, 41303, 26087, 35506, 35506, 30231, 305, 2961, 35506, 3544, 42351, 35506, 2296, 3545, 35506, 2296, 6824, 3809, 3809, 2728, 6989, 3301, 2125, -5899, 2829, 1726, -5899, 481,119909, 35506, 35506, 35506, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 35506, -5899, 64003, -5899, -5899, -5899, -5899, -5899, -5899, 166, -5899, -5899, -5899, -5899, -5899, -5899, 3430, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 93525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 30758, -5899, -5899, -5899, -5899, 3302, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2801, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 31285, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3303, -5899, -5899, 35506, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3376, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 941, 35506, 35506, 35506, 35506, 35506, 35506, 35506, 35506, 35506, -5899, 35506, 593, -5899, -5899, 3640, 3389, 53, 462, 3306, 3508, 88944, 32344, 3399, 25021, -5899, 316, 3399, -5899, -5899, -5899, 93525, 3519, -5899, -5899, 3379, -5899, -5899, -5899, -5899, -5899, 344, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3310, -5899, -5899, -5899, -5899, 3310, -5899, 3312, 3635, 3637, 1017, 93525, 2616, 35506, 166, 303, 93525, 35506, 3302, 2801, 35506, 3303, 35506, 3376, -5899, 35506, -5899, 2233, 921, 35506, 2237, 3314, -5899, -5899, 3311, 3042, 3323, 3327, 3315, 3317, 2829, 257, 3319, 1270, 188, 3451, 2829, 3577, 3320, -5899, 64003, -5899, 44411, 3368, -5899, -5899, -5899, 433, 93525, 93525, -5899, 3639, -5899, 3325, -5899, 17185, 3639, -5899, -5899, 41827, 3453, 3617, 3552, -5899, -5899, -5899, 3328, 21466, 36560, 36560, -5899, 2321, 21466, 2348, -5899, -5899, -5899, -5899, -5899, -5899, 1545, -5899, 93525, 808, 3415, 1915, 3392, -5899, 3827, 3396, 93525, -5899, 2243, -5899, 68584, 93525, 93525, 3553, -5899, 3812, -5899, 121889, -5899, 3337, -5899,121394,116939, -5899, -5899, 926, -5899, 1174, 68584, -5899, 93525, 93525, 68584, 93525, 93525, -5899, 68584, 3391, 93525, 93525, -5899, -5899, -5899, -5899, -5899, 61457, 95, 77746, 3484, 76728, -5899, -5899, 3347, 93525, 3578, -5899, -5899, 111849, -5899, 3580, 68584, 93525, 93525, 35506, 3585, 93525, 93525, -5899, 329, 3436, 3439, -5899, 93525, 3440, 72147, 3354,119909, 72147, 55848, 72147, 72147, 3718,119909, 93525, 93525, 1525, 83854, 458, 1131, 3134, 3593, -5899, 349, -5899, 68584, -5899, 93525, 3583, -5899, -5899, -5899, 89453, 3845, 3485, -5899, -5899, -5899, 112358, -5899, -5899, 3589, -5899, 2254, -5899, 68584, 68584, 93525, 9668, 3364,112867, 93525, 697, 3659, 3610, 3660, 1256, -5899, -5899, -5899,119909, -5899, 93525, 89962, 93525, 93525, 3650, 93525, 80800,113376,113885, 1551, 1610, 3652, 93525, 81309, 3655, -5899, 3521, 93525, -5899, -5899, 64512, 68584, 93525, 912, 64003, -5899, 3634, -5899, 93525, -5899, 325, -5899, 93525, 4358, 3599, -5899, -5899, 3461, 3474, 93525, 532, 1200, 3134, 3782, 93525, 93525, 3374, 2255, 68584, 93525, 64003, -5899, 3606, 811, 68584, 93525, 89453, -5899, 3607, -5899, 83854, 3715, -5899, 3375, 2341, 2504, 2070, 3375, 68584, 93525, -5899, 3375, 93525,103705, -5899, 68584, 1414, -5899, 68584, 93525, 89453, -5899, 3611, 3557, 68584, 93525, 8737, -5899, -5899, -5899, 386, -5899, -5899, -5899, -5899, -5899, 93525, 93525, 386, 93525, 93525, 386, 323, -5899, 68584, 93525, -5899, -5899, -5899, 3532, 68584, 93525, 93525, 403, 93525, -5899, 93525, 68584, 3434, 93525, 93525, -5899, -5899, 93525, 5836, 93525, 93525, 93525, 93525, 93525, 93525, 68584, 93525, -5899, -5899, 1579, 1464, 1541, 1628, 1566, 93525, 3735, 93525,114394, 510, 68584, 93525, 93525, 510, 93525, 64003, 1845, -5899, -5899, 3533, -5899, 68584, 1414, -5899, 9903, 93525, 93525, 93525, 3494, 3497, 367, 3576, -5899, -5899, -5899, 1114, 1114, 3633, -5899, 35506, 35506, 33925, 3411, -5899, -5899, 35506, 2896, -5899, -5899, -5899, 1091, 3910, 1091,114903, 1091, 1091, 3725, 3478, 3479, 1091, 1091, 1091, 3709, 1091, 1091, 1091, 93525, 3603, -5899, -5899, 3603, 976, 35506,119909, 93525, -5899, 2264, -5899, 3431, -5899, -5899, 64003, 93525, 234, 183, 3800, 3658, 75710, 2346, 3787, 93525, 3477, 93525, 3925, 3531, 7, -5899, 2346, 93525, -5899, 2148, 77746, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 93525, -5899, -5899, 3791, 93525, 44926, 3618, -5899, 510, 2850, 2850, 2850, 2850, 3443, 2850, 93525, 3582, 3829, 2346, 3450, 3830, -5899, 3960, 3832, 1395, 93525, 3690, 75710, 3535, 3503, 3701, 3957, 2341, 510, 3704, 3691, -5899, 59930, -5899, 2850, 3973, 28681, 6877, 7588, 3694, 3762, -5899, -5899, 3706, 1084, 93525, 3811, 3818, 3840, -5899, 229, -5899, 3974, 1921, 3841, 244, -5899, 313, -5899, 2890, -5899, 93525, -5899, 93525, 93525, 93525, 93525, 350, -5899, -5899, 313, 2890, 313, 1017, -5899, 3771, 244, 2890, 3619, 3844, 369, -5899, 387, -5899, 3708, 1017, -5899, 3727, 2341, -5899, 1424, 50076, -5899, -5899, -5899, -5899, -5899, -5899, 2281, -5899, 93525, -5899, 3816, 3821, 3822, 3831, 3833, 3493, 3504, 3540, 93525, 3505, 3493, 386, 3506, 3510, -5899, 3505, 3505, 3493, 3024, 3024, 3493, 3504, 67566, 3971, 64003, -5899, -5899, 3586, 3507, 3860, 938, -5899, 1006, 97, 3765, -5899, -5899, -5899, -5899,119909, -5899, 68584, 3548, -5899, -5899, -5899, 3732, 3537, 67566, 1017, 174, -5899, 72147, 93525,119909, 72147, 3746, 72147, 72147,119909, 93525, 93525, 2297, -5899, 2002, -5899, 2053, 35506, 218, -5899, 12463, 2299, 35506, 3516, 3536, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3541, 3871, -5899, 2303, 2304, 17607, 2355,119909, 2394, 3547, -5899, 3551, 251, 3736, 3542, 6648, 3575, 2319, 3554, 259, -5899, 6648, 353, 3549, 8450, 3678, 3550, 2326, 3563, 3564, -5899, 7187, 7901, 3565, 17845, 3555, 3566, 3568, 3570, 41303, 41303, 29704, 2834, -5899, 41303, 3571, 3737, 2332, 17216, 3587, 3588, 18156, 34452, 35506, 34452, 34452, 18943, 3569, 3594, -5899, 3920, -5899, 2338, 64003, 3726, 19027, 2339, -5899, 35506, 64003, 8100, 35506, -5899, 35506, 3613, -5899, -5899, 4541, 4541, 4541, 6824, -5899, -5899, 3567, -5899, 41303, 41303, -5899, 3410, 29704, -5899, -5899, 3883, -5899, -5899, 630, -5899, -5899, -5899, -5899, -5899, 2815, -5899, -5899, -5899, 3770, 2355, 4174, 55320, 13580, 35506, 335, 35506, 3302, 35506, 3615, 4541, 4541, 4541, 548, 548, 261, 261, 261, 2352, 462, -5899, -5899, -5899, 3579, 3581, 3508, 3584, 35506, -5899, 3595, 50591, -5899, 2445, 2462, 93525, 3492, 6295, 6395, -5899, -5899, -5899, 3368, 927, 3368, -5899, 273, 2829, 1726, 61966, -5899, -5899, -5899, -5899, -5899, -5899, 93525, 21466, -5899, -5899, 3797, 3612, 2367, -5899, -5899, 2829, -5899, -5899, 2306, 2306, 3559, -5899, 3621, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3614, -5899, -5899, -5899, 3623, 3625, 45441, 3887, 3627, 43896, 90471, 3573, 2253, -5899, 90471, 90980, 90471, 90471, -5899, 3636, -5899, -5899, 2125, 35506, 3880, -5899, -5899, -5899, 35506, -5899, -5899, 1228, 3596, 112, 797, 2511, 2511, 2321, 1283, -5899, -5899, 3597, -5899, 35506, 2400, -5899, 2506, -5899, -5899, -5899, -5899, 3024, -5899, 3848, -5899, -5899, -5899, 44411, 3629, 93525, 44411, -5899, -5899, -5899, -5899, -5899, -5899,116939, 1991, -5899,121394, -5899,121394, -5899, 1991, 4014, -5899,116939, 2014, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 68584, 68584, 3813, 93525, 3817, 3834, 35506, 1067, -5899, 3963, 1017, -5899, -5899, 3693, -5899, 21466, -5899, -5899, -5899, -5899, -5899, 68584, 93525, -5899, 71638, -5899, -5899,119909, -5899, -5899, 93525, 93525, -5899, -5899, -5899,119909, -5899, -5899, -5899, 93525, 203, 3705, 3713, 93525, -5899, 954, 3394, 10064, 93525, 93525, 93525, 3927, -5899, -5899, -5899, -5899, 3858, -5899, 4003, -5899,116939, -5899, 2890, 1626, 3719, 3134, 35506, 3873, -5899, 255, 93525, 3642, 3647, 4010, 1296, 3962, 3648, -5899, 3747, -5899, 3769, 1466, -5899, -5899, 3778, -5899, -5899, -5899, -5899, 4017, 1017, 4021, 1017, 93525, 93525, 93525, 93525, 3789, -5899, -5899, -5899, -5899, 3792, 3934, -5899, 64003, 64003, 64003, 2393, -5899, -5899, 510, -5899, -5899, -5899, -5899, -5899, -5899, 3982, -5899, 2397, -5899, 1007, 91489, -5899, -5899, -5899, -5899, -5899, 4030, 68584, 93525, 10176, 93525, 93525, 93525, 3885, 2086, 1412,119909, -5899,118424, -5899, -5899, 2399, -5899, 3672, 93525, 3750, 68584, 3730, -5899, -5899, -5899, 4043, 2341, 3819, 79782, 3717, 3717, 2231, -5899, -5899, -5899, -5899, -5899, 3956, 3879, -5899, 1118, 3881, 68584, 3744, -5899, -5899, -5899, -5899, 4054, 3774, -5899, -5899, 3775, 1204, 3134, 3960, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3799, -5899, -5899, -5899, -5899, -5899, -5899, 738, 738, -5899, -5899, -5899, 738, 1644, 552, 1227, 3134, -5899, 1886, 1689, 3776, -5899, 3781, -5899, -5899, -5899, 3968, 3970, 3977, 3796, 3804, 3836, 3820, 3823, 3855, -5899, 3824, 3857, 3825, 3869, 3837, 4106, 1017,119909, 3976, 510, 3864, 4103, 1017, -5899, -5899, 3838, -5899, 3843, -5899, 2420, 4222, 4227, -5899, 93525, -5899, 534, 1239, 3134, -5899, 3846, -5899, 68584, 93525, -5899, -5899, -5899, 35506, 3741, 3742, 3743, 21466, 21466, 35506, -5899, -5899, 21466, 3748, -5899, -5899, -5899, -5899,119909, -5899, 93525, 4055, -5899, -5899, 1091, 93525, 93525, -5899, -5899, -5899, 93525, -5899, -5899, -5899, 4056, -5899, 315, 315, -5899, -5899, 4098, 8558, 3753, 438, -5899, 64003, 52152, 3305, 915, 1819, -5899, 71638, 93525, 71638, -5899, 183, 3980, 93525, 93525, 93525, 3761, 3759, -5899, -5899, -5899, -5899, 68584, 910, 68584, 2829, -5899, -5899, 3842, -5899, 93525, 2341, 4292, 4127, 3434, -5899, 4253, 3342, 1641, 1884, 306, 2937, 4189, 2512, 35506, 178, -5899, -5899, 2125, 93525, 3503, -5899, -5899, -5899, -5899, 510, -5899, 3772, 3767, -5899, 93525, 4138, 93525, 93525, 93525, 93525, 3548, 3779, 93525, 3784,119909, 93525, 2404, 3127, 4276, 4159, 2026, 3535, 3875, 4166, 83854, 3801, 2421, -5899, -5899, 1084, -5899, 2442, 182, -5899, 510, 71638,117434, 4155, -5899, 318, 7588, -5899, -5899, 318, 1382, 93525, -5899, -5899, -5899, -5899, 4025, 2311, -5899, 4140, -5899, -5899, 2026, -5899,119909, 3802, -5899, 2447, -5899, -5899, -5899, 369, 3859, 1017, 3862, 1017, -5899, -5899, -5899, -5899, 93525, -5899, 93525, 67057, -5899, -5899, 93525, -5899, 4173, 3861, 1688, 48531, 4027, -5899, 93525, 409, -5899, 3814, -5899, -5899, -5899, 3948, 3952, 3958, 3961, 3964, 93525, 3493, -5899, 3828, 93525, 93525, 68584, 1058, -5899, -5899, 68584, 489, -5899, 241, -5899, 83854, 3953, -5899, -5899, -5899, -5899, 4199, 4200, -5899, -5899, -5899, 312, -5899, 78764, 497, -5899, 68584, 4133, 4134, 4135, 4136, 386, 4137, 4141, 4143, 4144, 4147, -5899, -5899, -5899, 3847, 19313, 35506, -5899, 4215,119909, -5899, 8806, -5899, -5899, -5899, 35506, -5899, -5899, 4145, -5899, -5899, 3907, 3909, 3849, 3547, 3678, -5899, 4068, 4070, 35506, 3678, 4322, 358, 35506, 35506, 35506, -5899, -5899, 4074, 4077, 35506, 2355, 2355, 35506, -5899, 3851, 35506, -5899, -5899, -5899, -5899, 2384, 35506, -5899, 35506, -5899, -5899, 26620, 4375, 4375, 3852,119909, 41303, 41303, 41303, 41303, 1718, 2997, 41303, 41303, 41303, 41303, 41303, 41303, 41303, 41303, 41303, 41303, 622, -5899, 4071, 35506, 35506, 34979, -5899, -5899,119909, 3865, 3569, 3870, 3872, 35506, -5899, -5899, -5899, 2459, 42866, 3876, 64003, -5899, 35506, 16926, 2465, 3912, 19727, 2125, 8981, 510, 35506, 2769, 4293, 35506, 2467, 35506, -5899, -5899, -5899, -5899, 4216, -5899, -5899, -5899, -5899, -5899, -5899, 4101, 2355, -5899, -5899, 35506, 3877, 4237, 41303, 41303, 4960, -5899, 5278, 35506, 29704, -5899, 3633, -5899, 27153, 3866, 35506,116430, -5899, -5899, 1313, 1313, 1313, 1313, -5899, 93525, 93525, 93525, 3880, 3878, 3880, 176, 3882, -5899, -5899, -5899, -5899, 2026, -5899, 3863, -5899, -5899, -5899, -5899, -5899, 35506, 90471, 90980, 90471, 90471, 3874, 43381, 27669, 2253, 3886, 93525, -5899, -5899, 3884, 44411, 4172, 4088, -5899, 44411, 4088, 1782, 4088, 4183, 3979, 51106, -5899, -5899, 3888, -5899, -5899, 4105, -5899, 2119, 21466, 4357, 4235, -5899, 3893, -5899, 3596, 317, -5899, -5899, -5899, 1298, -5899, 3984, -5899, -5899, -5899, 3573, 37087, 4057, -5899, 1615, 2471, 2038, -5899, -5899, 116939, -5899, 3972, 2890, 2890, 1811, 3493, 4260, 1811, 9247, -5899, 2083, 93525, -5899, 93525, -5899, -5899, -5899, 4397, 3965, 3967, 4193, -5899, 2605, -5899, -5899, 68584, 93525, -5899, -5899, -5899, 547, 1249, 3134, -5899, 3993, -5899, -5899, 4228, 93525, -5899, 4382, 4006, 93525, 9377, 4289, 3975, -5899, -5899, 45956, 93525, 93525, 93525, -5899, 93525, 93525, 2083, 91998, -5899, 4363, 2083, 4033, 4272, 1767, 3127, 270, 2411, -5899, 1597, -5899, -5899, 3997, -5899, 93525, -5899, 93525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 4061, -5899, -5899, -5899, -5899, 64512, -5899, -5899, 93525, -5899, 64003, 52152, 64003, -5899, -5899, -5899, 93525, -5899, 1729, 553, 1378, 3134, -5899, 4011, -5899, 4297, 4012, 4013, 4072, 226, 264, 4015, 4016, 4075, 3930, 3932, 3933, -5899, 64003, 52680, 4102, 93525, 2890, 3937, 3981, 93525, 3717, 92507, -5899, 3939, -5899, -5899, 3717, 359, 510, -5899, -5899, 510, 2890, 510, 93525, 93525, 93525, 93525, 403, -5899, -5899, -5899, 4415, 4039, 93525, 93525, 93525, 93525, -5899, 3999, -5899, -5899, -5899, 93525, 93525, 4307, 1152, 2279, 68584, 93525, 93525, 68584, 93525, 93525, 93525, 93525, 93525, 93525, 93525, 4175, -5899, 4402, 4324, 2301, 4369, 4028, 93525, -5899, 93525, 510, -5899, 3394, 93525, 93525, 93525, 93525, -5899, -5899, -5899, -5899, -5899, 3633, -5899, 3951, 4263, 1091, -5899, 4264, 4266, 4268, 1091, -5899, -5899, 1819, -5899, 235, 93525, -5899, 2475, 93525, -5899, -5899, -5899, 3893, 524, 2117, -5899, -5899, -5899, -5899, -5899, -5899, 3959, 93525, 93525, 41303, -5899, 2383, 1383, 1537, -5899, 4254, 93525, 3244, -5899, -5899, -5899, 919, 93525, -5899, -5899, -5899, -5899, 3966, -5899, 758, 3779, -5899, 4286, 75710, 2890, 68584, 68584, 2890, -5899,119909, 3985, 3503, -5899, 302, 4049, -5899, 68584, 1641,115412, 3309, 4002, 4191, 10401, 44411, 44926, 738, -5899, 3969, 3978, -5899, -5899, 93525, 3980, 67057, 2477, 3960, 4463, 914, 2293, -5899, 77237, 4176, 3779, 4286, -5899, 3127, 4201, 4202, -5899, 2026, 93525, 3548, 3503, 510, 93525, 3975, 52152, -5899, 4504, 2324, -5899,116939, 35506, 35506, -5899, 3983, -5899, 3986, 7588, -5899, 4052, 3987, 4467, 35506, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 4066, 3988, 93525, 93525, 1084, 93525, -5899, 3989, 3841, -5899, 3841, -5899, 93525, -5899, 93525, -5899, 1017, -5899, 4116, 1017, 93525, -5899, -5899, -5899, 4041, 2478, -5899, -5899, 4433, 4057, -5899, 2492, 50076, 3629, 35506, 2125, 93525, 93525, 93525, 93525, 93525, 3493, 386, 3510, -5899, -5899, 4344, 67566, 4345, -5899, 64003, -5899, -5899, -5899, -5899, -5899, 2503, 93525, -5899, -5899, -5899, 4418, 4355, 1017, 479, 1122, 1122, 1122, 1122, 4310, 1122, 1122, 1122, 1122, 1122, -5899, 35506, 21466, -5899, 4001, -5899, 21466, 4392, 4298, 4299, -5899, -5899, 4007, 4241, 4246, -5899, 4018, 35506, 3678, 20063, -5899, -5899, 4248, 4251, -5899, 3678, 3678, 20063, -5899, 20063, 4020, 11076, 20259, -5899, 2509, 35506, -5899, 588, 588, 588, 1280, 4372, -5899, 2884, 588, 588, 588, 537, 537, 276, 276, 276, 4375, 622, 20499, 20307, 20675, 4022, -5899, -5899, -5899, 3569, -5899, 37614, 748, 4491, 42351, -5899, -5899, -5899, 4067, 4073, 4026, -5899, 35506, 38141, 4031,121889, 4243, -5899, 473, 35506, 35506, 3446, -5899, 13642, 35506, -5899, -5899, 3446, 595, 35506, 4384, 4613, 35506, 35506, 5833, 11130, 4029, -5899, 2515, 35506, 11184, 4236, -5899, 93525, 93525, 93525, 93525, -5899, -5899, -5899, 4235, 510, 4235, 510, 4035, -5899, 4036, -5899, -5899, -5899, -5899, 65021, 4034, 3726, 90471, 4037, 93525, 2253, 44411, -5899, -5899, 2263, -5899, 44411, 4348, -5899, 44411, 72147, -5899, 93525, 4042, 93525, -5899, 1126, 35506, 4087, 55320, -5899, -5899, -5899, -5899, 4139, -5899, 4277, 21466, 32344, -5899, 35506, -5899, 4121, 2525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 4148, 77746, 4405, -5899, -5899, 1434, 4376, 572, -5899, 1017, -5899,119909, 93525, 93525, 93525, 3074, -5899, -5899, 93525, 93525, 93525, 93525, -5899, -5899, 68584, 93525, -5899, -5899, 93525, 35506, 2526, -5899, 4094, 4509, 215, 2531, -5899, 2533, 2083, -5899, 2539, -5899, -5899, 93016, -5899, 3980, 403, 2383, 4393, 4395, 4294, -5899, 386, -5899, 4554, 2383, 4300, 403, -5899, -5899, -5899, -5899, 2340, -5899,119909, 1017, 1017, -5899, -5899, -5899, -5899, -5899, 4076, -5899, 4535, 4161, 93525, 93525, 93525, 93525, 93525, 68584, 93525, 93525, 2829, 2829,119909, 4058, -5899, 2829, 2829, 4063, -5899, 68584, 93525, 93525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 4157, -5899, 35506, 4530, -5899, -5899, -5899, -5899, -5899, 35506, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 68584, 93525, 4158, -5899, 4163, -5899, 878, -5899, -5899, 93525, 93525, 93525, 93525, 4456, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 4454, 93525, -5899, -5899, 510, 510, 119909, 1017, 1017, -5899, -5899, -5899, 4168, -5899, -5899, 4082, 4394, 1091, -5899, 1091, 1091, 1091, -5899, 4086, -5899, 1819, 4494, -5899, 2083, 2124, 4445, -5899, 35506, -5899, 1132, 1280, -5899, 4505, 4591, -5899, -5899, -5899, -5899, 3434, 2341, 3434, -5899, -5899, 72147, 422, -5899, 4434, 234, 64003, 4334, 75710, 1886, 1834, 4104, 4238, -5899, 2890, 2890, 4167, 93525, 4603, -5899, -5899, -5899, -5899, -5899, -5899, 68584, 3730, -5899, 4350, 1121, 4470, 93525, 44926, -5899, 3573, -5899, -5899, -5899, 510, -5899, -5899, 4250, 3503, -5899, 1402, 93525, 4343, 75710, 3548, 2556, -5899, -5899, -5899, 4156, 4594, 3535, -5899, 1886, 4176, -5899, -5899, 4570, 4218, 4165, 4619, -5899, 4218, 4484, 4354, 4130, -5899, 3801, -5899, 93525, -5899, 21466, 21466, 510,122384, 318,119909, 4496, -5899, 21466, 93525, 230, 4142, 4306, -5899, 4460, 1017, 2570, -5899, 1017, 1017, -5899, 93525, -5899, 2026, 2428, 93525, 2125, 102, -5899, 4149, 93525, -5899, 4057, 21466, 3493, 3493, 3493, 3493, 3493, -5899, 4361, -5899, -5899, -5899, -5899, 4453, -5899, 67566, -5899, 1017, -5899, -5899, -5899, -5899, -5899, -5899, 1122, -5899, -5899, -5899, -5899, -5899, 21466, -5899, 93525, -5899, -5899, -5899, -5899, -5899, -5899, 3325, 4150, 35506, 1499, -5899, -5899, 4151, 4153, 3678, 3678, -5899, -5899, 35506, -5899, 11774, 41303, 4499, -5899, 35506, 35506, 35506, -5899, 4162, 2575, 2576, -5899, -5899, 748, -5899, 4491, -5899, -5899, -5899, 11829, 4206, 21466, 4262, 4154, 1408, 3446, 3446, 13642, 3446, 35506, 35506, 3446, 3446, 35506, -5899, -5899, -5899, 12115, -5899, 4625, 3633, -5899, -5899, -5899, -5899, 4087, -5899, 4087, -5899, 4301, 35506, -5899, 2585, 4652, 40249, 4610, -5899, 93525, 2591, -5899, 35506, 4164, -5899, -5899, 44411, 2263, 4171, 2596, 93525, 2597,119909, 38668, 21466, 93525, 3633, 4160, -5899, 93525, 3023, 20931, -5899, -5899, 67566, 4398, 67566, 2083, -5899, -5899, -5899, -5899, -5899, -5899, 4177, -5899, -5899, -5899, -5899, 4245, -5899, -5899, 39, 3529, 2083, -5899, 12555, 4506, 45956, 56376, 93525, -5899, 93525, -5899, 4349, 4506, 4506, -5899, -5899, -5899, -5899, 4671, 4557, 4558, -5899, -5899, 4182, -5899, -5899, -5899, 4402, -5899, -5899, 52152, 68584, 93525, -5899, 4271, -5899, -5899, -5899, -5899, -5899, -5899, 48016, 55320, -5899, 226, 4185, 4187, 264, -5899, -5899, -5899, 93525, 12870, 4188, 13121, 47, 3529, 93525, 93525, 4190, 4196, 4197, 1929, 1864, 1981, 3493, 4556, 93525, -5899, -5899, -5899, 4402, -5899, -5899, 93525, -5899, 1091, -5899, -5899, -5899, -5899, 64003, -5899, 3049, 4086, 510, 72147, 4694, 4694, 14231, 4436, -5899, -5899, 775, 4267, 4471, 4267, 4204, 93525, 919, 4209, 2598, -5899, 93525, 4205, 4335, 1757, 1757, 93525, 93525, 93525, 2602, 2026, 2890, 3981, 1641, 4579, 75710, 4631, 3980, 417, -5899, 93525, 4707, 93525, 3548, 3779, 93525, 4211, -5899, -5899, 77237, 4435, 3305, 93525, 2404, 4176, 3535, 1385, 93525, -5899, 1465, -5899, 2026, -5899, 93525, 83854, 45956, 4571, -5899,121394, -5899, 2607, -5899, -5899, -5899, 4295, 22294, 3368, 4337, 4339, 4214, 2203, 4583, 93525, 982, -5899, -5899, -5899, -5899, -5899, -5899, 1688, -5899, -5899, 4663, 45956, 4620, 35506, -5899, -5899, -5899, 93525, 497, -5899, -5899, -5899, -5899, 4219, -5899, 4720, 35506, 1095, -5899, -5899, -5899, -5899, -5899, 4451, -5899, 4226, -5899, -5899, 2625, 1499, 21057, -5899, 5072, 41303, 21466, 21466, 21466, 35506, -5899, 35506, -5899, -5899, -5899, -5899, 150, -5899, -5899, 4563, 4239, 3446, 3446, 3446, -5899, 35506, 1099, -5899, -5899, 1803, 4658, 21098, 3636, 65021, 4242, -5899, 41303, 2608, -5899, 5095, 93525, 2613, -5899, 21466, 93525, -5899, -5899, 35506, -5899, 2619, -5899, 4244, 55, 4249, 25554, 4233, -5899, -5899, -5899, -5899, -5899, 21466, 4247, -5899, 4735, 1915, -5899, -5899, 2192, 1279, -5899, 4740, 4740, 1058, 1811, 484, -5899, 93525, 4340, -5899, 4509, 4252, 3434, -5899, 4255, -5899, -5899, 441, 3127, 93525, 3434, 3434, 3305, 4585, -5899, -5899, 35506, 4312, -5899, 1254, 3529, 93525,119909, -5899, 170, 4611, -5899,119909,119909, -5899, -5899, -5899, 35506, -5899, 4353, -5899, -5899, -5899, 35506, 35506, 74692, -5899, -5899, 93525, 93525, 93525, 93525, 93525, -5899, 1017, -5899, -5899, 2626, -5899, 46986, -5899, -5899, 3341, 510, 3341, 2121, -5899, -5899, 3341, 3341, -5899, 3368, -5899, 4694, 392, -5899, -5899, 4503, 4261, 35506, 4588, -5899, 1070, 4488, -5899, 4269, -5899, 72147, 4792, -5899, 64003, 3779, 4286, 93525, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 2628, 3980, 4635, 3503, 4165, -5899, 93525, 4308, -5899, 44411, 3980, 2026, 2293, -5899, 4176, 3779, 4286, -5899, -5899, 4274, 4202, 3535, 2404, 4417, -5899, 4420, -5899, 4734, 4498, 4738, 3548, -5899, 3975, 2630, -5899, 93525, -5899, -5899, 7588,122384,119909, -5899, -5899, -5899, 4287, 4689, 4336, 4351, -5899, -5899, -5899, 2203, -5899, 1796, 4685, 4341, -5899, 4359, 93525, -5899, -5899, 4362, 93525, 2638, 140, 21466, 3980, 1017, 35506, 64003, 21466, -5899, -5899, 4681, -5899, 456, 340, 252, 4523, 4305, 35506, 5072, 2642, 2644, 4366, -5899, -5899, -5899, 3569, 39195, 39195, 39195, 4313, 4666, 4682, 93525, -5899, 93525, 4525, -5899, -5899, 93525, 1280, 4315, 40249, 64003, 2648, -5899,118919, -5899, 2652, 2665, -5899, 35506, 4323, 35506, -5899, 38668, 93525, 4325, 3415, -5899, 4593, -5899, -5899, 35506, 4413, 4419, -5899, 4684, -5899, -5899, 93525, -5899, 93525, 4267, 55320, 3596, 441, 2341, 4267, 4267, 4261, 14771, 35506, -5899, 4427, -5899, -5899, 2666, 1226, 4508, 4508, 2672, 2688, 15306, 93525, 2689, 2695, -5899, 2697, 2829, 3504, 1981, 3504, -5899, 3493, -5899, -5899, 64003, -5899, -5899, 68075, -5899, -5899, -5899, 510, -5899, 510, 4572, 57905, 58414, 510, 510, -5899, -5899, -5899, -5899, 4659, -5899, 3960, -5899, 15619, 4431, -5899, -5899, -5899, 540, -5899, 4562, 4564, -5899, 4342, -5899, 2699, -5899, 1886, 4472, 3980, -5899, -5899, 93525, 4835, 4840, -5899, 1140, 93525, 3573, -5899, 4165, 3548, 3535, 1886, 4176, 3305, 46471, 4218, 2404, 4202, -5899, -5899, 4568, -5899, 4569, -5899, 4347, 4683, 45956, -5899, 2085, 318, -5899, -5899, -5899, 1453, 4704, 4709, -5899, -5899, -5899, 3341, -5899, 124, 4356, 4736, -5899, -5899, 2026, -5899, 3368, -5899, 4492, -5899, -5899, -5899, -5899, -5899, 4400, 348, 381, -5899, 4406, -5899, 4547, 4550, 1499, 2406, -5899, 21466, -5899, -5899, -5899, 40776, 4531, 1269, 17586, 4764, -5899, 4764, 4764, -5899, 4859, 4861, 1282, -5899, 4844, 2701, 42351, -5899, -5899, -5899, 93525, 4606, 1452, 4889, 4561, 2703, 38668, 2711, -5899, -5899, -5899, -5899, 4871, 21466, 515, 1651, 67566, 3529, 2715, 3717, 4396, -5899, 3596, 4471, -5899, -5899, -5899, -5899, 21466, 93525, 72147, 4873, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 3529, 4486, -5899, -5899, 74692, -5899, 93525, -5899, -5899, 2727, -5899, -5899, -5899, 58923, -5899, 4142, -5899, 4142, -5899, -5899, -5899, 1944, 4511, 93525, 987, 987, 4810, -5899, 4466, -5899, 4404, -5899, 4931, 4542, 93525, -5899, -5899, 226, 2026, 75710, 3980, -5899, -5899, 2404, 4176, 3535, 35506, 2735, -5899, 4509, 215, -5899, 4202, 4218, -5899, -5899, 45956, 4408, 3244, -5899, 4803, -5899, -5899, -5899, 1529, 72147, 72147, 93525, -5899, -5899, -5899, 35506, 919, -5899, -5899, 50076, -5899, 4450, -5899, 4452, -5899, -5899, 4638, 4641, 4416, 1499, -5899, 4915, -5899, -5899, -5899, -5899, -5899, 1092, -5899, -5899, -5899, 93525, 93525, 93525, 4421, -5899, 3726, -5899, -5899, 41303, 41303, 4655, -5899, 41303, 1452, -5899, 93525, -5899, 4422, -5899, -5899, 2737, -5899, 99, -5899, 4664, 4559, -5899, -5899, 4667, 624, -5899, 484, -5899, -5899, -5899, -5899, -5899, 4488, 2083, 2083, 3529, -5899, 93525, -5899, 4425, -5899, -5899, -5899, 68075, -5899, 4142, -5899, -5899, -5899, -5899, 4938, -5899, 1372, -5899, -5899, -5899, -5899, 93525, 3980, 4058, 4165, -5899, 4202, 3535, 2404, 16039, -5899, 46471, 93525, 93525, 4218, -5899, 2739, 45956, 3503, 4580, -5899, 2681, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 944, 4428, 4429, -5899, -5899, 16348, 72147, 1821, -5899, -5899, 4581, 4584, -5899, 4660, 39722, 4587, -5899, 4661, -5899, 1288, 1297, 1962,115921, 4893, 1280, 1280, -5899, 1280, -5899, -5899, 35506, -5899, -5899, -5899, -5899, 50076, -5899, 4501, 1688, 4442, 93525, -5899, -5899, 2083, -5899, -5899, -5899, 35506, -5899, -5899, 2341, 2341, 3980, -5899, -5899, 4218, 2404, 4202, 4509, -5899, -5899, -5899, -5899, 4683, -5899, 2741, 4218, 4341, 2654, -5899, -5899, 2707, 2554, 4539, 4812, -5899, 4457, -5899, 4573, 4574, 4838, -5899, -5899, -5899, 93525, 93525, 65530, 93525, 361, 2747, -5899,119414, 93525, 16801, 4458, -5899, 4517, 35506, 2749, 2083, 2770, -5899, -5899, -5899, -5899, 4202, 4218, 93525, 3244, -5899, 45956, 3368, 4841, -5899, 2681, 4586, 4589, 63494, -5899, -5899, -5899, -5899, -5899, 4995, 352, 4882, -5899, -5899, 510, 1499,115921, 4692, 859, 2772, -5899, 4526, 2774, 131, -5899, 4218, -5899, -5899, 3503, -5899, -5899, 919, -5899, 4518, 4519, -5899, 2776, -5899, -5899, -5899, -5899, 35506, 65530, 2389, 4473, -5899, -5899, 4679, 510, 2625, 4679, -5899, -5899, -5899, 1688, -5899, -5899, 4218, 72147, 4834, 4836, -5899, 63494, 1114, 4544, 93525, 4483, -5899, 1499, -5899, 252, 2625, 4543, 3368, 4485, 72147, 72147, -5899, 4487, 93525, 4937,115921, -5899, 1499, 252, 4526, -5899, 63494, -5899, -5899, 510, -5899, 4489, 2780, -5899, 1499, -5899, 2793,115921, -5899, -5899, -5899, 2802, -5899 }; /* 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[] = { 1725, 1462, 668, 1551, 1550, 1462, 0, 273, 0, 1562, 0, 1462, 441, 1119, 0, 0, 0, 0, 668, 1462, 0, 1725, 0, 0, 0, 0, 0, 1738, 0, 0, 0, 0, 0, 0, 1259, 0, 0, 0, 1462, 0, 0, 1745, 0, 0, 0, 0, 1738, 0, 1564, 0, 0, 0, 0, 1745, 0, 0, 0, 0, 0, 2, 9, 10, 45, 80, 81, 38, 37, 98, 63, 24, 71, 133, 132, 134, 50, 46, 88, 33, 35, 47, 51, 73, 75, 40, 53, 64, 110, 72, 31, 70, 76, 96, 58, 19, 20, 59, 21, 60, 22, 61, 106, 82, 99, 43, 69, 30, 52, 78, 79, 12, 54, 86, 18, 65, 66, 68, 91, 92, 93, 116, 94, 128, 49, 125, 103, 104, 122, 105, 123, 16, 107, 62, 23, 119, 118, 120, 89, 55, 90, 77, 97, 117, 34, 121, 25, 26, 28, 29, 27, 67, 36, 74, 39, 95, 124, 114, 109, 129, 127, 11, 135, 111, 83, 14, 15, 100, 13, 32, 57, 17, 42, 41, 56, 48, 131, 44, 1562, 102, 115, 101, 84, 108, 87, 112, 130, 113, 85, 126, 1689, 1688, 1749, 1692, 1724, 0, 1704, 1461, 1460, 1475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1472, 2453, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2486, 2485, 2487, 2488, 2860, 2489, 2490, 2491, 2797, 2798, 2861, 2799, 2800, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2801, 2802, 2501, 2502, 2503, 2504, 2505, 2803, 2862, 2506, 2507, 2508, 2509, 2510, 2511, 2863, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2864, 2522, 2523, 2524, 2865, 2525, 2526, 2527, 2528, 2529, 2530, 2804, 2805, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2806, 2561, 2562, 2563, 2564, 2807, 2565, 2566, 2567, 2568, 2808, 2569, 2570, 2571, 2572, 2866, 2867, 2573, 2574, 2575, 2576, 2577, 2809, 2810, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2868, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2869, 2811, 2598, 2599, 2600, 2601, 2812, 2813, 2814, 2602, 2870, 2871, 2603, 2872, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2826, 2873, 2612, 2874, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2827, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2828, 2875, 2829, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2830, 2831, 2642, 2643, 2644, 2876, 2645, 2832, 2646, 2833, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2834, 2877, 2658, 2878, 2835, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2836, 2673, 2837, 2676, 2674, 2675, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 2687, 2838, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2879, 2707, 2708, 2709, 2710, 2711, 2839, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2840, 2729, 2730, 2880, 2731, 2732, 2841, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2842, 2749, 2750, 2751, 2752, 2881, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2843, 2844, 2760, 2761, 2845, 2762, 2846, 2763, 2764, 2765, 2766, 2767, 2768, 2770, 2769, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2847, 2848, 2782, 2882, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2794, 2795, 2796, 146, 0, 0, 2420, 2454, 2455, 2458, 2453, 411, 410, 1678, 2417, 2454, 1561, 0, 1540, 668, 0, 1475, 440, 1725, 0, 0, 0, 0, 0, 0, 885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 140, 0, 0, 465, 464, 0, 0, 1091, 470, 0, 0, 0, 0, 0, 658, 1603, 2674, 1601, 1679, 274, 277, 278, 275, 276, 2436, 0, 1231, 1232, 1234, 0, 0, 1244, 925, 926, 0, 0, 0, 939, 0, 0, 0, 923, 0, 0, 0, 945, 0, 942, 0, 0, 946, 943, 920, 944, 927, 0, 919, 0, 0, 1244, 947, 0, 0, 921, 0, 0, 0, 0, 1475, 1600, 471, 1725, 0, 1584, 1585, 1586, 1562, 1574, 1587, 1579, 1581, 1580, 1582, 1583, 1578, 0, 2435, 2472, 1015, 1015, 1015, 1015, 1012, 1013, 1015, 1015, 1015, 2695, 0, 0, 994, 0, 996, 2437, 1015, 1020, 2480, 550, 550, 550, 0, 1019, 1024, 550, 0, 1443, 1484, 2419, 1737, 0, 995, 1442, 0, 0, 0, 2760, 1590, 0, 0, 0, 0, 2714, 1452, 256, 2726, 2843, 2760, 255, 249, 251, 223, 0, 0, 1019, 550, 0, 1475, 1450, 991, 1744, 1742, 0, 2404, 2499, 2516, 2615, 246, 2707, 2716, 2726, 2843, 2760, 2793, 202, 212, 207, 0, 267, 2726, 2843, 2760, 263, 1472, 0, 1705, 1855, 1854, 2413, 0, 1445, 1444, 1563, 0, 1566, 0, 2690, 1709, 1712, 1568, 1710, 2456, 1948, 1977, 1955, 1977, 1977, 1944, 1944, 2546, 1957, 1945, 1946, 1982, 2002, 0, 1977, 1944, 1949, 0, 1947, 1985, 1985, 1972, 3, 1927, 1928, 1929, 1930, 1958, 1959, 1931, 1964, 1965, 1969, 1932, 1999, 1935, 1944, 2457, 1746, 1747, 2404, 4, 2450, 5, 2331, 2449, 6, 7, 1701, 0, 0, 1, 1725, 0, 1573, 1741, 1741, 0, 1741, 0, 1693, 1701, 1696, 1700, 0, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 950, 0, 1487, 1076, 0, 0, 0, 0, 0, 1328, 0, 1128, 1127, 2459, 2442, 2443, 2444, 0, 2440, 2441, 2460, 2461, 2462, 0, 2584, 1328, 0, 0, 2247, 2258, 2259, 2260, 2503, 2565, 2255, 2256, 2257, 2249, 2250, 2251, 2252, 2253, 2254, 0, 0, 1226, 2248, 0, 2584, 0, 1328, 0, 173, 0, 150, 1328, 0, 0, 2584, 0, 0, 2584, 0, 0, 0, 0, 0, 2584, 0, 0, 0, 0, 0, 173, 2620, 0, 150, 2584, 0, 0, 1466, 0, 0, 0, 1468, 1471, 1458, 0, 2328, 0, 2329, 2421, 1555, 0, 1554, 1548, 1558, 1553, 1543, 0, 2413, 0, 0, 0, 0, 933, 0, 0, 923, 0, 0, 0, 934, 0, 935, 936, 0, 0, 0, 0, 932, 0, 1456, 1448, 0, 1592, 1594, 1593, 1595, 1591, 550, 0, 0, 0, 2584, 0, 150, 1526, 0, 2584, 150, 0, 0, 469, 468, 150, 2440, 467, 466, 2503, 2565, 0, 1118, 0, 1201, 150, 2584, 0, 194, 2584, 727, 2584, 1568, 139, 0, 671, 0, 839, 2620, 150, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 657, 668, 1604, 1602, 0, 1235, 248, 247, 1233, 937, 2584, 1160, 145, 0, 0, 2584, 1507, 2584, 145, 954, 938, 0, 924, 2584, 145, 1124, 2584, 2445, 183, 0, 922, 2503, 2565, 2584, 145, 1228, 0, 2584, 145, 2584, 179, 2584, 145, 2584, 145, 2584, 672, 0, 0, 2584, 145, 2584, 2620, 181, 941, 2584, 145, 948, 2584, 145, 2415, 2584, 0, 1459, 0, 1596, 0, 1576, 2847, 0, 1725, 0, 0, 1015, 1014, 0, 1015, 0, 1015, 0, 1015, 0, 1015, 0, 0, 0, 1015, 2438, 2439, 997, 0, 1021, 0, 1029, 0, 1028, 1027, 1026, 0, 0, 0, 1030, 0, 1859, 1632, 0, 1440, 250, 201, 0, 262, 261, 1455, 0, 0, 0, 142, 0, 1257, 1254, 142, 1256, 1255, 142, 142, 1451, 254, 252, 0, 0, 0, 0, 0, 0, 1457, 0, 1449, 0, 0, 0, 2423, 2425, 2426, 2261, 2331, 0, 2798, 2799, 2800, 2320, 0, 2801, 2802, 2803, 2862, 2135, 2121, 2130, 2136, 2122, 2124, 2131, 2804, 2805, 2070, 2806, 2807, 2433, 2808, 2809, 2810, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2825, 2826, 2126, 2128, 2827, 2828, 2829, 2831, 0, 2434, 2832, 2833, 2653, 2835, 2836, 2838, 2839, 2132, 2841, 2842, 2133, 2843, 2844, 2845, 2846, 2432, 513, 2134, 2848, 2850, 2851, 2852, 2853, 2855, 2856, 2857, 2858, 0, 0, 0, 2410, 0, 2099, 0, 1936, 1937, 1960, 1961, 1938, 1966, 1967, 1939, 0, 1940, 2409, 2003, 2206, 2098, 2116, 0, 2104, 2105, 0, 2097, 2093, 2208, 1727, 2405, 0, 2094, 2422, 2424, 2321, 1727, 2403, 215, 269, 0, 270, 2411, 2726, 203, 245, 217, 244, 218, 216, 0, 2501, 204, 0, 0, 205, 0, 0, 0, 0, 266, 264, 0, 1447, 0, 1857, 1856, 2414, 959, 0, 1565, 1562, 2271, 0, 1711, 0, 0, 0, 1976, 1963, 1971, 1970, 0, 1953, 1952, 1951, 0, 1950, 1977, 1977, 1975, 1954, 1927, 0, 0, 0, 1981, 0, 1979, 1923, 1919, 0, 1988, 1989, 1990, 1987, 2000, 1986, 0, 1933, 1991, 0, 1944, 1941, 1812, 0, 1691, 1690, 8, 0, 1570, 1572, 1546, 1568, 1739, 1740, 0, 0, 0, 0, 0, 0, 0, 0, 1799, 1757, 1758, 1760, 1796, 1800, 1808, 0, 1697, 0, 0, 0, 1861, 1647, 0, 1473, 0, 0, 0, 0, 0, 1159, 0, 0, 0, 0, 951, 0, 0, 0, 1493, 0, 1495, 1496, 1497, 0, 0, 0, 0, 1498, 1499, 1487, 258, 1506, 1503, 1486, 1488, 1501, 0, 0, 0, 0, 0, 0, 0, 1518, 0, 187, 188, 0, 684, 668, 0, 2584, 0, 0, 0, 0, 1169, 1176, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 1170, 1168, 0, 1171, 260, 1181, 1208, 1211, 0, 0, 1126, 1129, 0, 0, 0, 0, 0, 1318, 0, 0, 0, 1318, 0, 0, 0, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 287, 300, 366, 0, 649, 0, 0, 0, 652, 0, 2584, 1328, 0, 0, 0, 1230, 0, 0, 0, 0, 0, 0, 0, 0, 1211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 154, 0, 0, 0, 0, 1211, 0, 0, 0, 0, 0, 0, 0, 635, 648, 0, 0, 0, 0, 0, 645, 0, 0, 150, 290, 625, 631, 0, 0, 0, 734, 733, 0, 0, 0, 0, 0, 0, 1416, 0, 1415, 0, 0, 0, 0, 0, 1516, 1515, 0, 0, 0, 0, 0, 1318, 0, 279, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 403, 404, 0, 0, 0, 154, 0, 0, 1318, 0, 292, 0, 0, 1467, 1464, 1465, 0, 1470, 0, 0, 0, 0, 2107, 0, 2275, 1749, 2273, 1144, 2327, 0, 2463, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2324, 2323, 2418, 2464, 2465, 2466, 2467, 2330, 1538, 0, 234, 235, 233, 1556, 236, 1557, 1552, 0, 1539, 0, 0, 0, 0, 0, 0, 0, 0, 2503, 2565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 847, 1487, 1525, 0, 0, 0, 677, 0, 2584, 0, 152, 886, 0, 837, 470, 0, 0, 0, 0, 1392, 152, 0, 0, 190, 0, 0, 731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 838, 0, 0, 152, 0, 2584, 628, 2584, 0, 550, 550, 0, 0, 141, 138, 0, 0, 0, 0, 0, 0, 0, 0, 1683, 1682, 1685, 1684, 0, 1681, 0, 143, 144, 0, 1218, 1243, 0, 0, 0, 0, 0, 915, 940, 0, 0, 1212, 0, 0, 2584, 145, 2584, 0, 2584, 0, 0, 0, 1220, 145, 0, 1214, 0, 0, 1216, 0, 1418, 0, 931, 929, 928, 930, 0, 0, 913, 0, 0, 0, 0, 0, 908, 0, 0, 910, 0, 0, 0, 0, 1725, 1575, 0, 0, 0, 1005, 0, 1009, 0, 1000, 0, 1006, 0, 1001, 998, 999, 0, 1004, 0, 0, 551, 553, 0, 0, 2528, 2545, 0, 2573, 2608, 2609, 2663, 2680, 2710, 2716, 2722, 0, 2753, 2765, 0, 1035, 1073, 1025, 743, 0, 0, 1642, 1441, 2280, 0, 1725, 0, 0, 1258, 0, 0, 138, 253, 224, 0, 0, 1073, 0, 2714, 1454, 990, 668, 0, 2095, 0, 2102, 2103, 2319, 0, 0, 0, 0, 0, 0, 2101, 0, 0, 0, 0, 2376, 0, 0, 2376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2026, 0, 0, 2279, 0, 0, 2279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2027, 2008, 2009, 2099, 2271, 0, 2100, 2429, 0, 1999, 2468, 2261, 0, 2258, 2259, 2260, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 0, 2978, 2979, 2980, 2981, 2982, 2984, 2983, 2985, 2986, 2987, 2988, 2989, 2990, 2334, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 2041, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 2043, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3255, 3253, 3254, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3314, 3313, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3371, 3370, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 0, 2255, 2256, 2257, 2249, 2250, 2251, 2252, 2253, 2254, 2265, 0, 0, 2408, 2469, 0, 2208, 0, 2023, 0, 2216, 0, 0, 1812, 0, 2427, 2322, 1812, 271, 272, 268, 0, 0, 220, 219, 0, 238, 242, 243, 214, 241, 0, 237, 222, 2192, 2191, 221, 213, 210, 208, 225, 227, 228, 211, 209, 265, 0, 0, 0, 145, 1573, 1560, 0, 0, 2334, 0, 2269, 0, 0, 2267, 0, 0, 0, 1809, 0, 1713, 0, 1717, 0, 0, 0, 1974, 1973, 1924, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 952, 0, 1942, 0, 1877, 2451, 2452, 2332, 1745, 1573, 0, 1569, 1708, 1707, 1750, 1751, 1110, 1706, 1779, 1780, 0, 0, 0, 0, 1805, 1803, 1770, 1761, 1769, 0, 0, 1767, 0, 1771, 2003, 1798, 1695, 1755, 1756, 1759, 1694, 0, 1801, 0, 1645, 1799, 1760, 1629, 1606, 1607, 0, 0, 1862, 0, 1474, 0, 0, 0, 1139, 1141, 0, 1140, 0, 1143, 0, 1152, 0, 0, 1138, 1157, 0, 1146, 1144, 0, 1514, 0, 0, 0, 0, 0, 1494, 0, 0, 0, 2753, 257, 1497, 1502, 1489, 1500, 0, 0, 0, 0, 0, 1075, 1074, 0, 0, 0, 1521, 544, 0, 368, 0, 0, 0, 0, 0, 0, 0, 0, 833, 830, 0, 0, 829, 0, 682, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 707, 0, 1318, 0, 298, 0, 1178, 0, 1177, 0, 1182, 0, 0, 1179, 1174, 1175, 2716, 2726, 2760, 259, 1180, 1210, 0, 1209, 1205, 0, 1121, 0, 1122, 0, 0, 0, 0, 0, 0, 0, 2557, 0, 2584, 0, 513, 306, 330, 535, 0, 1317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, 355, 354, 0, 0, 0, 0, 0, 360, 0, 338, 0, 339, 0, 359, 0, 0, 0, 650, 651, 0, 0, 0, 1318, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, 1227, 0, 760, 0, 0, 2716, 1206, 0, 1401, 0, 2752, 1402, 1405, 550, 0, 550, 1407, 0, 0, 1404, 1406, 0, 0, 176, 0, 171, 175, 0, 0, 2716, 1207, 0, 0, 0, 0, 0, 633, 634, 647, 0, 638, 639, 636, 640, 641, 0, 0, 0, 0, 0, 0, 0, 632, 0, 0, 729, 728, 732, 0, 0, 0, 0, 0, 0, 1410, 0, 0, 1201, 0, 0, 1409, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1261, 1260, 0, 0, 0, 0, 1328, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 747, 0, 746, 0, 172, 177, 0, 0, 0, 0, 0, 0, 0, 0, 232, 1463, 1469, 1749, 1749, 1749, 2113, 0, 0, 0, 0, 1748, 2325, 2328, 1543, 1549, 1542, 1541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 417, 414, 415, 417, 0, 0, 0, 0, 849, 0, 852, 855, 1485, 497, 0, 0, 674, 707, 0, 0, 473, 185, 0, 0, 0, 0, 762, 0, 1201, 1200, 147, 138, 194, 471, 0, 193, 195, 197, 198, 199, 196, 200, 0, 726, 730, 0, 0, 0, 0, 670, 0, 0, 0, 0, 0, 0, 0, 1882, 0, 0, 170, 0, 0, 623, 627, 0, 0, 0, 0, 473, 589, 379, 2584, 0, 550, 0, 2584, 0, 137, 0, 836, 0, 0, 0, 1163, 1163, 0, 0, 776, 775, 0, 0, 0, 0, 0, 0, 1680, 145, 1161, 0, 1508, 0, 145, 955, 145, 1125, 184, 2446, 0, 917, 0, 0, 0, 0, 145, 1229, 905, 145, 180, 145, 145, 673, 0, 145, 182, 0, 0, 145, 949, 145, 2416, 0, 145, 1599, 2584, 550, 1577, 0, 0, 1002, 1011, 1010, 1008, 1007, 1003, 0, 1022, 0, 549, 0, 0, 0, 0, 0, 1043, 1044, 0, 0, 1040, 1045, 0, 1047, 1031, 1033, 1041, 1042, 1048, 1037, 1036, 1049, 1050, 0, 0, 0, 1062, 741, 0, 0, 0, 0, 1639, 0, 1637, 0, 1860, 1641, 1630, 1589, 0, 1588, 0, 616, 1252, 1251, 1253, 0, 1019, 0, 145, 0, 1453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2284, 0, 2285, 0, 0, 2318, 2314, 0, 0, 0, 0, 0, 2288, 2291, 2292, 2293, 2290, 2294, 2289, 0, 0, 2295, 0, 0, 2369, 2386, 0, 2099, 2369, 2397, 0, 2396, 2402, 0, 2275, 2003, 0, 0, 2393, 2387, 0, 2393, 0, 0, 2376, 0, 0, 0, 0, 2176, 0, 0, 0, 2275, 2278, 0, 0, 2839, 0, 0, 0, 0, 2071, 0, 0, 2242, 0, 2275, 0, 0, 0, 0, 0, 0, 0, 2271, 2310, 0, 511, 0, 2061, 0, 0, 0, 2190, 0, 2187, 0, 0, 0, 0, 2331, 0, 0, 2430, 2004, 2019, 2020, 2021, 2024, 2407, 2007, 0, 2333, 0, 0, 2005, 2032, 0, 2311, 2057, 0, 2062, 2047, 2377, 2296, 2297, 2298, 2299, 2064, 0, 2040, 2045, 2049, 0, 2386, 2028, 0, 2025, 0, 2334, 2270, 0, 2268, 0, 2016, 2017, 2018, 2010, 2011, 2012, 2013, 2014, 2015, 2022, 2246, 2244, 2245, 0, 0, 2216, 0, 0, 2044, 0, 0, 2115, 2576, 2615, 0, 1738, 1738, 1738, 1726, 1736, 2406, 1877, 1749, 1877, 2412, 0, 0, 1999, 0, 1858, 957, 958, 956, 1545, 1559, 1573, 2272, 1567, 1715, 0, 0, 0, 1943, 1956, 0, 1983, 1984, 1985, 1985, 0, 1925, 0, 1968, 1993, 1994, 1995, 1996, 1997, 1998, 0, 1992, 1934, 953, 2815, 2824, 0, 2712, 2859, 0, 1838, 1811, 1813, 1823, 1838, 1845, 1838, 1838, 2117, 1875, 2118, 2119, 2413, 0, 1782, 2448, 1547, 1571, 0, 1108, 1109, 0, 1113, 2839, 2712, 0, 0, 0, 0, 1772, 1806, 0, 1797, 0, 2423, 1773, 2422, 1774, 1777, 1778, 1768, 1807, 1643, 0, 1802, 1699, 1698, 0, 1880, 0, 0, 1863, 1810, 1368, 1262, 1329, 1142, 0, 1944, 1153, 0, 1137, 0, 1136, 1944, 0, 1154, 0, 1944, 1369, 1263, 1330, 1370, 1264, 1331, 1371, 1505, 1265, 1504, 1492, 1491, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 814, 2584, 145, 1519, 1372, 0, 1266, 367, 1520, 1332, 1524, 832, 831, 0, 0, 1333, 0, 683, 688, 0, 690, 691, 2503, 2565, 692, 695, 696, 0, 698, 687, 686, 0, 0, 0, 0, 0, 704, 709, 0, 0, 0, 0, 0, 0, 1172, 1173, 1373, 1269, 0, 1334, 0, 1120, 0, 1270, 186, 0, 0, 286, 0, 2584, 308, 0, 0, 0, 0, 0, 0, 0, 0, 814, 495, 814, 0, 1320, 305, 336, 0, 351, 346, 347, 345, 2584, 145, 2584, 145, 0, 0, 0, 0, 0, 348, 343, 344, 340, 0, 0, 353, 2475, 2547, 2727, 0, 715, 717, 0, 722, 356, 1290, 375, 374, 373, 0, 361, 0, 380, 383, 0, 358, 337, 335, 332, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1222, 0, 1376, 1335, 0, 1357, 1361, 0, 0, 0, 754, 1379, 1276, 1338, 0, 550, 0, 0, 565, 565, 550, 1390, 1277, 174, 1307, 163, 0, 0, 159, 0, 0, 0, 0, 153, 1380, 1278, 1339, 0, 0, 1381, 1279, 0, 0, 291, 626, 637, 642, 1284, 646, 643, 1347, 644, 1388, 1280, 0, 1384, 1310, 1342, 393, 609, 392, 1201, 1201, 1391, 1411, 1281, 1201, 0, 1318, 0, 280, 282, 0, 142, 0, 1282, 0, 1340, 1383, 1309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1527, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 1320, 2584, 145, 874, 1382, 0, 1315, 0, 1355, 0, 0, 0, 405, 0, 1308, 1318, 0, 293, 1286, 0, 1349, 0, 0, 230, 229, 231, 0, 0, 0, 0, 2276, 2277, 0, 2274, 2108, 2327, 0, 1537, 979, 965, 978, 0, 961, 2545, 0, 964, 966, 0, 0, 0, 967, 971, 972, 0, 963, 960, 962, 0, 416, 0, 0, 771, 772, 0, 0, 0, 0, 851, 0, 0, 1517, 0, 150, 681, 0, 0, 0, 676, 706, 711, 0, 0, 0, 0, 472, 476, 480, 481, 482, 0, 0, 0, 0, 164, 151, 0, 894, 0, 550, 0, 764, 1201, 1394, 0, 194, 189, 0, 0, 727, 0, 1568, 0, 0, 604, 607, 606, 0, 379, 846, 844, 843, 845, 867, 842, 0, 1881, 1883, 0, 0, 0, 0, 0, 0, 616, 475, 0, 0, 553, 0, 592, 0, 0, 0, 0, 589, 0, 0, 0, 2456, 0, 863, 835, 0, 1131, 0, 1149, 1132, 0, 0, 0, 0, 1186, 1193, 1162, 1187, 1164, 1193, 0, 0, 777, 781, 780, 784, 782, 0, 778, 655, 1686, 1687, 0, 1219, 0, 0, 1513, 0, 1511, 916, 1213, 145, 0, 145, 0, 145, 1221, 1215, 1217, 1419, 0, 914, 0, 0, 907, 909, 0, 911, 0, 0, 0, 0, 1621, 1609, 0, 1812, 1648, 0, 2331, 1023, 552, 0, 0, 0, 0, 0, 0, 1039, 653, 1046, 0, 0, 0, 1061, 1056, 1058, 0, 1073, 1067, 0, 740, 0, 0, 1640, 1633, 1635, 1634, 0, 0, 1631, 2281, 906, 0, 622, 0, 1073, 1064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1743, 2282, 2283, 0, 0, 0, 2315, 0, 0, 2152, 0, 2123, 2125, 2138, 0, 2153, 2106, 0, 2368, 2365, 0, 0, 0, 2369, 2376, 2172, 0, 0, 0, 2376, 0, 2396, 0, 0, 0, 2167, 2169, 0, 0, 0, 2386, 2386, 0, 2174, 0, 0, 2154, 2127, 2129, 2139, 0, 0, 2262, 0, 2142, 2141, 0, 2073, 2074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2088, 2143, 2241, 0, 0, 0, 2145, 2144, 0, 0, 2309, 0, 0, 0, 2150, 512, 2155, 0, 0, 0, 0, 2161, 0, 2198, 0, 0, 0, 2096, 2272, 0, 0, 0, 0, 0, 0, 0, 2379, 2380, 2381, 2378, 0, 2063, 2048, 2066, 2042, 2046, 2050, 0, 2386, 2065, 2068, 0, 0, 2036, 0, 0, 2034, 2058, 2030, 0, 0, 2059, 0, 2114, 0, 0, 0, 2219, 2214, 2215, 1738, 1738, 1738, 1738, 1735, 0, 0, 0, 1782, 0, 1782, 206, 0, 239, 226, 1544, 1716, 1725, 1962, 0, 1980, 1978, 1921, 1926, 2001, 0, 1838, 1845, 1838, 1838, 0, 0, 1701, 0, 1823, 0, 1837, 1821, 1836, 0, 0, 1851, 1849, 0, 1851, 0, 1851, 0, 1815, 0, 1841, 1817, 1836, 1819, 1825, 0, 1867, 2414, 1876, 0, 1795, 1752, 0, 2263, 1113, 0, 1754, 1776, 1775, 0, 1765, 0, 1804, 1762, 1644, 1628, 0, 1626, 1608, 0, 0, 1944, 1134, 1135, 0, 1158, 0, 1078, 1079, 0, 1077, 0, 0, 0, 543, 546, 0, 1522, 0, 1389, 1306, 685, 0, 0, 0, 0, 700, 659, 701, 703, 0, 0, 702, 705, 708, 1318, 0, 299, 1292, 0, 1353, 1166, 0, 0, 1123, 0, 0, 0, 0, 0, 1094, 534, 1093, 0, 0, 0, 0, 814, 0, 0, 538, 0, 494, 491, 331, 0, 0, 0, 0, 388, 0, 310, 323, 386, 329, 0, 363, 0, 334, 0, 327, 349, 341, 350, 342, 362, 364, 0, 719, 720, 718, 714, 0, 721, 723, 0, 377, 0, 0, 0, 395, 357, 394, 0, 1375, 0, 1318, 0, 295, 1288, 0, 1351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1356, 0, 0, 0, 0, 759, 0, 756, 0, 565, 0, 1403, 0, 1400, 1398, 565, 0, 0, 156, 155, 0, 162, 0, 0, 0, 0, 0, 0, 1412, 1413, 1414, 0, 0, 0, 0, 0, 0, 399, 0, 302, 304, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 406, 370, 0, 870, 0, 0, 0, 408, 0, 0, 1367, 0, 0, 0, 0, 0, 1374, 1271, 2111, 2112, 2109, 1749, 2326, 0, 0, 0, 976, 0, 0, 0, 0, 419, 420, 150, 418, 443, 0, 814, 0, 0, 848, 853, 861, 2653, 2249, 2250, 859, 854, 856, 858, 860, 857, 0, 0, 0, 0, 516, 0, 0, 0, 503, 0, 0, 513, 496, 499, 500, 0, 0, 677, 680, 678, 679, 0, 699, 0, 475, 523, 579, 0, 166, 0, 0, 167, 165, 0, 0, 379, 761, 0, 758, 1393, 0, 192, 0, 731, 0, 0, 0, 0, 0, 1201, 669, 0, 866, 868, 840, 0, 711, 0, 0, 628, 0, 550, 1600, 611, 0, 581, 475, 579, 588, 0, 0, 596, 378, 0, 0, 616, 379, 0, 0, 1094, 0, 862, 0, 0, 1130, 0, 0, 0, 1183, 1188, 1184, 0, 1163, 1145, 0, 1185, 0, 0, 1191, 1116, 1165, 1117, 1435, 1436, 1433, 1434, 0, 0, 0, 0, 0, 0, 1677, 0, 0, 1509, 0, 918, 0, 901, 0, 903, 145, 748, 0, 145, 0, 1613, 1615, 1614, 0, 0, 1616, 2331, 0, 1626, 1653, 0, 0, 1880, 0, 1652, 0, 0, 0, 0, 0, 1038, 0, 1032, 1034, 1059, 0, 0, 1073, 1072, 0, 1063, 1071, 1069, 1070, 1068, 0, 0, 1638, 1636, 614, 0, 0, 145, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2286, 0, 2317, 2313, 0, 2120, 2287, 2367, 2383, 2385, 2173, 2375, 0, 0, 0, 2398, 0, 0, 2376, 2336, 2390, 2389, 0, 0, 2388, 2376, 2376, 2336, 2175, 2336, 0, 0, 0, 2242, 0, 0, 2072, 2084, 2085, 2086, 2302, 0, 2091, 0, 2081, 2082, 2083, 2075, 2076, 2077, 2078, 2079, 2080, 2087, 2306, 2305, 0, 0, 2147, 2148, 2149, 2308, 2156, 0, 2493, 2199, 0, 2160, 2189, 2188, 0, 0, 0, 2163, 0, 0, 2185, 0, 2243, 2431, 2006, 0, 0, 2033, 2312, 2051, 0, 2067, 2069, 2029, 2262, 0, 0, 0, 0, 0, 2038, 0, 0, 2239, 0, 0, 0, 2221, 2218, 0, 0, 0, 0, 1729, 1728, 1734, 1795, 2108, 1795, 0, 0, 1922, 0, 1822, 1818, 1820, 1826, 0, 2854, 0, 1827, 1834, 0, 1814, 0, 1850, 1846, 0, 1847, 0, 0, 1848, 0, 0, 1816, 0, 1834, 0, 1874, 1741, 0, 2210, 0, 1753, 1111, 1112, 1763, 0, 1766, 2524, 1878, 0, 1627, 0, 1155, 0, 0, 1147, 1084, 1085, 1088, 1086, 1083, 1087, 0, 0, 0, 814, 817, 0, 0, 0, 815, 145, 1267, 0, 0, 0, 0, 660, 1387, 1268, 0, 0, 0, 0, 1167, 1321, 0, 0, 1291, 814, 0, 0, 0, 560, 0, 1107, 1107, 0, 307, 0, 540, 601, 0, 493, 492, 0, 490, 711, 0, 0, 314, 324, 0, 319, 0, 1319, 0, 0, 0, 0, 318, 321, 320, 390, 0, 387, 0, 145, 145, 365, 716, 376, 381, 382, 385, 1326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 895, 878, 0, 0, 896, 897, 0, 0, 0, 1224, 1225, 1223, 1358, 1359, 1365, 1362, 1360, 1364, 1366, 1363, 0, 1274, 0, 0, 752, 1322, 1395, 1397, 1396, 0, 1399, 160, 157, 158, 161, 1323, 1304, 1285, 1348, 610, 0, 0, 0, 1283, 0, 1341, 0, 1300, 1294, 0, 0, 0, 0, 0, 1386, 1314, 1346, 1385, 1312, 1344, 1311, 1343, 1313, 1345, 1305, 0, 0, 1885, 875, 0, 0, 0, 145, 145, 873, 750, 1287, 0, 1350, 1296, 0, 0, 0, 968, 0, 0, 0, 970, 424, 444, 150, 0, 770, 834, 0, 0, 850, 0, 501, 0, 507, 514, 0, 0, 518, 519, 517, 502, 1201, 550, 1201, 803, 804, 0, 0, 824, 0, 675, 0, 0, 473, 0, 520, 0, 0, 477, 169, 168, 0, 0, 0, 765, 769, 767, 766, 768, 763, 0, 754, 194, 2584, 0, 0, 0, 0, 608, 602, 605, 1408, 841, 0, 1884, 744, 0, 379, 624, 0, 0, 0, 473, 616, 0, 478, 483, 484, 497, 0, 589, 580, 0, 581, 590, 591, 0, 598, 1483, 0, 617, 598, 0, 0, 0, 865, 0, 864, 0, 1133, 1150, 1151, 0, 0, 1193, 0, 0, 1195, 1190, 0, 0, 783, 786, 779, 662, 145, 0, 1512, 145, 145, 1250, 0, 912, 0, 0, 0, 1618, 1624, 1605, 0, 0, 1649, 1626, 1650, 1053, 1054, 1055, 1052, 1051, 654, 0, 1057, 1016, 1066, 742, 0, 615, 0, 1017, 145, 993, 985, 992, 981, 984, 986, 0, 988, 989, 983, 980, 982, 2316, 2137, 0, 2382, 2384, 2171, 2395, 2394, 2170, 2401, 0, 0, 2364, 2392, 2391, 0, 0, 2376, 2376, 2140, 2151, 0, 2241, 2272, 0, 0, 2092, 0, 0, 0, 2146, 2849, 0, 0, 2203, 2204, 0, 2200, 2201, 2196, 2197, 2162, 0, 2641, 2180, 0, 0, 2195, 2055, 2053, 2052, 2037, 0, 0, 2035, 2031, 0, 2060, 2205, 2238, 2272, 2207, 0, 1749, 1733, 1732, 1731, 1730, 2210, 2428, 2210, 240, 1720, 0, 1870, 0, 1873, 0, 0, 1824, 0, 0, 1828, 0, 0, 1830, 1832, 0, 0, 0, 0, 0, 0, 2417, 0, 1794, 0, 1749, 0, 1764, 0, 1625, 0, 1148, 1156, 0, 0, 0, 545, 819, 818, 821, 816, 820, 1523, 0, 693, 694, 697, 1293, 0, 1354, 1302, 0, 1642, 536, 309, 0, 555, 0, 0, 0, 1100, 140, 1099, 0, 555, 555, 489, 488, 497, 317, 0, 0, 0, 311, 389, 0, 391, 312, 316, 370, 333, 326, 0, 0, 0, 1289, 0, 1352, 1298, 1325, 1377, 1272, 1336, 0, 0, 884, 0, 0, 0, 0, 1378, 1273, 1337, 0, 0, 0, 0, 0, 1642, 0, 0, 0, 0, 0, 0, 0, 0, 1532, 0, 0, 369, 872, 871, 370, 407, 1316, 0, 2110, 0, 969, 974, 975, 973, 0, 413, 421, 424, 0, 0, 1241, 1241, 0, 0, 498, 515, 0, 600, 559, 600, 0, 0, 0, 0, 0, 712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 757, 756, 191, 0, 473, 0, 711, 0, 869, 0, 0, 0, 616, 475, 0, 0, 1597, 474, 0, 0, 486, 0, 592, 581, 589, 0, 0, 613, 0, 1476, 0, 619, 0, 0, 0, 813, 1189, 0, 1203, 0, 1144, 1114, 1198, 0, 1725, 1877, 0, 0, 0, 0, 796, 0, 666, 1242, 1510, 902, 904, 749, 1610, 0, 1611, 1617, 0, 0, 0, 0, 1654, 1646, 1060, 0, 1073, 1065, 987, 2366, 2400, 2335, 2337, 0, 0, 2358, 2351, 2354, 2352, 2353, 2355, 0, 2350, 0, 2168, 2399, 2348, 2362, 2301, 2243, 2089, 0, 2304, 2303, 2307, 0, 2157, 0, 2158, 2202, 2164, 2181, 0, 2165, 2193, 0, 0, 2056, 2054, 2039, 2240, 0, 2225, 1703, 1702, 0, 1723, 1906, 1875, 0, 0, 1869, 0, 0, 1900, 0, 0, 0, 1835, 1853, 0, 1831, 1829, 0, 1842, 0, 1844, 2523, 2810, 2709, 0, 1781, 1783, 1786, 1788, 1787, 1789, 1785, 2209, 2211, 0, 1760, 2264, 1879, 0, 1626, 1656, 1668, 1668, 1061, 0, 145, 689, 0, 0, 288, 1107, 0, 1201, 561, 2653, 562, 1106, 1110, 139, 0, 1201, 1201, 485, 0, 315, 325, 0, 372, 384, 0, 1642, 0, 0, 882, 891, 891, 879, 0, 0, 898, 1275, 753, 0, 564, 0, 283, 1301, 1295, 0, 0, 0, 1534, 1535, 0, 0, 0, 0, 0, 1324, 145, 1297, 977, 0, 446, 454, 425, 429, 1526, 0, 1526, 0, 426, 430, 1526, 1526, 423, 1877, 442, 1241, 0, 1238, 1237, 548, 630, 0, 0, 505, 0, 570, 504, 0, 825, 0, 0, 710, 0, 475, 579, 0, 533, 524, 525, 526, 527, 529, 528, 530, 531, 532, 522, 521, 0, 711, 888, 379, 1483, 751, 0, 0, 724, 0, 711, 0, 1600, 612, 581, 475, 579, 479, 497, 0, 596, 589, 592, 0, 593, 0, 597, 0, 0, 0, 616, 1536, 1094, 0, 1095, 0, 814, 1202, 1163, 0, 0, 1192, 1196, 1197, 0, 0, 0, 0, 1245, 790, 791, 785, 787, 0, 798, 802, 661, 0, 0, 665, 656, 0, 0, 0, 0, 1651, 711, 145, 0, 0, 2349, 2356, 2357, 0, 2178, 0, 0, 2374, 0, 0, 0, 2090, 0, 0, 2183, 2182, 2194, 2166, 2220, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 2336, 1868, 1871, 0, 1903, 0, 0, 0, 0, 1888, 0, 1833, 0, 0, 1843, 0, 0, 0, 1790, 0, 0, 0, 1799, 1663, 0, 1655, 1657, 0, 0, 0, 1080, 0, 1081, 1303, 0, 1101, 0, 600, 0, 1113, 1110, 550, 600, 600, 630, 0, 0, 328, 0, 296, 1299, 0, 0, 893, 893, 0, 0, 0, 0, 0, 0, 401, 0, 0, 1528, 0, 1529, 1530, 1533, 409, 422, 0, 452, 451, 0, 449, 448, 450, 0, 439, 0, 0, 0, 0, 0, 0, 412, 1236, 1240, 1239, 0, 506, 0, 508, 0, 0, 556, 557, 558, 0, 510, 566, 567, 822, 0, 827, 0, 713, 0, 0, 711, 578, 735, 0, 0, 0, 1477, 0, 0, 603, 745, 1483, 616, 589, 0, 581, 487, 0, 598, 592, 596, 594, 595, 0, 1480, 0, 618, 0, 1103, 0, 812, 0, 1193, 1204, 1199, 1194, 1439, 0, 0, 788, 793, 792, 1526, 797, 0, 0, 0, 664, 663, 0, 1623, 1877, 1620, 0, 739, 1018, 2338, 2339, 2363, 0, 0, 0, 2342, 0, 2340, 0, 0, 2362, 0, 2179, 2300, 2186, 2159, 2184, 2797, 2524, 2768, 0, 2237, 2226, 2237, 2237, 2217, 0, 0, 0, 1905, 0, 0, 0, 1901, 1902, 1886, 0, 0, 1890, 1840, 1866, 0, 0, 0, 1784, 2212, 2213, 2447, 1665, 1667, 0, 0, 0, 1642, 0, 565, 0, 1097, 1113, 559, 814, 814, 322, 313, 371, 0, 0, 0, 889, 892, 880, 881, 900, 899, 755, 1642, 0, 397, 396, 0, 400, 0, 447, 457, 0, 455, 427, 432, 0, 438, 437, 434, 433, 428, 431, 547, 0, 0, 0, 0, 0, 0, 568, 0, 569, 0, 826, 0, 0, 0, 737, 887, 0, 0, 473, 711, 1478, 1598, 592, 581, 589, 0, 0, 583, 1107, 1107, 460, 596, 598, 1481, 1482, 0, 0, 513, 1096, 0, 1115, 1438, 1437, 1725, 0, 0, 0, 799, 800, 795, 0, 0, 1612, 1622, 0, 2343, 0, 2346, 0, 2347, 2341, 2371, 2373, 0, 2359, 2360, 0, 2230, 2229, 2228, 2232, 2231, 0, 2224, 2222, 2223, 0, 0, 0, 0, 1872, 0, 1889, 1892, 0, 0, 0, 1898, 0, 1891, 1893, 0, 1852, 0, 1864, 1792, 0, 1791, 0, 1670, 0, 0, 1658, 1659, 0, 0, 1660, 145, 289, 554, 814, 563, 1098, 570, 539, 537, 1642, 883, 0, 284, 0, 402, 1531, 453, 0, 436, 435, 629, 509, 599, 575, 0, 574, 0, 572, 571, 823, 828, 0, 711, 877, 1483, 725, 596, 589, 592, 0, 582, 0, 140, 140, 598, 458, 0, 0, 379, 0, 1421, 1725, 1420, 1422, 1430, 1427, 1429, 1428, 1426, 0, 1248, 1249, 789, 794, 0, 0, 1877, 2344, 2345, 0, 0, 2177, 0, 0, 0, 2234, 0, 2235, 0, 0, 0, 0, 0, 1895, 1896, 1897, 1899, 1894, 1839, 0, 1793, 1664, 1666, 1661, 0, 1662, 0, 0, 0, 0, 1671, 1082, 541, 814, 297, 890, 0, 456, 573, 550, 550, 711, 736, 1479, 598, 592, 596, 1107, 584, 586, 585, 462, 1103, 1104, 0, 598, 802, 0, 1431, 1425, 1701, 1688, 0, 0, 801, 0, 1619, 0, 0, 0, 2227, 2233, 2236, 0, 0, 0, 0, 2634, 0, 1907, 0, 0, 0, 1669, 1675, 0, 0, 0, 542, 0, 577, 576, 738, 461, 596, 598, 140, 513, 1102, 0, 1877, 0, 1423, 1725, 0, 0, 807, 2370, 2372, 2361, 1719, 1718, 2815, 0, 0, 1722, 1915, 0, 2364, 0, 0, 1918, 0, 1865, 0, 0, 0, 398, 598, 459, 587, 379, 1105, 1089, 0, 1424, 0, 0, 809, 0, 805, 808, 810, 811, 0, 0, 0, 0, 1908, 1909, 1918, 0, 2348, 1918, 1887, 1672, 1676, 0, 1673, 463, 598, 0, 0, 0, 773, 0, 1749, 0, 0, 0, 1904, 2364, 1917, 2374, 2348, 0, 1877, 0, 0, 0, 806, 0, 0, 0, 0, 1912, 2362, 2374, 0, 1090, 807, 1246, 1247, 0, 1721, 0, 0, 1910, 2362, 1674, 0, 0, 1913, 1911, 774, 0, 1914 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -5899, -5899, -5899, 4090, -478, -1735, -5153, -1131, 1805, -5899, -5899, -965, 596, 3313, -2458, -5899, -5899, -5899, 1504, -5899, -5899, -5899, -5899, 4051, -5899, -2964, -5899, -5899, 190, 430, -1403, 198, 3620, 1586, -5899, -1005, -5899, -5899, -590, 4, -5899, 451, 665, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -686, 2050, -5899, 2144, 1387, -3184, -5899, -5899, -1552, -3807, -5899, 640, -5899, 666, -4160, -5899, -4862, -1033, -5899, -5899, -5899, 2031, -5899, -5899, -5899, 1982, 1176, -384, -5899, -5899, -5899, -5899, -5899, -5899, -850, -5899, -5899, -1168, 6, -663, -2975, -4334, -5899, -5899, 488, -426, -1506, -5899, 682, -5899, 683, -5899, -4882, -5899, -18, -2777, -3246, -5899, -5899, -5899, -398, -1530, 1419, -5899, 1482, -5899, -778, -1181, 1852, -2495, -994, -5899, -290, -3607, -1142, -865, -863, -1018, -4410, -4921, -5899, -5899, -1161, -3806, -5235, -5493, -4943, -5113, 1437, -5899, -36, 499, -5899, 8, -3690, -3814, 11, 474, -5899, 14, 16, -5899, 490, -787, -1000, -1612, -5899, -757, -5899, -5899, -5899, -3472, -5899, -5899, -5899, 209, -5899, -5899, -5899, -5899, 536, -5899, -5899, -5899, -5899, -5899, -5899, -3244, 2013, 2021, -5899, -4431, -5899, -951, -5899, 700, -3522, 1423, -5899, -5899, 1183, 4080, 523, -5899, -5899, -5899, -5899, -5899, -5899, -1815, -5899, -5899, -5899, -5899, -9, -357, -5899, -5899, -5899, -5899, -5899, -5899, -5899, 18, -5899, 1144, 460, -5899, -5899, -675, -5899, -5899, -5899, -5899, -5899, -5899, -1217, -5219, -1350, -1323, -5899, -3541, -5899, -5899, -5899, -331, -5899, -5899, -5899, -5899, -5899, -808, -5899, 1243, -4199, -5899, -5899, 498, -5899, -5899, -5899, -5899, -5899, -987, -269, 3239, -5899, -532, -759, -5899, -5899, -5899, -266, -5899, -5899, -5899, -5899, -5899, -535, -1284, 5106, 4461, -1124, 14000, -852, -573, -5899, -5899, -5899, -2793, -5899, -5899, -4183, -5899, 5097, 2562, 1696, 25, -5899, 43, 117, 3890, -5899, 1096, -1186, -3160, 444, -486, -5899, -5899, -5899, 447, -5899, -1957, -5899, -5899, -5899, -5899, -4145, 32, -5899, -4421, -5269, -4672, -4191, -1172, -5899, -4529, -5223, -4158, -5899, 2058, -5899, -5899, -530, -180, 3223, -5899, -1495, 2405, -1402, -5899, -2624, 529, 1602, 3230, -3302, -108, 3217, -3044, -5899, -647, 1190, -5899, -347, -3815, -5899, -5899, -5899, -2764, -610, -5899, -5899, 1627, 862, -5899, -5899, -5899, -5899, -671, 3197, -200, -5899, -5899, 4443, -5899, -5050, -5899, 4414, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -1502, 1359, -5899, -847, -5899, -5899, 2161, 745, -5899, -5899, -5899, -5899, 1446, -1243, -5899, -5899, -5899, -5899, -5899, -5899, -5899, -962, -1198, -5899, -5899, -4934, -5899, -5899, -5899, -5899, -5899, 2331, -969, -743, 4309, 442, 34, -5448, -5899, -5899, -463, -5899, 3646, -5899, -5899, -5899, -5899, -5899, 526, 527, -5899, -5899, -5899, -5899, -4429, -5899, -5899, -5096, -5899, -5899, 2138, -5899, -5899, 1031, 3, 3346, -5899, -5899, -5899, -5, -5899, -5899, -1032, 2488, -5899, -2404, -5899, -589, -5899, -5899, -1925, 44, -4407, -5899, -668, -5899, 3183, -5899, -5295, -1114, 5, -5899, -5899, -4461, 40, -5899, -5899, -5899, -5899, -5112, -5899, -664, -5899, -5712, 514, -3845, -5899, 42, -5899, -427, -5899, -5899, -429, -5899, -5899, -5899, -5898, 46, 103, -5899, -5899, 107, 669, -50, -42, -30, 61, 180, 3754, -5899, -5899, -5899, 2, 3794, -5899, 38, -878, 5151, 5152, -5899, -901, -134, 465, 1697, -687, -2645, 3700, 3703, -5899, 1684, 2507, -2475, -2467, -5899, -907, -833, -642, -5899, -5899, -5899, -5899, -1485, -677, -2648, -5899, 3710, -5899, -5899, -5899, -2435, -3421, -3333, 1721, -3342, -3219, -5899, 961, 946, -918, -97, 70, -1498, -795, -829, -5899, -5899, 1733, -368, -5899, -5899, -364, -3331, 544, -5899, -4639, -2851, 1737, -1129, -810, -5899, -956, -5899, -611, 1743, -5899, -4067, -1159, -5899, -3853, 379, 3773, -835, -5899, -5899, -819, 9739, -5899, -5899, -5899, 10271, 10419, -5899, -5899, 11346, 12119, -5899, -552, 13065, 8960, -796, -1961, -63, 13260, 17536, -1854, -355, 49, -5899, -2952, -2608, -5899, -5899, -5899, -332, 1062, 633, -5899, -5899, -4693, -4493, -5899, 2646, -1935, -5899, -615, 1813, -602, -5899, -5899, -5899, -2893, -5633, -3075, 2637, -5899, -5899, -5899, -202, -5899, 18732, -3276, -5899, -710, -1034, -1618, 3148, -3084, -1922, -5899, -5899, -5899, -3149, -5899, -5899, -5899, -873, 1849, -5899, -5899, 1972, -5899, -5899, -5899, -971, 2216, -777, -1214, 1848, -4539, -5899, -542, -4387, -5048, -5899, -5707, -5894, -1900, -1132, -3061, -3922, -1912, 1866, -3146, -5899, -1970, 1946, 1156, -5899, -1893, -5899, 4352, -790, 2655, -791, 18579, -412, 9943, -1297, -5899, 1188, -4495, 5806, 6844, 67, -118, 13460, -676, 2572, 2952, -5899, -5899, -6, 8207, -635, -957, -5899, 5020, 16525, 15339, -3712, -5899 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 58, 59, 60, 61, 1113, 1118, 1922, 1941, 62, 63, 1645, 3077, 2930, 3897, 3898, 64, 65, 1641, 66, 67, 68, 69, 1555, 70, 1894, 3091, 71, 2763, 855, 856, 857, 2629, 2630, 3022, 2631, 2619, 1406, 1840, 1577, 829, 830, 1537, 1578, 73, 74, 1400, 2610, 75, 76, 77, 1608, 1701, 1609, 1610, 1549, 5036, 5871, 3683, 2885, 3945, 3684, 3685, 4368, 4369, 3763, 4397, 4459, 5885, 5886, 78, 1717, 1718, 79, 80, 3059, 3863, 4512, 5424, 5425, 5690, 670, 5059, 5060, 5677, 5678, 5900, 6075, 6076, 3092, 701, 3940, 4596, 3888, 5130, 3889, 5131, 3890, 5132, 4926, 4927, 4358, 4359, 3874, 4543, 4544, 2100, 5072, 4545, 3891, 5091, 5724, 3892, 2851, 2778, 2779, 5915, 3126, 2015, 2013, 5627, 5703, 4912, 4913, 4433, 5924, 5925, 5926, 6221, 5093, 5136, 5137, 6113, 6114, 3943, 4602, 5143, 5482, 5701, 3641, 82, 3916, 3917, 83, 764, 1916, 4054, 765, 3129, 702, 766, 3093, 88, 3119, 5917, 3120, 1671, 2944, 4525, 4030, 89, 1141, 4322, 5507, 5785, 5786, 755, 90, 1902, 91, 92, 3072, 3881, 93, 2796, 3589, 94, 95, 3608, 3609, 3610, 96, 4553, 5443, 1611, 3672, 3673, 3674, 3675, 4389, 97, 1897, 3100, 3101, 98, 99, 100, 3233, 3234, 101, 3008, 102, 103, 104, 105, 4427, 4993, 5107, 3714, 3904, 4569, 5105, 106, 3867, 3094, 3147, 3978, 3979, 5505, 5777, 5778, 5779, 5976, 6256, 5781, 5978, 6136, 5980, 5082, 6403, 6404, 5762, 4311, 4890, 108, 5083, 5084, 5930, 109, 2794, 110, 111, 1871, 3065, 3066, 4526, 3136, 3953, 3954, 4582, 4583, 112, 3803, 113, 4969, 4970, 703, 5938, 5877, 6061, 114, 115, 4973, 4974, 116, 117, 118, 119, 120, 756, 1075, 1076, 758, 1196, 1197, 3550, 1158, 121, 2639, 122, 3843, 123, 1278, 5207, 124, 791, 1214, 1215, 3095, 126, 801, 3252, 803, 3217, 3218, 2031, 4034, 4035, 4685, 127, 128, 4038, 4039, 4692, 3230, 129, 1542, 2773, 2774, 4882, 3096, 704, 3635, 5759, 5350, 5760, 6124, 6318, 5351, 3504, 4282, 131, 705, 1583, 2835, 1164, 1165, 3140, 3958, 2743, 2744, 1740, 4623, 2746, 3960, 2747, 1515, 2748, 1151, 1152, 3966, 3967, 3968, 3969, 4619, 4629, 4630, 5499, 5770, 4626, 1890, 5493, 5494, 132, 1580, 2832, 133, 134, 135, 1624, 999, 1174, 1175, 136, 717, 718, 137, 5695, 138, 1154, 139, 5503, 140, 141, 1263, 1264, 821, 142, 143, 2855, 4371, 144, 1581, 145, 146, 3708, 3709, 4985, 147, 148, 149, 2916, 2917, 150, 151, 152, 153, 154, 6246, 6321, 6322, 6323, 4637, 6130, 155, 1246, 156, 157, 158, 159, 197, 1040, 1041, 1042, 952, 3097, 5484, 161, 162, 1538, 1539, 1540, 1541, 2768, 163, 164, 165, 3988, 3989, 166, 167, 168, 169, 1874, 170, 171, 5668, 172, 173, 1844, 174, 175, 1049, 1050, 1051, 1052, 1842, 3448, 664, 874, 1431, 1437, 1480, 1481, 1482, 177, 768, 178, 1254, 1080, 769, 1205, 180, 770, 181, 2726, 4013, 4661, 4662, 4663, 4666, 5519, 4870, 771, 3530, 183, 2038, 3239, 3242, 3526, 772, 184, 4016, 4017, 4018, 4668, 773, 5614, 5615, 5616, 5617, 5852, 6189, 6190, 6193, 6294, 774, 793, 1144, 3151, 775, 1365, 189, 190, 191, 932, 877, 878, 3453, 5575, 5822, 776, 2603, 3431, 810, 1486, 920, 921, 922, 941, 3032, 2692, 2693, 2717, 2718, 1495, 1496, 2705, 2709, 2710, 3517, 3510, 2698, 4276, 5600, 5601, 5602, 5603, 5604, 5605, 4859, 2713, 2714, 1498, 1499, 1500, 2722, 194, 2682, 3483, 3484, 3485, 4252, 4253, 6179, 4267, 4263, 4844, 5303, 3486, 866, 1244, 1507, 4852, 6181, 3487, 5292, 5293, 5580, 4272, 3496, 4293, 3928, 3929, 3930, 3488, 5832, 5833, 6176, 6177, 5582, 5583, 3489, 5824, 6342, 6343, 6381, 6416, 2749, 1460, 905, 1366, 906, 1473, 1367, 1447, 908, 1368, 1369, 1370, 911, 1371, 1372, 1373, 914, 1439, 1374, 1375, 1456, 1469, 1470, 1376, 1432, 5584, 1378, 1379, 1380, 3491, 1381, 4788, 5264, 5250, 3353, 3354, 2626, 5565, 4784, 4165, 4778, 2596, 2600, 5315, 5607, 5608, 3424, 4214, 4815, 5281, 5818, 6012, 6013, 6160, 1382, 1383, 1384, 3416, 2590, 1002, 1385, 4528, 2592, 3344, 3322, 1743, 3323, 2041, 2063, 3271, 3287, 3288, 3392, 3324, 3332, 3337, 3345, 3378, 1386, 3273, 3274, 4076, 2065, 1387, 1046, 1746, 1047, 1475, 3373, 5230, 5530, 5531, 5803, 5804, 5541, 5805, 5542, 5532, 4087, 4088, 6001, 3298, 3393, 4091, 3306, 3307, 4109, 4098, 3299, 1388, 4100, 1396, 1397, 1390, 2032, 867, 5299, 1200, 1827, 807, 1391, 1392, 1393, 1394, 1617, 973, 1167, 1168, 923, 925, 926, 2686, 660, 652, 975, 3676, 2593, 661, 654, 655, 1832, 2594 }; /* 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[] = { 651, 1081, 193, 176, 72, 1083, 81, 931, 84, 1742, 1001, 85, 1000, 1107, 86, 1670, 87, 804, 107, 806, 1235, 1236, 1237, 812, 767, 125, 1241, 965, 1053, 823, 831, 835, 130, 838, 160, 1006, 831, 831, 1011, 868, 182, 871, 185, 1501, 179, 1956, 186, 1839, 927, 927, 927, 2012, 1389, 2879, 1401, 649, 942, 1241, 2957, 2850, 1487, 192, 1489, 1180, 1452, 1675, 1472, 1722, 1443, 1444, 2060, 3640, 1734, 3492, 1428, 3527, 1833, 1193, 1451, 3528, 833, 1147, 192, 2849, 869, 2052, 1899, 2836, 1828, 795, 953, 1427, 2862, 4056, 3114, 795, 3254, 3970, 1206, 1009, 4356, 3887, 4360, 4224, 1520, 4226, 1458, 187, 4291, 1415, 3309, 658, 2745, 1031, 4581, 865, 4434, 3245, 709, 3026, 3543, 3545, 4861, 4594, 3909, 2044, 1145, 1872, 1053, 2046, 1074, 1877, 2047, 2048, 1612, 4328, 1881, 2918, 2918, 3270, 802, 2918, 4607, 3800, 5296, 4266, 1891, 4384, 4249, 4386, 944, 3918, 2987, 2988, 834, 4632, 5121, 3362, 4914, 1634, 1911, 4530, 945, 4884, 1651, 1433, 3181, 3305, 3434, 2827, 4667, 936, 3436, 1207, 2678, 3293, 3297, 3300, 3301, 1190, 2745, 3310, 5540, 3312, 3313, 1053, 5129, 3133, 5139, 5150, 1584, 1945, 651, 956, 956, 4953, 2983, 956, 5632, 4295, 5235, 967, 5236, 868, 5486, 5184, 1003, 1178, 3768, 967, 1182, 233, 967, 1147, 5308, 868, 5310, 956, 5479, 5787, 868, 5090, 5707, 3015, 956, 1616, 868, 4280, 5447, 2827, 5624, 880, 854, 3519, 828, 4093, 3446, 4296, 1053, 4193, 3329, 862, 5746, 3522, 5352, 4591, 2827, 4196, 3846, 5789, 3849, 3850, 5475, 5952, 1494, 3854, 3855, 3856, 1408, 3858, 3859, 3860, -2568, 5138, 1497, -2610, -1977, 4264, 777, 4269, 4270, 2807, 4095, -1944, 2121, -150, 5478, -1985, -2636, 1427, 4106, -150, 5940, 3498, 5255, 1907, 5660, 5008, -2677, 4129, -1957, 668, 1938, 5349, 6150, 1841, 1024, 3877, 1036, 1884, 1053, -2489, 4617, 2637, -1982, -2002, 2643, 1938, 1864, 5670, 5671, 1551, 777, 3250, -2456, 1908, 715, 951, 1579, 3000, 3906, 715, -2421, -2456, -2456, 5704, -2457, 2841, -1972, 1669, 1216, 5100, 715, 1440, 1441, -2457, -2457, 1272, 1700, 2645, 872, 5876, -2572, 715, 1450, 1199, 3371, -2865, 1727, -2420, 715, 4058, 3111, 777, 2853, 4578, -2865, -2865, 715, 1579, 4074, 3583, -445, 946, 1579, 4329, 2981, -1916, 937, 4627, 777, 1220, 3603, 2601, 4106, 6153, 1938, 5997, 3371, 4095, 5696, 2994, -1985, 1996, 715, 6143, 2616, 3057, 1613, 715, 2918, 1613, 4324, 2921, 777, 1036, 2925, 777, 1134, 2853, 715, 3689, 1037, 2786, 4689, 4966, 2683, 5501, 4346, 5863, 5517, 3878, 5151, 1938, 777, 3075, 2780, 1147, 6145, 2699, 3123, -1777, 3369, 2784, 1273, 4697, 1552, 5101, 2845, 6260, 1405, 904, 1938, 5986, 5912, 2947, 938, 3419, 5810, 783, 3346, 5623, 783, 4971, 2781, 1886, 1734, 3124, 3080, 5659, 1938, 2689, 3827, 6421, 947, 783, 1833, 5440, 5840, 3469, 1938, 6119, 840, 784, 1239, 783, 784, 2700, 1038, 3246, 2822, 3604, 3737, 3616, 3564, 2121, 5637, 1551, 783, 784, 3501, 4048, 1001, 1443, 1444, 4862, 2121, -2633, 6411, 784, 6419, 5999, 6422, 5993, 1991, 3492, 5358, 6107, 1889, 1037, 1964, 195, 784, 2617, 2685, 1625, 948, 2643, 6134, 2966, -2247, 2997, 6285, 5954, 1828, 1451, 715, -2247, 5102, 783, 5209, 5210, 5211, 3762, 5213, 5214, 5215, 5216, 5217, 2889, 939, 1039, 1001, 5873, 2701, 777, 4967, 6286, 2853, 2967, 2645, 6449, 6135, 784, 5994, 3721, 196, 1938, 4096, 1458, 4129, 2645, 4690, 3737, 6463, 1240, 4107, 5747, 3112, 6000, 1954, 2121, 4863, 2033, 1101, 1038, 3565, 4049, 841, 2823, 1111, 3502, 3617, 3081, 4972, 2787, 6347, 1954, 5441, 2043, 2638, 1466, 1125, 1626, 2702, 1954, 2681, 3420, 2115, 2074, 2948, 5913, 1552, 2643, 5735, 2949, 2053, 3347, 1283, 2847, 4698, 4129, 1939, -1777, 893, -2992, -2992, -2992, 1869, 6292, 5987, 3370, 2853, 1833, 2853, 4518, 2782, 1939, 2606, 2863, 3076, 1994, 3413, 3879, -2266, 6238, 2645, 2853, 1039, 3414, 3690, -2266, 2853, 2853, 6334, 4129, 5518, 716, 4329, 2618, 6186, 6049, 1147, 5911, 4453, 3084, 4125, 1234, 4968, 2703, 4107, 6187, 3125, 2680, 2114, 4096, 2620, 3058, 1056, 3607, 5811, 2632, 2632, 3228, 868, 6090, 956, 4182, 956, 188, 5594, 956, 2788, 3228, 2725, 2960, 2728, 5502, 1003, 4325, 940, 3228, 4530, 1114, 2036, 956, 1939, 2057, 1553, 2602, 188, 956, 4628, 6380, 5330, 4691, 873, 5103, 1240, 3584, 2952, 3024, 3025, 2955, 1623, 3272, 4618, 5058, 949, 1082, 4988, 1084, 1240, 931, 1733, 651, 4579, 3880, 6118, 3001, 2848, 2982, 2880, 1939, 967, 2962, 930, 5522, 1003, 1275, 192, 967, 2659, 3372, 967, 4510, 4511, 6308, 3113, 1440, 1441, 1438, 1939, 6461, 6290, 2880, 2037, 1044, 6046, 3002, 956, 1045, 710, 6051, 6052, 6467, 1554, -2633, 1139, 5099, 1939, 1643, 1210, 5558, 3023, 4200, 3014, 1940, 5359, 2880, 1939, 669, 5104, 2897, 3266, 1147, 1085, 1450, 2785, 5368, 6307, 1870, 1947, 1147, 1147, 1644, 1453, 1454, 3493, 4097, 3463, 2589, 5146, 6072, -1977, -150, -150, 4108, 2731, -2568, 5147, 1442, -2610, 2814, 868, 1455, 4144, 831, 831, 831, 1502, 2995, 4920, 2821, 2723, -2636, 1265, 6359, 1446, 5947, 2614, 2941, 4995, 192, 2724, -2677, 789, 790, 4999, 3828, 3201, 2924, -1982, 2075, -2633, 5998, 1395, 1395, -2489, 868, 831, 3031, -2456, 6144, 831, 1213, -2633, 1218, 1044, 1222, -2421, 1951, 1045, 6240, -2457, 1226, -1972, 1939, 868, 3183, 2117, 943, 5950, 868, 1001, 6392, 1855, 789, 790, 1395, 3492, 2604, 2812, 3492, 6230, -2865, 6146, -2420, 3439, -2572, 1243, 2975, 2976, 1851, 789, 790, 6408, 1856, 1962, 1857, 944, 1453, 1454, -2247, 3211, 1229, 2661, 2662, 4135, 4530, 2942, 4266, 945, 2945, 2946, 3612, 3226, 1984, 1614, 1615, 1457, 1614, 1615, 3067, 3228, 2684, 1395, 5995, 4298, 6259, 4299, 3492, 4841, 1044, 3492, 1987, 4845, 1045, 789, 790, 868, 4183, 6195, 2831, 2896, 1954, 193, 176, 72, 1243, 81, 2998, 84, 868, 4572, 85, 6291, 4669, 86, 1846, 87, 5996, 107, 5859, 6206, 4579, 2905, 2864, 868, 125, 1417, 2881, 1536, 4737, 4738, 1870, 130, 4591, 160, 5698, 4742, 2865, 1870, 2866, 182, 5062, 185, 868, 179, 3697, 186, 4491, 956, 956, 2881, 6188, 2831, 2584, 2585, 2586, 2587, 2588, 2589, 3398, 4900, 192, 6349, 6310, 4874, 4454, 4958, 4448, 4449, 2831, 1543, 3415, 4450, -2266, 2881, 6117, 6091, 828, 1249, 1251, 831, 831, 6414, 1954, 4184, 1506, 2806, 2037, 4684, 4831, 2656, 4833, 4834, 4687, 6111, 5527, 5734, 4723, 3679, 3519, 1558, 4684, 1404, 1395, 1395, 2867, 1412, 187, 4285, 5061, 4231, 3304, 5331, 1888, 4800, 963, 6217, 651, 3235, 956, 946, 5401, 1434, 967, 4505, 711, 1003, 967, 1097, 967, 4141, 4142, 4143, 4144, 956, 946, 6099, 4546, 2765, 1161, 6358, 2586, 2587, 2588, 2589, 5402, 1938, 3085, -2417, 6313, 6314, 1231, 6110, 5088, 2954, 2685, 3680, 6298, 868, 4044, 1731, 3045, 4560, 715, 5080, 956, 956, 2880, 6292, 6266, 3524, 1159, -1778, 4185, 5252, 1079, -2992, -2992, -2992, 4139, 4140, 4141, 4142, 4143, 4144, 1544, 712, 868, 868, 868, 715, 956, 6439, 651, 715, 651, 651, 1159, 5797, 1509, 5740, 2984, 2882, 3399, 2712, 2775, 3127, 4570, 3400, 3603, 1833, 1211, 4986, 4139, 4140, 4141, 4142, 4143, 4144, 5849, 2880, 1484, 4914, 5115, 6293, 2882, 1211, 4046, 713, 956, 714, 956, 956, 2883, 662, 3634, 5170, 1711, 3280, 5643, 3212, 715, 6239, 1712, 3712, 6425, 2608, 1020, 3865, 2882, 3236, 3368, 1635, 3451, 6022, 6231, 2883, 6415, 2884, 3401, 650, 6268, 6248, 948, 1395, 2870, 1053, 1203, 2775, 665, 4531, 3681, 868, 6394, 1706, 3974, 3493, -1944, 1021, 3452, 2883, 2884, 5126, 3525, 828, 1249, 663, 3229, 2776, 2880, 1524, 5253, 2014, 2880, 2014, 1889, 1418, -1094, 868, 2878, 804, 2871, 3223, 3224, 984, 2884, 3547, 939, 3604, 5127, 1248, 985, 986, 987, 5920, 4527, 2880, 1707, 4534, 5902, 2609, 5904, 2878, 1133, 3713, 5908, 5909, 1485, 2880, 2050, 1247, 868, -706, 5081, 1954, 2056, 5783, 192, 2880, 1232, 1903, 6218, 1987, 3162, 6269, 1276, 2878, 1732, 1506, 1395, 3281, 6021, 1713, 5815, -1778, 4561, 1283, 3174, 5089, 4129, -1944, 6315, 5936, 4130, 4131, 4132, 3975, 1636, 5933, 1545, 3180, 5944, 1044, 1419, 3613, 5699, 1045, 6248, 1525, 4536, 931, 5471, 5465, 1904, 1998, 1269, 2000, 1134, 2002, 5019, 2004, 1395, 2006, 2007, 2008, 1973, 5477, 5946, 5949, 2010, 5540, 2115, 3632, 5961, 188, 4624, 2881, 5521, 3542, 4045, 5326, 5496, 1546, 3205, 3402, 3267, 1930, 3269, 3907, 1510, 1395, 1395, 1395, 3276, 1395, 2777, 6219, 5988, 3282, 3290, 3291, 6357, 1526, 1889, 5343, 5403, 964, 4086, 1974, 3158, 1081, 3314, 6364, 5932, 1083, 1395, 6270, 1547, 3475, 1098, 3682, 3334, 954, 5540, 3842, 6220, 1939, 3349, 3698, 2881, 1162, 966, 5798, 4915, 5921, 1212, 4113, 2880, 4547, 966, 3192, 3179, 966, 5948, 1135, 3068, 3866, 4047, 3837, 3237, 1212, 4438, 6393, 3729, 868, 5206, 3160, 3320, 2777, 3123, 5432, 1001, 2641, 2827, 939, 4539, 3607, 188, 930, 6248, 3238, 3173, 1395, 4412, 3175, 6155, 3283, 1850, 5126, 3284, 2690, 2691, 1708, 2695, 5128, 6423, 3124, 1692, 1859, 5816, 1548, 6171, 945, 945, 5784, 945, 3213, 3548, 2881, 3466, 3549, 3030, 2881, 3016, 1867, 5127, 1714, 1691, 4126, 4127, 5855, 6276, 4540, 4146, 5922, 4229, 1527, 6440, 1395, 6128, 5817, 1637, 1395, 1395, -1944, 2881, 3214, 4362, 6303, 4541, 3220, 3221, 5297, 868, 868, 868, 2730, 2881, 1395, 6101, 4134, 3730, 5073, 4633, 2957, 5300, 5749, 2881, 1905, 1715, 5304, 2882, 3206, 5306, 4177, 4178, 3614, 5020, 2903, 3265, 1834, 5750, 831, 1835, 1638, 5753, 2974, 4394, 3003, 1462, 3, 4, 6271, 5754, 4278, 3976, 6058, 3467, 1258, 4395, 4010, 2764, 2883, 6133, 1716, 4683, 3207, 3936, 4413, 3144, 3977, 2099, 818, 5327, 5466, 1709, 3731, 2818, 3285, 1639, 3208, 5444, 831, 1975, 2882, 956, 3435, 2884, 6172, 1506, 3185, 1506, 3145, 1136, 1490, 5160, 5074, 4670, 868, 2852, 2790, 3493, 6236, 6237, 3493, 3699, 4135, 868, 4286, 4446, 956, 2791, 4684, 4542, 4634, 2883, 761, 943, 3209, 188, 3784, 3210, 4363, 4864, 6156, 3215, 3785, 1463, 2878, 5563, 3222, 1137, 4456, 3225, 6059, 5533, 15, 1003, 3732, 868, 2884, 1906, 831, 3918, 4493, 2920, 2920, 5328, 2040, 2920, 1259, 1833, 3493, 2882, 4902, 3493, 2881, 2882, 5534, 831, 3959, 1536, 868, 3492, 5535, 868, 1536, 3492, 3830, 5739, 4869, 5459, 5872, 20, 1533, 5075, 4530, 1534, 5536, 1466, 2882, 2878, 1492, 2904, 2883, 6304, 6129, 956, 2883, 5748, 6105, 6229, 2882, 3004, 3286, 1138, 1976, 1139, 805, 5360, 6165, 1140, 2882, 1036, 868, 1464, 6337, 5366, 1465, 2884, 666, 2883, 5564, 2884, -1944, 6338, 956, 956, 956, 956, 868, 6048, -1944, 2883, 1442, -1944, 1471, 5052, -1944, 1870, 3603, 4256, 5056, 2883, 868, 3786, 2884, 5755, 1828, 1536, 3303, 3303, 5751, 1536, 3639, 1395, 1395, 1395, 2884, 2745, 2878, 5120, 4414, 2745, 2878, 3330, 3089, 3492, 2884, 3146, 6173, 3733, 4011, 809, 3351, 6174, 990, 991, 992, 993, 994, 995, 996, 997, 998, 1001, 1001, 2878, 3171, 3562, 2978, 5079, 5613, 4960, 3639, 2769, 4527, 3161, 6125, 2878, 4287, 2792, 1921, 4635, 1601, 4415, 2696, 2770, 6360, 2878, 6175, 2699, 5714, 6191, 3790, 4865, 41, 1037, 1954, 4257, 1209, 6306, 5537, 41, 4984, 2771, 195, 783, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 1466, 1418, 3604, 4416, 2882, 5117, 1260, 2793, 41, 3203, 819, 6244, 29, 3090, 784, 3203, 4258, 868, 45, 4352, 3791, 3154, 2700, 5076, 3203, 45, 4364, 4365, 868, 5715, 1462, 4259, 5716, 6378, 196, 2883, 956, 956, 3605, 5717, 1257, 4636, 4753, 1564, 4754, 4460, 1038, 45, 662, 1261, 5819, 1262, 956, 33, 4260, 3792, 6192, 4366, 1490, 3814, 2884, 3231, 49, 6356, 1491, 1712, 3734, 5718, 188, 49, 868, 2920, 5294, 820, 3735, 50, 2781, 3736, 1419, 1001, 6199, 3606, 50, 4261, 2697, 41, 956, 956, 956, 956, 1269, 49, 3787, 1429, 1452, 868, 836, 3794, 954, 51, 935, 2878, 868, 6431, 50, 3134, 51, 966, 1463, 1039, 3686, 5939, 4871, 41, 966, 4930, 1467, 966, 57, 3523, 651, 5820, 3798, 651, 45, 57, 3657, 5719, 51, 3748, 5953, 5960, 3795, 967, 967, 3788, 3710, 3454, 4341, 2702, 5720, 1468, 5538, 2062, 1003, 1003, 1492, 4012, 967, 4257, 4931, 967, 45, 5721, 5539, 1479, 4451, 1601, 4365, 3492, 3492, 5590, 3232, 2071, 2772, 1414, 956, 956, 49, 1672, 3789, 1656, 762, 956, 3815, 868, 4527, 5448, 868, 1126, 4876, 50, 4262, 4258, 3796, 3659, 1464, 1870, 4944, 1465, 3607, 2901, 3658, 1657, 2014, 4457, 49, 1493, 4847, 4755, 3563, 956, 195, 967, 2703, 51, 3219, 967, 967, 50, 868, 868, 1673, 956, 1931, 3296, 1127, 4342, 6437, 3797, 868, 4260, 2112, 5782, 763, 839, 5449, 868, 1932, 3992, 868, 3134, 5525, 51, 804, 4452, 3710, 804, 3256, 6317, 6451, 4956, 1395, 192, 1395, 1658, 4458, 196, 4932, 1395, 1395, 3660, 6245, 1524, 1128, 863, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1490, 4688, 1082, 1395, 1084, 1395, 1003, 1395, 1395, 1395, 1395, 1395, 1395, 1640, 3251, 1395, 1933, 1395, 1395, 4700, 3195, 1395, 3196, 192, 3197, -1748, 3198, 3240, 3199, 1681, 761, -1748, 3200, 3875, 5446, 1129, 1395, 1395, 1395, 1466, 4659, 1511, 2890, 3831, 3832, 3833, 875, 41, 777, 4340, 15, 4957, 6108, 1147, 1395, 1529, 2957, 2745, 4736, 1674, 3722, 6109, 3723, 3724, 5457, 4173, 3799, 2745, 1659, 1085, 4712, 6127, 1525, 5470, 3629, 943, 943, 681, 943, 4660, 4262, 3918, 3626, 5618, 1512, 5620, 45, 20, 1492, 5771, 1521, 3255, 6396, 36, 956, 1682, 5722, 3019, 2947, 5723, 5974, 4724, 3793, 1448, 1449, 5642, 4728, 3749, 5931, 4655, 3020, 3986, 934, -1748, 4877, 3752, -1701, 4727, 3755, 1513, 1934, 4878, 4732, 4733, 2927, 4886, 1526, 4886, 4879, -1701, 49, 1660, 3837, 1522, 933, -1701, 1661, 1683, 4500, 1493, 3021, 5965, 2745, 2918, 1684, -173, 3040, 3492, 1685, 5674, 5975, 683, 2956, 5669, 3492, 1467, 950, 3051, 2870, 3492, -1119, -621, 3492, 1126, -1748, 954, 4880, 951, 1523, 1453, 1454, 966, 1410, 3069, 3747, 966, 6126, 966, 5419, -2440, 5420, 5421, 5422, -173, -1701, 959, 57, 1663, 1455, 4881, 4455, 681, 4040, 1935, 2871, 2612, 4749, 4750, 4751, 4752, 1127, 1395, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 3774, 4887, -173, 4887, 2858, -1701, 2859, 3922, 3923, 3924, 3925, 5428, 3927, 6232, 2928, 3143, 4828, 3495, 1643, 2931, 5982, 5436, 5943, 5438, 1665, 4492, 4573, 2853, 1527, 1923, 3155, 1925, 1926, 1159, 3159, 3821, 5038, 3955, 681, 2854, 961, 2948, 1644, 1395, 234, 5429, 2949, 1702, 1666, 4830, 667, 3511, 1678, 683, 4804, 4805, -1701, 3729, 759, 5039, 3948, 4256, -1092, 5666, 3178, 1159, -1701, 4669, 5910, 1668, 3493, 4256, 2860, 2121, 3493, 983, 1129, 837, 813, 4888, 3893, 4888, 33, 4889, 1936, 4889, 1656, 5667, 1516, 6460, 1703, 1643, 3006, 1528, 1704, 1679, 3012, 982, 2624, 1395, 4603, 4163, 1529, 4915, 1035, 2643, 6469, 4170, 1657, 814, 1987, 1653, 683, 815, 41, 1644, 1686, 6339, 4409, 3017, 1643, 5905, 694, 5070, 695, 1705, 5906, 1517, 5666, 41, 1680, 1518, 1530, 6309, 3910, 6432, 1531, 1026, 2645, 4257, 36, 2625, 6340, 6319, 1644, 3730, 1909, 6197, 1981, 4257, 5071, 699, 5667, 45, 1654, 1687, -471, 1656, 5021, 1688, 1658, 4410, 3018, -150, 3493, 5847, 1519, 4029, 45, 685, 1910, 1532, 1982, 4258, 4155, 1987, 4157, 4158, 6433, 1657, 5666, 5907, 5022, 4258, 1217, 1219, 1221, 6214, 4259, 1223, 1224, 1225, 5848, 5775, 1689, 3086, 4411, 49, 4259, 1230, 3731, 1690, 2853, 2911, 5667, 4925, 1533, 1043, 3363, 1534, 50, 4260, 49, 3492, 2861, 3116, -1701, 5776, 6201, 6202, 2935, 4260, 1646, 6450, 4283, 50, 2115, 1453, 1454, 4937, 777, 1658, 4935, 1442, 51, 1471, 694, 6462, 695, 2786, 4261, 1719, 4225, 4070, 1723, 4915, 1457, 1089, 2654, 51, 4261, 4302, 1659, 57, -1701, 3894, 1442, 6151, 2679, 1099, 1535, 1100, 3732, 6152, 3765, 1885, 3766, -1701, 57, 6435, 3770, 5875, 6438, -1701, 4915, 4873, 5879, 5880, 4936, 5301, 1442, -471, 2679, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 792, 1395, 4071, 694, 6424, 695, 792, 4072, 4937, 3028, 3029, 868, 1395, -2413, 1395, 1001, -1119, 3596, 1044, 1087, 1234, 868, 1045, 1660, -1700, 3468, 3470, 3471, 1661, 698, -1701, 1659, 1885, 1094, 4128, 4640, 3593, -1700, 3597, 3598, 4641, 5676, 5294, -1700, 2956, 1108, 4156, 4262, 5154, 1633, 868, -620, 1395, 4641, 1650, 956, 1395, 4262, 1122, 1395, 3447, 1395, 4461, -1701, 1395, 3, 4, 1044, 1395, -2421, 6140, 1045, 6296, 1044, 1103, 4330, 1104, 1045, 188, 1663, 4236, 4237, 4180, 1130, 3383, 3384, 3385, 3386, 2061, 1131, 57, 3494, -1700, 3733, 1660, 1132, 5069, 868, 868, 1661, 2632, 3493, 3493, 1993, 4297, 3590, 1835, 1153, 1395, 2045, 4370, 4227, 1835, 3492, -1701, 2956, 1149, 1395, 1395, 4938, 2640, 3520, 3521, 1835, -1701, -1700, 4211, 188, 1665, 2653, 1160, 868, 2654, 4273, 2687, 3625, 5966, 1835, 1169, 3533, 4198, 3895, 3189, 1176, 5198, 2654, 3490, 2680, -1772, -1772, 1663, 5302, 1666, 3202, 3355, 3492, 3203, 3358, 937, 3204, 5205, 3295, 3203, 1442, 4527, 2679, 5514, 1187, 4589, 1833, 4943, -1749, 6352, 1668, -2414, 3243, -1700, -1749, 3244, 1044, 804, 1234, 804, 1045, 3450, 3348, -1700, 1987, 3455, 5122, 3149, 2654, 3150, 3896, 3534, 1283, 1395, 2654, 4129, 1665, -1776, -1776, 4130, 4131, 4132, 3623, 3704, 651, 3624, 3705, 967, 1003, 967, 967, 1170, 3871, 956, 4028, 3872, 868, 4793, 4672, 1147, 1666, 1194, 3734, 938, 3728, 4933, 3566, 4940, 3569, 4020, 3735, 5228, 3203, 3736, 1453, 1454, 41, 831, 5233, 5234, 1204, 1668, 4901, 4939, 662, 4069, 4357, 4078, 2654, 2852, 2654, 4084, 4085, 777, 2654, 2654, -1749, 1283, 4918, 4089, 4129, 4090, 3645, 868, 4130, 4131, 4132, 4104, 1233, 3656, 3830, -1701, 5635, 5636, 4115, 45, 5861, 2654, 868, 1238, 4148, 5763, 4699, 2654, 5866, 5867, 4162, 4167, 1234, 2654, 4168, 1242, 3611, -1701, 3492, 4576, 6194, 4216, 1245, 4217, 868, 4303, 4304, -1775, -1775, 3818, -1701, -1749, 4600, 1253, 4601, 2745, -1701, 4959, 4218, 4234, 4219, 939, 2654, 49, 1255, 868, 1997, 3492, 4548, 1999, 1256, 2001, 3067, 2003, 1266, 2005, 50, -1700, 831, 2009, 6014, 6015, 4333, 1044, 1267, 4387, 6330, 1045, 4388, 4392, 1270, 4420, 4393, 3379, 4421, 3380, 6161, 6162, 4429, 3493, 51, 956, 2878, 4435, 956, -1701, 3493, 4186, 1268, 4187, 1147, 3493, 4489, 4612, 3493, 4421, 4613, 1269, 3377, 57, 1948, 3381, 5846, 5063, 1271, 5064, 1952, 3492, 3330, 3330, 868, 868, 29, 3330, 4615, 4188, 1963, 4616, -1701, 4646, 1966, 3719, 4647, 1279, 1969, 3801, 1971, 3804, 3806, 1277, 4134, 4774, 1979, 1413, 4775, 4317, 6115, 4785, 1985, 4796, 4786, 1988, 2654, 4872, 928, 929, 3549, 4404, 4915, 5123, 5180, 1420, 3203, 5181, 3330, 3330, 5243, 1416, 5244, 1395, 1395, 1395, 1421, 1422, 5185, 1395, 3382, 5186, 1426, -1701, 6397, 3764, 4133, 956, 4425, 5200, 1430, 1435, 2037, -1701, 3382, 5240, 1438, 1436, 2654, 5140, 956, 5277, 1442, 1445, 2654, 940, 1395, 1446, 956, 4134, 4441, 5322, 5346, 4519, 3549, 5347, 5133, 5353, 1459, 5354, 3203, 2852, 3203, 1461, 1488, 5355, 868, 41, 3203, 1476, 4135, 4062, 3908, 4064, 4065, 804, 3383, 3384, 3385, 3386, 1477, 1503, 5472, 3387, 3388, 5473, 1504, 956, 3919, 3389, 3383, 3384, 3385, 3386, 5680, 1505, 5509, 4189, 3801, 4647, 6453, 5555, 5557, 4190, 5556, 2654, 45, 5801, 956, 5802, 3941, 5577, 3959, 1508, 5578, 4566, 954, 5587, 3492, 954, 1987, 5470, 5593, 5595, 5709, 4586, 4586, 5710, 5729, 966, 966, 3203, 1471, 5764, 5829, 4135, 5765, 5830, 1587, 5835, 4059, 5681, 1987, 3490, 966, 5838, 4306, 966, 4586, 956, 49, 956, 5894, 956, 5935, 5895, 5962, 2611, 1514, 5963, 4917, 4915, 4919, 50, 5985, 4922, 5682, 5963, 6005, 3592, 6006, 4168, 1556, 2654, 6026, 3600, 1582, 6027, 6030, 4019, 6366, 1987, 6367, -1701, 1001, 5683, -2458, 51, 2014, 6038, 5684, 6031, 6057, 2685, 2654, 3244, 1585, 1627, 6063, 966, 4780, 3244, 1588, 966, 966, 2745, 57, -1432, 4559, -1432, 4562, 3493, 5685, 1628, 6064, 6067, 5686, 3244, 2654, 1623, 3937, 6068, 3642, 6069, 2654, 6097, 6070, 6167, 6098, 6182, 4586, 5687, 2654, 1476, 1147, -1689, 1147, 6184, 4693, 1629, 2654, 6196, 651, 956, 3203, 967, 3390, 967, 967, 1734, 956, 1044, 1640, 6210, 1476, 1045, 6211, 1395, 3391, 1642, 4191, 6234, 1395, 6284, 6235, 6316, 5843, 6362, 5963, 931, 6363, 1652, 4192, 6382, 6115, 6390, 6383, 1655, 5181, 4549, 4915, 4551, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4014, 4279, 1833, 1677, 1693, 6391, 4706, 6418, 2654, 6420, 6027, 6428, 2654, 1694, 6429, 6466, 3377, 4824, 6383, 4826, 1395, 1395, 1395, 5545, 5546, 1395, 931, 1147, 6468, 1710, 1720, 6429, 4943, 1395, 1395, 1395, 1395, 6470, 1721, 5286, 6383, 5288, 4846, 3492, 4849, 1724, 5688, 6242, 1729, 1395, 3482, 5572, 1395, 5573, 1395, 3492, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 1730, 1395, 1395, 1843, 1845, 1395, 1847, 4621, 1852, 1858, 1863, 1866, 4531, 1868, 1873, 1876, 1878, 4701, 4532, 1870, 1887, 1892, 1893, 5549, 1003, -137, 1395, 1895, 1395, 1896, 1395, 1898, 4533, 1900, 1901, 4934, 5689, 1912, 1919, 5344, 1921, 1924, 1928, 1937, 214, 1942, 4915, 3493, 1943, 1395, 4746, 1944, 4215, 1946, 1949, 2120, 868, 1950, 2121, 1953, 4534, 1589, 4535, 1954, 1961, -2991, 931, 1590, 1965, 1967, 1968, 3686, 1970, 4954, 1972, 1977, 3869, 868, 1978, 1980, 1983, 1986, 1695, 1989, 4773, 5182, 1990, 1992, 1995, 3493, 2643, 2120, 2011, 5167, 2121, 2042, 2049, -2992, 2051, 3710, 2054, 4221, 4222, 4223, 2058, 2059, 4897, 651, 3371, -1948, 3494, 4254, 1592, 2680, -1955, 4254, 4268, 4254, 4254, 2066, 2067, 4536, 2068, 2645, 1395, 2069, 2643, -2755, 2070, 1395, 57, 2072, 2073, -2992, 2074, 4812, -1945, -1946, 2076, 2077, -1949, -1947, 2078, 4580, 1395, 2079, 2080, 2081, 2082, 3492, 4537, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 3494, 2645, 4294, 3494, 3490, 2091, -2991, 3490, 2092, 1696, 2093, 1593, 2094, 2095, 2096, 2097, 5044, 2098, 1594, 2101, 2099, 2102, 1595, 2103, 5057, 2595, 2104, 2105, 2106, 2597, 2107, 2108, 2599, 2601, 2615, 2627, 2635, 4179, 2602, 2611, 2657, 1395, 1081, 2658, 2663, 5793, 1083, 2665, 2666, 2669, 1596, 2670, 2672, 2681, 2673, 3490, 2674, 2675, 3490, -2991, 2676, 6395, 2688, 1491, 1493, 956, 956, 2719, -2755, 2721, 2735, 2732, -2991, 3493, 4538, 2733, 5049, 2734, -2991, 4539, 2752, 2751, 2753, -2992, -2991, 2754, 1597, 2679, -2992, 2755, -2991, 2756, 4678, -2991, 2757, 2758, 2759, -2991, 813, 2760, 4051, 1395, 3493, 2761, 3492, 2783, 2767, 2789, 2795, 2809, 3492, 2813, 2815, 2816, 2817, 4061, 2819, 2820, 2833, -2992, 4066, -2755, 2837, 2838, -2992, 2839, 4540, -2991, 2856, -2991, 2857, 2868, 2872, 2874, -2755, 2877, 2875, 2876, 2878, -2992, -2755, 2886, 4983, 4541, 2888, 2891, -2755, 2892, 4279, 2887, 4092, 2893, -2755, 2902, 2898, -2755, 2899, 2908, 4398, -2755, -2991, 2909, 3493, 2912, 2922, 2926, 1697, 2936, 2943, 2923, 1599, 2929, 2932, 5807, 2950, -2992, 2933, 2953, 2685, 2938, 1600, 2939, 868, 1601, 2951, 2968, 2958, 2959, 2964, -2755, 1601, 2970, 2920, 2977, 2972, 2965, 2979, 2650, 2971, 2973, 2996, 2980, 1602, 3034, 5828, 2985, 3005, 4040, 2986, 2999, 3039, -2991, 3027, 3041, 3042, -2991, 3043, 3010, 3055, 3044, 3056, -2991, -2755, 3048, 3049, 3050, 3061, 3062, 3052, 3053, 3303, 3060, 3492, 2650, 5492, 3054, 3063, 3070, 3165, 3071, 3074, 676, 3087, 3098, 3079, 1698, 3172, 4542, 1604, 1605, 3102, 3103, 3330, 3330, 3330, 3330, 3106, 3115, 3330, 3330, 3330, 3330, 3330, 3330, 3330, 3330, 3330, 3330, 188, 1674, 3118, 3121, 3122, -2755, 3131, 3142, 3148, -2755, 3167, 3135, 1699, 3152, -2991, -2755, 3139, 3164, 4777, 3166, 3168, 3169, 3182, 3194, 3216, 3227, -2992, 3253, 3272, 3350, 3356, 2121, 3397, 1395, 3241, 3417, 3423, 3438, 3443, 1395, 3444, 3157, 3277, 3458, 3317, 3376, 3395, 3459, 3360, 3422, 956, 3493, 3457, 1466, 3330, 3330, 3442, 3441, 3456, 3460, 3473, 3461, -2992, 3465, 3474, 3495, 3513, 3512, 938, 3372, 3514, 188, 3500, 3529, 3531, 3515, -2755, 3532, 650, 3538, 3539, 3541, 3567, 3558, 3572, 1607, 3575, 868, 868, 868, 3570, 3580, 3585, 5095, 5096, 3586, 3588, 3591, 3599, 3615, 3620, 4837, 1410, -2991, 868, 1414, 3622, 3630, 3636, 3638, 3648, 3637, 3661, 3687, 3667, 3666, 3693, 3694, 1395, 3700, 3695, 3703, 3721, 3711, 3718, 3720, 5453, -2991, 3741, -2991, -2991, 5195, -2992, 3742, 1889, 809, 2014, 868, 868, 3802, 3829, 3817, 868, 3758, 2584, 2585, 2586, 2587, 2588, 2589, 3825, -2991, 5133, 3826, 868, 3838, 939, 3845, 3851, 3852, 3853, 3857, 3862, 5265, 3873, -2755, 3884, 3899, -2992, 3885, 3901, 931, 3903, 3913, -2991, 3905, -2991, -2991, 3920, 4318, 2584, 2585, 2586, 2587, 2588, 2589, 3926, 4321, 5312, -2755, 3931, -2755, -2755, 3933, 954, 3932, 3934, 966, 3935, 966, 966, 3939, 3946, 3944, 3947, 3950, 2112, 1656, 3951, 3956, 956, 3971, 3981, -2755, 3972, 4664, 3942, 3973, 4019, 3982, 3983, 3985, 3987, 4001, 4004, 4007, 4022, 4003, 4009, 1657, 4610, 4023, 4024, -2755, 3219, 4681, -2755, -2755, -2755, 4037, 1987, 4025, 4041, 4026, 4027, 868, 4043, 4050, 4053, 4055, 4042, 1984, 1951, 4031, 2112, 4032, 4063, 4083, 868, 4099, 4080, 4103, 3294, 4606, 4161, 4164, -2239, 3493, 4086, 4181, 4195, 4205, 4232, 4246, 5251, 4275, 4288, 1395, 3377, 3493, 4081, 1658, 4300, 4810, 1240, 4082, 1395, 4176, 5319, 4101, 5864, 4417, 4212, 4419, 4207, 4094, 4111, 4114, 4105, 4643, 1395, 4238, 3830, 5426, 1395, 1395, 1395, 4116, 4117, 4121, 4123, 1395, 4124, 4125, 1395, 4147, 2654, 1395, 4290, 4281, 4255, 1243, 4206, 1395, 4208, 1395, 4292, 4210, 1395, 4312, 4305, 4152, 4153, 1395, 1395, 1395, 1395, 4307, 4160, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 4314, 4337, 4308, 1395, 1395, 1395, 4233, 4242, 4175, 4240, 4248, 4271, 4326, 1395, 4239, 4338, 931, 2075, 1395, 4241, 4327, 4247, 1395, 4339, 1659, 4345, 4343, 4351, 4354, 4357, 1395, 4361, 4372, 1395, 4373, 1395, 4349, 5364, 4375, 3330, 4480, 4350, 4355, 4381, 2120, 4383, 4382, 2121, 4391, 5316, 4399, 1395, 4279, 4408, 1395, 1395, 4422, 4424, 3482, 1395, 1395, 3482, 4426, 4428, 1395, 4432, 1395, 4816, 4430, 4436, 4437, 2685, 4440, 4442, 4443, 868, 868, 868, 4447, 2643, 4279, 4444, 4445, 4462, 4502, 4469, -2992, 1660, 4463, 3493, 5341, 4464, 1661, 4465, 4478, 1395, 4254, 4268, 4254, 4254, 4466, 1395, 4254, 4467, 4472, 4839, 4474, 2120, 2956, 3494, 2121, 4468, 2645, 3494, 4817, 4818, 4819, 4820, 4476, 4854, 4485, 5190, 5191, 5192, 5193, 5194, 4483, 4470, 4481, 2994, 4471, 4473, 4475, 1082, 2997, 1084, 4497, 4498, 4499, 4504, 4509, 4501, 2643, 1663, 4477, 4487, 1395, 4515, 4517, -2992, 4488, 650, 4552, 4494, 192, 4567, 4557, 4558, 4568, 4564, 5437, 4571, 4575, 1283, 3490, 4586, 4129, 4585, 3490, 4588, 4130, 4131, 4132, 4595, 4604, 2645, 4605, 6277, 6278, 4598, 3642, 6280, 4608, 4609, 4197, 4611, 4625, 4639, 4794, 4642, 4657, 4649, 1665, 5397, 4651, 4665, 4645, 4673, 4671, 4658, 1085, 4674, 3493, 4916, 2014, 2852, 2014, 4675, 3493, 2014, 4676, 4924, 4694, 4677, 4695, 4696, 1666, 4702, 4703, 4704, 4705, 4707, 4715, 5492, 4644, 4708, 4679, 4709, 4710, 4948, -2992, 4711, 4720, 4719, 4721, -2992, 4725, 1668, 4726, 2061, 5571, 4729, 4734, 1589, 4722, 4735, 4740, 4803, 4129, 1590, 4747, -2238, 4799, 4798, 1283, 4787, 4829, 4129, 3490, 4842, 4770, 4130, 4131, 4132, 4813, 4771, 4843, 4772, 4835, 4279, 4850, 4779, 4802, 4825, 5610, 4851, 4857, 4827, 4840, 5270, 4856, 4838, 4855, 5256, 4997, 4858, -2992, 4860, 4866, 4875, 5455, 4883, 4869, -2992, 1592, 4893, 4896, 4894, -2992, 4895, 4903, 4906, 4904, 4907, 3445, 954, 4910, 3634, 966, 4925, 966, 966, 4928, 4929, 4946, 4949, 4716, 4962, 4961, 4963, 4964, 4965, 4975, 4976, 4977, 4978, 5679, 4979, 4980, 4989, 3493, 4991, 4992, 4998, 5009, 2957, 5010, 5015, 5018, 5041, 5035, 5037, 4935, 5034, 2650, 5040, 5050, 5051, 5053, -2992, 5054, 1593, 5055, 5066, 5077, 5092, 5106, 5112, 1594, 5113, 5087, 5125, 1595, 5000, 5118, 5135, 5141, 5152, 4748, 5161, 5142, 5163, 956, 5165, 3764, 5177, 5119, 4134, 5179, 5098, 5159, 5158, 5166, 5183, 5171, 5162, 956, 5196, 1395, 3228, 1596, 5202, 5203, 4769, 5212, 868, 5219, 5220, 5224, 5221, 5222, 5085, 5223, 5225, 5888, 5231, 5890, 2650, 5232, 5242, 5254, 2120, 2852, 5226, 2121, 5237, 5257, 5248, -2992, -2992, -2992, 5259, 5258, -2240, 5276, 5280, 1597, 868, 5295, 5263, 5290, 5298, 3494, 3919, 5291, 5305, 5309, 5314, 5321, 5318, 3801, -2992, 5325, 5317, 5329, 5348, 2643, 5349, 5361, 5134, 5362, 5363, 5365, 2644, 5373, 5323, 5386, 5367, 5374, 868, 5372, 5389, 5395, 4135, 5393, 5399, 5404, 5405, 4134, 5407, 5400, 1395, 1395, 5408, 5409, 5416, 188, 5417, 5418, 2645, 5423, 5427, 1395, 1283, 5430, 5434, 4129, 3490, 3490, 5435, 4130, 4131, 4132, 2014, 868, 5442, 5445, 5451, 5450, 5452, 6019, 5454, 5458, 5460, -2992, 5469, 1697, 5474, 5271, 5464, 1599, 868, 188, 5476, 5480, 5481, 5483, 5485, 1001, 5726, 1600, 5487, 5488, 4019, 5489, 1395, 650, 5498, 5504, 650, 1601, 5506, 5523, 5520, 5899, 5524, 5550, 5630, 5561, 6045, 3203, 930, 1602, 5560, 5570, 5529, 5543, -2992, 5544, 5562, 5579, 5585, 5622, 5574, 4135, 5611, 5554, 5644, 5589, 2584, 2585, 2586, 2587, 2588, 2589, 5592, 5619, 1395, 5626, 5638, 5634, 5144, 5621, 5649, 5639, 5640, 5641, 650, 5646, 5652, 650, 5653, 5657, 1395, 5663, 6081, 6083, 5672, 1604, 1605, 5664, 5665, 5694, 5076, 5713, 5702, 5732, 2646, 5705, 5700, 5712, 1395, 2647, 5708, 5733, 5737, 5742, 5744, 5761, 5774, -2992, 5772, 5766, 5773, 5780, 5788, 5790, 5794, 5795, 5799, 1606, 5800, 2584, 2585, 2586, 2587, 2588, 2589, 5812, 1395, 5821, 5843, 1395, 5845, 5813, 5851, 5827, 5858, 5839, 5868, 1395, 1395, 5876, 5841, 5870, 5844, 5860, 1395, 1395, 5862, 5882, 5914, 1395, 2649, 5919, 5916, 5923, 1395, 5929, 5937, 1395, 1395, 5955, 5942, 5927, 5956, 5957, 1395, 5951, 5958, 5959, 868, 868, 868, 868, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 5969, 5970, 5977, 5971, 5979, 651, 5992, 6002, 4254, 1607, 6017, 5981, 3494, 4134, 5991, 5983, 6003, 3494, 5972, 6007, 3494, 651, 5809, 3801, 6016, 5311, 6018, 2650, 1395, 6023, 1003, 5229, 6041, 6033, 6039, 4213, 5814, 6043, 6042, 1395, 6056, 1395, 6060, 6086, 6089, 6079, 6092, 6100, 6094, 6103, 6025, 2112, 6096, 804, 6104, 6120, 6121, 6122, 5837, 6131, 3490, 6123, 5586, 3330, 6132, 2114, 6137, 3490, 6138, 6074, 6141, 6142, 3490, 5586, 6213, 3490, 6148, 6147, 188, 6149, 2852, 1395, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 6154, 6087, 6159, 6163, 5357, 6164, 6170, 5901, 4135, 3482, 6166, 5324, 6178, 3482, 6180, 6185, 6198, 6205, 6207, 6215, 6090, 6091, 6224, 5679, 6223, 3330, 6225, 6241, 5097, 6243, 6261, 6263, 6262, 2652, 6264, 6267, 6265, 6279, 5883, 5884, 6275, 6283, 6287, 3984, 6300, 6289, 6288, 6302, 3990, 6320, 3991, 6326, 6327, 6333, 6331, 2120, 6335, 6332, 2121, 6345, 3997, 6350, 6336, 3998, 6348, 3999, 4000, 6272, 6273, 4002, 1395, 6368, 6373, 4005, 6369, 4006, 6370, 1395, 4008, 6388, 3764, 4669, 6398, 6371, 6372, 6400, -2002, 6409, 6401, 6292, 2643, 3764, 6413, 6434, 6426, 6427, 6415, -2992, 6442, 956, 6443, 6446, 6448, 6459, 6454, 6452, 5768, 6457, 6465, 1478, 1586, 653, 4230, 3775, 956, 5887, 3692, 4367, 4952, 4945, 3011, 3816, 6208, 2645, 2634, 4514, 3864, 5691, 6301, 1147, 6073, 5094, 5743, 4941, 4942, 5433, 5725, 4347, 4310, 2580, 4021, 6200, 5628, 6297, 4057, 1395, 6095, 6093, -2992, -2992, -2992, 2584, 2585, 2586, 2587, 2588, 2589, 919, 6222, 6312, 4353, 651, 5462, 5116, 5145, 5124, 6053, 1283, 2852, 5086, 4129, 3882, 6050, 4950, 4130, 4131, 4132, 2014, 4385, 3883, 4574, 1676, 5111, 5456, 5731, 4614, 5169, 5973, 6365, 6464, 1283, 6444, 3919, 4129, 5706, 4806, 5153, 4130, 4131, 4132, 4520, 6227, 5651, 5878, 6062, 956, 3078, 3941, 5654, 757, 811, 1077, 4680, 5197, 6032, 2034, 6034, 5854, 5831, 5199, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 6361, 5155, 1001, 3911, 868, 3141, 3544, 4301, 5769, 3137, 3153, 5967, -2992, 4631, 3170, 868, 1148, -2992, 3490, 4484, 1188, 3813, 4981, 4431, 6247, 6399, 4279, 5172, 1423, 3841, 5173, 4664, 3499, 5836, 3193, 6351, 4019, 3036, 1001, 5187, 5650, 2766, 5516, 5850, 5853, 2655, 2607, 6047, 842, 843, 5227, 3330, 2716, 4277, 2715, 4289, 6183, 6035, 4250, 5648, 4832, 3509, 6074, 4848, 2720, 5591, 5826, 4243, -2992, 5825, 5188, 4244, 6386, 6169, 653, 6024, 6281, 4245, 5808, 1395, 6412, 2664, 3330, 653, 976, 6036, 4781, 4209, 5467, 1395, 3421, 653, 1395, 976, 653, 1395, 1395, 1395, 3418, 6037, 3336, 4075, 4201, 3482, 5693, 4203, 3840, 976, 5990, 6417, 4194, 4110, 4730, 3433, 3497, 0, 5892, 0, 0, 1147, 1395, 1395, 0, 0, 1395, 0, 2650, 0, 5333, 188, 1474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1395, 5513, 5515, 2120, 1395, 0, 2121, 0, 0, 0, 1395, -2992, 0, 0, 3494, 0, 0, 0, 5311, 0, 0, 1395, 0, 5609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4134, 0, 0, 0, 2643, 0, 5369, 0, 0, 0, 0, -2992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4916, 1003, 956, 0, 956, 0, 5385, 0, 0, 0, 0, 0, 0, 3490, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2992, 0, 0, 0, 0, 0, 0, 6430, 0, 0, 967, 1003, 4313, 0, 0, 4135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3490, 0, 0, 0, 0, 0, 0, 0, 0, 4135, 0, 0, 0, 0, 0, 0, 0, 6407, 0, 0, 0, 0, 0, 5413, 0, 5612, 967, 0, 0, 0, 0, 0, 4807, 0, 0, 0, 0, 0, 5085, 5887, 0, 0, 0, 868, 0, 0, 0, 650, 868, 0, 0, 650, 0, 0, 0, 0, 0, 2852, 0, 0, 0, 0, 0, 4374, 0, 4376, 6249, 868, 0, 0, 6251, 5134, 0, 0, 5745, 0, 6407, -2992, -2992, 3330, 0, 0, 0, -2992, 0, 956, 868, 4916, 0, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 6407, 0, 0, 0, 193, 176, 72, 0, 81, 0, 84, 0, 0, 85, 3482, 4916, 86, 1395, 87, 3482, 107, 0, 3482, 0, 0, 0, 0, 125, 6354, 6355, 1395, 0, 6445, -2992, 130, 0, 160, 0, 0, 0, 650, 3490, 182, 5497, 185, 0, 179, 1395, 186, 0, 0, 1395, 931, 1395, 0, 0, 0, 0, 0, 0, 0, 5758, 0, 192, 5730, 0, 0, 1395, 0, 0, 3490, 0, 0, 0, 0, 651, 0, 0, 1395, 1147, 6249, 0, 5834, 0, 6251, 0, 0, 0, 0, 1395, 0, 2650, 0, 6353, 0, 5756, 1395, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 0, 0, 4479, 187, 0, 0, 0, 0, 4486, 0, 0, 0, 0, 0, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 0, 3490, 868, 0, 0, 0, 0, 0, 0, 1395, 0, 0, 0, 0, 6389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1395, 0, 0, 0, 0, 0, 1395, 1395, 0, 1001, 0, 956, 956, 956, 956, 0, 0, 6168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 0, -2992, 0, 0, 0, 0, 4480, 0, 0, 1395, 0, 0, 0, 0, 0, 6249, 0, 651, 976, 6251, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 868, 0, 0, 3494, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 0, 653, 0, 0, 0, 0, 919, 0, 0, 0, 653, 976, 0, 0, 0, 868, 0, 653, 0, 976, 653, 0, 0, 0, 0, 0, 650, 650, 0, 0, 0, 0, 919, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 3490, 0, 0, 0, 1395, 0, 0, -2992, 0, 0, 188, 0, 0, 4648, 0, 4650, 1395, 4652, 0, 2584, 2585, 2586, 2587, 2588, 2589, 1395, 1395, 1395, 0, 0, 0, 2014, 3330, 3330, 0, 0, 3330, 3801, 0, 0, 1395, 0, 0, 0, 794, 0, 0, 0, 0, 1395, 794, 1395, 0, 1395, 5609, 0, 976, 0, 0, 2120, 5945, 1395, 2121, 0, 188, 188, 0, 0, 0, 0, 2014, 0, 1003, 0, 0, 0, 0, 1589, 653, 653, 1395, 0, 0, 1590, 976, 0, 0, 0, 0, 0, 0, 0, 0, 6204, 2643, 0, 0, 0, 1695, 0, 0, -2992, 0, 0, 0, 0, 0, 0, 0, 976, 0, 653, 0, 0, 0, 0, 2014, 2014, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 1592, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 6116, 0, 0, 0, 0, 0, 6254, 6255, 0, 0, 976, 0, 4916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1696, 0, 1593, 0, 0, 0, 0, 3482, 0, 1594, 0, 0, 0, 1595, 0, 0, 5274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3490, 0, 1395, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 3490, 0, 0, 0, 0, 1395, 0, 0, 0, 5834, 0, 650, 0, 0, 2040, 1395, 0, -2992, 650, 2040, 2040, 0, -2992, 650, 0, 0, 650, 5307, 0, 0, 0, 0, 1597, 0, 0, 0, 0, 0, 0, 967, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 653, 1829, 956, 0, 0, 0, 0, 0, 976, 2014, 0, 0, 0, 653, 0, 0, 0, 0, 919, 653, 0, -2992, 0, 653, 0, 653, 6139, 0, 0, 919, 0, 0, 0, 0, 0, 2852, 0, 0, 0, 0, 0, 0, 1395, 0, 0, 919, 0, 0, 0, 0, 0, 0, 4916, 0, 0, 0, 0, 0, 0, 188, 1697, 967, 967, 6257, 1599, 0, 0, 1395, 6253, 0, 0, 4019, 0, 0, 1600, 0, 0, 0, 0, 2650, 0, 5968, 0, 0, 1601, 0, 0, 0, 0, 653, 188, 653, 653, 2014, 2014, 6274, 1602, 0, 0, 0, 0, 1395, 1395, 0, 188, 1395, 6250, 3490, 6282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 6325, 976, 0, 0, 956, 0, 0, 0, 3772, 0, 0, 1604, 1605, 0, 0, 0, 6228, 0, 6029, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 6116, 956, 956, 0, 0, 0, 4916, 0, 6252, 3773, 0, -2992, 0, 0, 0, 0, 0, 0, 6253, 0, 0, 0, 0, 0, 651, 0, 0, 0, 0, 0, 976, 0, 1395, 6455, 6456, 0, 0, 0, 0, 2112, 6344, 5439, 0, 0, 919, 0, 976, 0, 1395, 0, 0, 0, 0, 4019, 0, 3490, 6250, 0, 4664, 0, 0, 3490, 0, 976, 0, 1395, -2757, 0, 976, 0, 0, 0, 650, 0, 0, 0, 0, 192, 0, 0, 653, 0, 1607, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6374, 6375, 651, 6379, 0, 0, 0, 0, 5834, 0, 0, 0, 0, 1395, 0, -2992, 0, 0, 0, 0, 653, 6252, 0, 956, 0, 0, 4916, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 6253, 0, 0, 0, 0, 0, 0, 0, 6344, 0, 0, 653, 653, 653, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2757, -2774, 0, 0, 0, 0, 0, 0, 1395, 651, 3482, 653, 188, 6250, 0, 0, 0, 0, 3490, 0, 0, 0, 0, 0, 1589, 651, 0, 0, 0, 0, 1590, 0, 0, 0, 192, 0, 976, 0, 0, 0, 0, 0, 967, 967, 976, 976, 6458, 0, 6344, 0, 0, 0, 0, -2757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5176, 6344, -2757, 5178, 653, 0, 0, 0, -2757, 0, 0, 1592, 0, 0, -2757, 0, 6252, 0, 0, 0, -2757, 0, 0, -2757, 0, 0, 0, -2757, 0, 0, 0, 0, 0, 1829, 0, 650, -2774, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5204, 0, 0, 653, 0, 0, 0, 653, 653, 0, -2757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1593, 0, 653, 0, 0, 0, 0, 1594, 919, 650, 0, 1595, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2774, -2757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2774, 0, 0, 0, 0, 1596, -2774, 0, 0, 0, 0, 966, -2774, 0, 0, 0, 0, 0, -2774, 0, 0, -2774, 0, 0, 794, -2774, 794, 0, 794, 0, 0, 0, 0, 0, 794, 1227, 1228, 0, 0, -2757, 0, 1597, 919, -2757, 0, 0, 0, 0, 0, -2757, 0, 0, 0, 0, 0, -2774, 966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, -2774, 0, 0, 0, 188, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, -2757, 0, 0, 0, 0, 0, 919, 650, 0, 0, 0, 1697, 0, 2642, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 1600, 5332, 0, 0, -2774, 2644, 0, 0, -2774, 0, 1601, 650, 0, 0, -2774, 0, 0, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 0, 6385, 0, 0, 2645, 0, 0, 809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5370, 5371, 0, 653, 653, 653, 0, -2757, 1725, 0, 0, 1604, 1605, 0, 650, 0, 0, 0, -2774, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2757, 0, -2757, -2757, 0, 794, 0, 0, 0, 0, 0, 0, 1726, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, -2757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2757, 0, 809, -2757, -2757, -2757, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 2646, 0, 5414, 5415, 0, 2647, 0, 0, 0, 0, 0, 976, 0, 0, 794, -2774, 0, 719, 0, 0, 0, 0, 0, 919, 1607, 2643, 808, 0, 2648, 2314, 0, 0, 2644, 0, 919, 0, 0, 0, 0, -2774, 0, -2774, -2774, 0, 0, 0, 1829, 0, 0, 0, 919, 5928, 0, 0, 0, 0, 2649, 0, 2645, 0, 0, 0, 0, -2774, 0, 0, 0, 0, 0, 976, 6324, 3961, 0, 0, 0, 0, 0, 976, 0, 650, 0, 0, 0, -2774, 0, 976, -2774, -2774, -2774, 0, 0, 0, 0, 0, 0, 1559, 0, 0, 0, 2381, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 653, 2650, 0, 653, 2651, 0, 919, 0, 0, 919, 919, 0, 0, 653, 653, 0, 976, 976, 1560, 5508, 0, 0, 5510, 5511, 0, 0, 0, 0, 653, 0, 976, 653, 0, 0, 0, 0, 0, 0, 0, 0, 919, 919, 2120, 976, 976, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 5526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 2642, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 188, 0, 1561, 0, 653, 2644, 0, 0, 653, 653, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 1562, 2649, 0, 0, 653, 0, 653, 0, 0, 0, 0, 653, 653, 0, 0, 0, 0, 0, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 0, 0, 0, 653, 0, 653, 0, 653, 653, 653, 653, 653, 653, 2381, 3962, 653, 0, 653, 653, 1563, 0, 653, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 0, 0, 650, 0, 919, 653, 653, 653, 0, 0, 0, 0, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0, 653, 2580, 1829, 0, 0, 0, 0, 0, 0, 1565, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 2646, 0, 4102, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 1567, 0, 2122, 2123, 2124, 0, 0, 0, 1529, 0, 0, 2648, 2314, 0, 0, 0, 0, 794, 0, 0, 2642, 0, 794, 794, 0, 0, 0, 0, 0, 2652, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 2649, 0, 0, 0, 966, 0, 0, 36, 0, 0, 0, 2660, 3963, 0, 0, 0, 0, 0, 0, 0, 2667, 1570, 2668, 0, 2645, 0, 2671, 0, 0, 0, 1571, 0, 0, 2677, 0, 0, 0, 0, 2830, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 1573, 0, 0, 0, 0, 0, 0, 2650, 0, 1574, 2651, 0, 0, 0, 1575, 653, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0, 966, 966, 0, 0, 0, 0, 0, 0, 3964, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 653, 0, 1576, 0, 0, 794, 3965, 0, 0, 0, 0, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -136, 2648, 2314, 0, 0, 0, 0, 653, 0, 0, 1227, 1228, 0, 650, 0, 5856, 0, 0, 0, 650, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 2, 0, 3, 4, 0, 0, 6329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 794, 0, 0, 794, 794, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 5893, 0, 0, 2381, 7, 0, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 0, 0, 2650, 0, 0, 2651, 0, 2580, 0, 0, 0, 0, 12, 0, 13, 1078, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 3359, 0, 14, 6377, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 650, 0, 0, 0, 0, 0, 19, 0, 0, 1146, 719, 0, 0, 0, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 2652, 0, 0, 6377, 5989, 0, 0, 653, 653, 653, 653, 653, 653, 653, 653, 653, 24, 653, 0, 6441, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 653, 0, 3961, 0, 0, 0, 966, 966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1559, 0, 0, 0, 0, 0, 0, 0, 794, 0, 1252, 0, 653, 0, 25, 26, 653, 0, 0, 653, 27, 653, 0, 0, 653, 0, 0, 0, 653, 0, 1274, 0, 0, 0, 0, 28, 1560, 0, 1398, 0, 0, 1407, 1146, 1409, 0, 0, 0, 0, 0, 1829, 2580, 653, 0, 0, 29, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 653, 0, 0, 0, 4118, 0, 0, 4119, 0, 653, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 1561, 0, 0, 31, 976, 0, 0, 0, 0, 0, 0, 919, 0, 0, 0, 919, 919, 0, 32, 0, 0, 0, 976, 0, 33, 34, 976, 35, 0, 0, 976, 0, 36, 0, 0, 0, 0, 1562, 37, 976, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 976, 40, 41, 653, 0, 0, 0, 0, 0, 42, 0, 0, 0, 43, 653, 0, 919, 653, 0, 653, 653, 0, 919, 0, 44, 0, 0, 0, 3962, 0, 0, 0, 0, 1563, 976, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 976, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 919, 0, 0, 3278, 3279, 47, 0, 0, 1565, 0, 0, 48, 0, 0, 0, 0, 49, 0, 0, 0, 3315, 3316, 1829, 976, 1146, 0, 1829, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 1567, 2121, 0, 0, 0, 2122, 2123, 2124, 1529, 976, 3361, 1829, 51, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 976, 0, 57, 0, 2643, -136, 0, 976, 0, 0, 976, 2644, 0, 0, 0, 1589, 976, 36, 0, 0, 0, 1590, 1569, 0, 0, 0, 0, 0, 1656, 0, 0, 1570, 0, 0, 0, 0, 976, 2645, 0, 0, 1571, 0, 976, 0, 0, 0, 0, 0, 2830, 976, 1657, 0, 0, 0, 0, 0, 0, 6295, 0, 0, 0, 1573, 0, 976, 0, 0, 1592, 0, 0, 0, 1574, 0, 0, 0, 0, 1575, 0, 976, 0, 0, 0, 0, 1829, 0, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 3964, 0, 0, 0, 0, 0, 1658, 0, 0, 0, 653, 653, 653, 0, 0, 0, 653, 0, 1589, 0, 0, 0, 0, 0, 1590, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 1594, 0, 1576, 0, 1595, 1591, 3965, 0, 0, 653, 919, 0, 0, 0, 0, 0, 0, 2039, 1829, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 1596, 0, 0, 1592, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 1146, 0, 653, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 1659, 0, 0, 0, 1597, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 2649, 0, 919, 0, 0, 0, 919, 0, 0, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 1594, 0, 0, 0, 1595, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 1660, 0, 0, 0, 1596, 1661, 0, 0, 0, 0, 0, 2116, 2650, 0, 0, 2651, 0, 0, 0, 0, 2118, 1662, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1600, 2605, 0, 0, 0, 1597, 0, 0, 0, 0, 1601, 0, 0, 976, 0, 1829, 0, 0, 0, 0, 1146, 1663, 1602, 2622, 2623, 918, 0, 0, 1146, 1146, 919, 0, 976, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 653, 0, 919, 653, 0, 653, 653, 919, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 2646, 653, 0, 1664, 0, 2647, 1604, 1605, 1665, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 919, 0, 0, 0, 0, 1598, 0, 0, 0, 1599, 2648, 2314, 0, 0, 1666, 0, 0, 0, 0, 1600, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 1601, 0, 0, 653, 653, 653, 1668, 0, 653, 2649, 0, 0, 1602, 0, 0, 0, 653, 653, 653, 653, 0, 0, 0, 0, 0, 0, 0, 1829, 0, 0, 0, 0, 653, 1829, 0, 653, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 653, 0, 2381, 653, 0, 1603, 0, 0, 1604, 1605, 0, 0, 0, 0, 1607, 0, 0, 2650, 0, 0, 2651, 2580, 0, 0, 653, 0, 653, 0, 653, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 1589, 1606, 0, 0, 0, 0, 1590, 4120, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 976, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 3462, 3464, 0, 0, 0, 0, 3472, 0, 1592, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 653, 0, 0, 653, 2644, 0, 0, 0, 1607, 2652, 0, 0, 0, 0, 0, 3518, 3518, 653, 0, 0, 2961, 0, 653, 0, 0, 0, 0, 0, 2969, 0, 2645, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 1594, 0, 653, 0, 1595, 653, 0, 0, 0, 0, 0, 0, 919, 0, 0, 919, 0, 919, 1559, 0, 0, 2120, 919, 0, 2121, 0, 0, 794, 2122, 2123, 2124, 0, 1596, 0, 0, 0, 0, 976, 976, 0, 0, 0, 0, 653, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 1560, 0, 2643, 0, 976, 0, 0, 976, 0, 2644, 919, 0, 2580, 0, 1597, 0, 0, 0, 919, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 2645, 0, 4171, 0, 0, 0, 0, 0, 919, 0, 2646, 0, 0, 0, 653, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3644, 0, 0, 1561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1829, 1829, 1829, 0, 0, 0, 1697, 0, 0, 0, 1599, 0, 1562, 2649, 0, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 0, 976, 0, 0, 0, 0, 1601, 0, 0, 0, 919, 0, 919, 0, 0, 0, 0, 0, 1602, 0, 976, 0, 0, 0, 0, 0, 0, 3099, 0, 0, 0, 3104, 2381, 0, 0, 0, 0, 794, 1563, 0, 0, 2646, 976, 0, 0, 794, 2647, 2650, 794, 1589, 2651, 0, 0, 0, 0, 1590, 0, 0, 0, 0, 794, 2810, 1656, 0, 1604, 1605, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1565, 0, 1657, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2811, 2649, 0, 0, 1592, 0, 0, 2120, 0, 0, 2121, 0, 919, 0, 2122, 2123, 2124, 0, 0, 1567, 0, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 2642, 0, 0, 0, 976, 0, 0, 0, 1658, 653, 2643, 0, 2381, 0, 0, 653, 2652, 2644, 0, 0, 0, 0, 0, 0, 919, 0, 0, 2650, 0, 1593, 2651, 0, 0, 36, 0, 2829, 1594, 0, 1569, 0, 1595, 1607, 0, 2645, 0, 0, 0, 1570, 0, 0, 0, 1829, 919, 0, 0, 0, 1571, 976, 0, 976, 0, 0, 0, 0, 2830, 0, 0, 0, 1596, 0, 0, 0, 976, 0, 976, 3289, 0, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 1574, 0, 0, 0, 0, 1575, 918, 0, 653, 0, 0, 0, 0, 0, 1659, 0, 0, 0, 1597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 919, 0, 2580, 0, 2652, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 976, 919, 0, 4112, 0, 0, 0, 1576, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 2646, 0, 1660, 919, 0, 2647, 0, 1661, 0, 0, 916, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 794, 0, 976, 1662, 2643, 0, 0, 1599, 2648, 2314, 0, 2644, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1601, 0, 0, 0, 976, 0, 0, 0, 976, 2649, 2645, 1663, 1602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 976, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 4516, 653, 0, 0, 919, 0, 0, 0, 2381, 0, 653, 3745, 0, 918, 1604, 1605, 1665, 0, 0, 0, 0, 0, 0, 2650, 653, 0, 2651, 0, 653, 653, 653, 0, 0, 0, 0, 653, 0, 0, 653, 0, 1666, 653, 0, 0, 0, 0, 3746, 653, 0, 653, 0, 0, 653, 0, 0, 0, 919, 653, 653, 653, 653, 1668, 0, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, 0, 0, 0, 653, 653, 653, 0, 0, 919, 0, 0, 2646, 0, 653, 0, 0, 2647, 0, 653, 0, 1829, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 653, 0, 653, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 1607, 2652, 0, 0, 0, 653, 0, 0, 653, 653, 0, 0, 0, 653, 653, 0, 0, 0, 653, 0, 653, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4228, 0, 794, 0, 0, 1744, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 653, 0, 4235, 2122, 2123, 2124, 653, 0, 918, 0, 0, 0, 0, 0, 653, 2381, 0, 0, 653, 918, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 2643, 0, 2651, 0, 918, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 4284, 4284, 0, 0, 0, 0, 2580, 919, 0, 0, 0, 0, 2645, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 4717, 0, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 2652, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1829, 0, 0, 1589, 2642, 1829, 919, 1829, 0, 1590, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1829, 919, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 918, 0, 1592, 0, 0, 3440, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 0, 0, 976, 0, 0, 0, 2580, 0, 0, 0, 0, 2649, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 4790, 0, 0, 1593, 0, 0, 0, 0, 0, 0, 1594, 0, 0, 0, 1595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 2650, 1596, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 976, 976, 0, 0, 919, 0, 0, 0, 0, 0, 0, 976, 0, 0, 1597, 0, 0, 0, 653, 653, 0, 2648, 2314, 0, 0, 0, 0, 0, 976, 0, 0, 0, 1146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 919, 0, 0, 0, 0, 919, 653, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 0, 0, 0, 2381, 0, 1598, 0, 0, 0, 1599, 794, 0, 0, 0, 0, 0, 0, 916, 2650, 1600, 0, 2651, 653, 0, 1589, 0, 0, 0, 0, 1601, 1590, 0, 0, 4563, 0, 976, 0, 0, 1829, 0, 0, 1602, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 2750, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1592, 0, 0, 0, 0, 653, 0, 0, 0, 2894, 1409, 0, 1604, 1605, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 653, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 1409, 0, 0, 0, 4885, 0, 2652, 0, 0, 0, 2895, 2750, 0, 907, 0, 0, 0, 653, 0, 0, 653, 0, 0, 1593, 0, 0, 0, 0, 653, 653, 1594, 919, 0, 0, 1595, 653, 653, 0, 0, 0, 653, 0, 0, 0, 0, 653, 0, 0, 653, 653, 0, 0, 918, 0, 0, 653, 0, 0, 0, 0, 0, 0, 1596, 0, 3807, 0, 0, 0, 3811, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 916, 0, 1607, 653, 918, 0, 0, 0, 653, 0, 794, 653, 653, 0, 0, 0, 0, 1597, 0, 653, 0, 0, 0, 0, 3844, 0, 3844, 0, 3844, 3844, 653, 2580, 653, 3844, 3844, 3844, 0, 3844, 3844, 3844, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 4909, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 0, 1589, 0, 0, 653, 0, 0, 1590, 0, 0, 0, 0, 0, 0, 0, 1744, 1744, 1744, 0, 0, 0, 0, 0, 3921, 659, 0, 0, 0, 0, 1697, 708, 659, 0, 1599, 0, 0, 760, 0, 659, 919, 0, 720, 0, 1600, 659, 0, 3257, 817, 3949, 0, 0, 0, 1592, 1601, 0, 0, 976, 0, 0, 0, 0, 919, 0, 0, 0, 1602, 879, 879, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 916, 0, 723, 3258, 0, 0, 0, 976, 0, 0, 0, 916, 0, 3628, 1593, 0, 1604, 1605, 0, 724, 0, 1594, 0, 0, 0, 1595, 0, 916, 0, 0, 0, 0, 918, 0, 0, 0, 0, 1061, 919, 0, 0, 0, 0, 918, 0, 0, 0, 0, 1606, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 918, 0, 3259, 0, 0, 653, 0, 0, 1589, 0, 0, 0, 0, 0, 1590, 727, 0, 0, 0, 0, 0, 653, 0, 0, 728, 0, 1829, 0, 0, 0, 1597, 0, 0, 0, 0, 0, 0, 729, 0, 0, 0, 0, 0, 3260, 0, 976, 0, 0, 0, 0, 0, 0, 653, 0, 918, 0, 0, 0, 0, 1592, 0, 0, 1607, 958, 0, 0, 0, 962, 0, 918, 1064, 0, 918, 918, 0, 1005, 0, 0, 1007, 0, 0, 1012, 1013, 0, 1016, 0, 1019, 0, 0, 1025, 0, 1027, 0, 0, 0, 0, 0, 0, 919, 0, 919, 0, 0, 918, 918, 0, 0, 0, 3261, 0, 1697, 0, 0, 0, 1599, 0, 1593, 0, 0, 794, 1589, 0, 0, 1594, 1600, 0, 1590, 1595, 0, 0, 733, 0, 916, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 976, 0, 0, 0, 1602, 794, 0, 0, 0, 0, 0, 0, 0, 1596, 0, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 0, 653, 0, 0, 1592, 794, 0, 0, 0, 0, 0, 653, 0, 0, 653, 0, 0, 653, 653, 653, 0, 0, 3819, 0, 1597, 1604, 1605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1146, 1744, 0, 0, 0, 653, 653, 214, 3262, 653, 0, 738, 0, 0, 0, 1744, 0, 0, 1744, 0, 3820, 0, 0, 0, 1593, 0, 653, 0, 0, 0, 653, 1594, 0, 0, 0, 1595, 653, 0, 909, 1068, 653, 0, 3263, 918, 1227, 1228, 919, 653, 0, 742, 0, 0, 0, 0, 0, 0, 743, 0, 976, 744, 976, 0, 0, 1596, 0, 0, 0, 1697, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 0, 745, 0, 1600, 653, 0, 0, 0, 0, 1070, 2621, 0, 0, 1601, 0, 1607, 747, 0, 0, 1071, 0, 1597, 0, 0, 749, 1602, 0, 0, 0, 919, 976, 0, 0, 0, 0, 0, 0, 0, 0, 3264, 653, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 794, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 754, 0, 4331, 1146, 0, 1604, 1605, 2642, 0, 0, 0, 0, 0, 0, 1829, 0, 0, 2643, 0, 653, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1697, 907, 4332, 0, 1599, 0, 0, 910, 0, 0, 916, 0, 0, 0, 1600, 2645, 0, 0, 0, 0, 0, 794, 0, 0, 1601, 0, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 1602, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 919, 0, 0, 0, 0, 0, 0, 4390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 1607, 653, 0, 916, 4402, 0, 0, 1604, 1605, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 653, 0, 653, 4439, 4403, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 2646, 653, 0, 0, 653, 2647, 0, 0, 0, 0, 1055, 0, 0, 0, 0, 653, 0, 0, 0, 916, 0, 1092, 653, 0, 0, 1096, 0, 0, 2648, 2314, 0, 0, 1109, 1110, 0, 0, 1116, 0, 1120, 1121, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 4482, 0, 0, 1143, 1607, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 919, 1156, 0, 0, 0, 919, 919, 0, 0, 0, 653, 0, 0, 0, 0, 0, 653, 653, 976, 0, 0, 0, 1184, 0, 1186, 0, 0, 0, 3844, 2381, 0, 0, 976, 0, 1202, 0, 0, 0, 0, 0, 4513, 4513, 0, 0, 2650, 0, 0, 2651, 0, 0, 4529, 0, 653, 0, 0, 1146, 0, 1146, 0, 0, 653, 0, 0, 1829, 0, 0, 0, 794, 659, 0, 0, 0, 0, 794, 0, 0, 0, 0, 794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4584, 0, 5383, 5384, 0, 0, 0, 5387, 5388, 0, 0, 0, 0, 0, 0, 919, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 4620, 1146, 916, 2652, 0, 0, 1744, 907, 0, 653, 1829, 0, 0, 916, 879, 0, 1559, 0, 0, 0, 0, 653, 0, 907, 0, 0, 0, 0, 0, 916, 653, 653, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 1829, 0, 0, 919, 0, 0, 1560, 0, 653, 0, 653, 0, 653, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 1550, 0, 916, 916, 0, 0, 0, 0, 0, 0, 2580, 1829, 0, 0, 976, 0, 1561, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5114, 916, 916, 0, 0, 0, 0, 0, 0, 0, 0, 3540, 0, 0, 0, 2750, 3546, 0, 0, 0, 0, 1562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 1728, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 1849, 0, 0, 918, 1563, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 1861, 4791, 1862, 0, 0, 909, 0, 0, 0, 0, 653, 0, 1865, 0, 0, 0, 0, 0, 0, 1875, 0, 0, 0, 0, 0, 653, 0, 0, 0, 1564, 0, 0, 0, 1565, 0, 653, 0, 0, 0, 0, 0, 918, 0, 0, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 1927, 916, 1929, 1566, 1567, 0, 2120, 0, 0, 2121, 976, 0, 1529, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 1568, 0, 2644, 0, 36, 0, 653, 0, 0, 1569, 0, 0, 0, 0, 2120, 0, 653, 2121, 1570, 910, 0, 2122, 2123, 2124, 0, 653, 653, 1571, 2645, 0, 0, 653, 659, 0, 659, 1572, 659, 0, 659, 2642, 659, 659, 659, 0, 909, 910, 0, 659, 1573, 2643, 0, 0, 794, 0, 0, 0, 2644, 1574, 0, 2035, 0, 0, 1575, 0, 0, 653, 653, 0, 2120, 653, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 976, 0, 0, 0, 0, 2644, 1744, 4529, 0, 0, 0, 0, 0, 0, 1576, 0, 0, 0, 0, 0, 0, 0, 907, 0, 653, 0, 0, 0, 0, 0, 653, 2645, 0, 0, 0, 4987, 0, 0, 918, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 653, 0, 5001, 0, 0, 5002, 0, 5003, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 653, 907, 0, 0, 0, 0, 2646, 0, 2649, 0, 0, 2647, 5043, 909, 0, 0, 0, 0, 0, 0, 0, 0, 2750, 0, 909, 0, 2750, 0, 3844, 0, 0, 0, 0, 3844, 2648, 2314, 0, 0, 0, 653, 909, 0, 907, 0, 919, 0, 0, 0, 0, 0, 653, 2381, 0, 0, 0, 0, 0, 0, 879, 0, 2646, 0, 2649, 653, 0, 2647, 2650, 0, 0, 2651, 1829, 0, 0, 0, 0, 907, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1559, 0, 0, 0, 2381, 0, 0, 653, 653, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 2650, 0, 0, 2651, 0, 653, 0, 0, 0, 1829, 0, 918, 5148, 0, 0, 4529, 0, 1560, 0, 0, 0, 0, 653, 653, 0, 0, 918, 0, 0, 0, 0, 918, 0, 0, 1829, 0, 0, 0, 0, 2381, 0, 910, 0, 2652, 0, 794, 0, 0, 0, 0, 0, 0, 910, 0, 2650, 0, 0, 2651, 0, 2808, 0, 918, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1561, 0, 0, 0, 909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 5208, 5208, 5208, 5208, 0, 5208, 5208, 5208, 5208, 5208, 0, 1562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2906, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 2580, 0, 2652, 0, 0, 0, 0, 0, 907, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 1563, 0, 0, 0, 5238, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 1564, 0, 0, 0, 1565, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5275, 0, 907, 0, 5287, 0, 5289, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 1630, 1567, 907, 907, 0, 0, 0, 0, 0, 1529, 6071, 0, 0, 0, 2580, 0, 0, 916, 0, 0, 0, 916, 916, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 907, 907, 0, 5279, 0, 0, 0, 0, 0, 0, 1631, 0, 0, 0, 36, 0, 0, 0, 0, 1569, 0, 0, 0, 0, 0, 0, 0, 0, 1570, 0, 2750, 0, 0, 3546, 0, 3546, 0, 1571, 0, 0, 2750, 0, 0, 916, 0, 1632, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 1574, 2120, 909, 3037, 2121, 1575, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 2642, 0, 0, 916, 0, 0, 0, 0, 0, 0, 2643, 0, 3073, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 2750, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 1576, 2122, 2123, 2124, 0, 0, 0, 2645, 909, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 2642, 0, 0, 3138, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 5411, 5412, 0, 0, 0, 3156, 0, 0, 0, 0, 0, 0, 909, 3844, 0, 3844, 3844, 3844, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 918, 0, 918, 3176, 0, 3177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 3186, 0, 3187, 910, 0, 0, 0, 0, 0, 0, 659, 0, 659, 0, 659, 0, 659, 0, 659, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5463, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3248, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 910, 5491, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 2646, 2649, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 1744, 0, 0, 0, 0, 910, 1744, 0, 0, 0, 0, 0, 0, 0, 0, 918, 2648, 2314, 0, 5208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 912, 0, 0, 910, 0, 0, 0, 0, 3546, 2649, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 912, 916, 0, 0, 0, 0, 0, 0, 0, 0, 1559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 2381, 2120, 0, 0, 2121, 909, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 1560, 909, 0, 0, 918, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 3546, 913, 0, 0, 0, 0, 6405, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 2645, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 916, 0, 0, 1561, 0, 0, 0, 0, 0, 0, 909, 0, 4529, 909, 909, 916, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6405, 2652, 0, 0, 0, 0, 0, 0, 0, 1562, 912, 0, 0, 909, 909, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 6405, 0, 3844, 0, 0, 0, 910, 0, 0, 0, 0, 5692, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 918, 0, 0, 2580, 0, 0, 0, 0, 0, 910, 1563, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5548, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1564, 0, 918, 0, 1565, 2648, 2314, 0, 2580, 0, 0, 0, 0, 910, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 918, 910, 0, 5559, 910, 910, 2649, 0, 0, 1647, 1567, 0, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 910, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 2381, 0, 0, 1648, 0, 0, 0, 36, 0, 912, 0, 0, 1569, 0, 0, 2650, 0, 0, 2651, 0, 0, 1570, 0, 0, 0, 912, 0, 0, 0, 0, 1571, 0, 0, 0, 0, 0, 0, 0, 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 1574, 0, 0, 2120, 0, 1575, 2121, 0, 0, 907, 2122, 2123, 2124, 907, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 916, 0, 4077, 916, 0, 916, 0, 0, 2750, 2643, 916, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 2652, 1146, 0, 0, 0, 5903, 0, 0, 0, 0, 1576, 0, 0, 0, 0, 0, 907, 0, 910, 2645, 0, 0, 907, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 2642, 907, 0, 0, 0, 0, 0, 0, 0, 912, 2643, 3546, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 3546, 0, 0, 0, 2645, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5569, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 916, 2647, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3536, 3537, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 3552, 3553, 0, 3555, 3556, 0, 0, 0, 3559, 3560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 3571, 0, 0, 0, 3574, 0, 0, 0, 3577, 3578, 0, 0, 3581, 3582, 0, 0, 0, 0, 0, 3587, 0, 0, 0, 1146, 0, 0, 0, 6077, 0, 6078, 0, 3602, 2646, 6084, 6085, 0, 0, 2647, 0, 2381, 0, 0, 916, 3619, 0, 0, 0, 0, 3621, 0, 0, 0, 918, 0, 2650, 0, 0, 2651, 0, 0, 2648, 2314, 0, 3627, 0, 0, 0, 3633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3643, 0, 0, 3647, 907, 3649, 3652, 3654, 916, 0, 2649, 0, 3662, 3665, 0, 0, 0, 0, 0, 0, 0, 3546, 3678, 0, 0, 0, 2750, 0, 3688, 0, 0, 0, 3691, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 3701, 3702, 0, 0, 913, 3707, 0, 0, 0, 2381, 0, 3716, 3717, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 2650, 3726, 0, 2651, 3727, 2652, 913, 0, 0, 907, 0, 3739, 3740, 907, 0, 2120, 0, 3744, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 3751, 0, 0, 3754, 0, 0, 0, 916, 3757, 0, 0, 2642, 0, 0, 3760, 3761, 0, 0, 0, 0, 0, 2643, 3769, 0, 0, 0, 3771, 0, 2644, 916, 3778, 3779, 3780, 3781, 912, 3783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3809, 3810, 916, 3812, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 3822, 3823, 3824, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 907, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 918, 0, 907, 0, 0, 0, 912, 907, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 3876, 909, 909, 0, 913, 0, 0, 0, 3900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 916, 0, 0, 0, 3912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 2580, 0, 909, 2647, 0, 0, 0, 0, 909, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 916, 5625, 3980, 0, 0, 2648, 2314, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3994, 0, 3996, 0, 916, 0, 0, 915, 0, 0, 0, 0, 2649, 909, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 2642, 0, 0, 910, 0, 0, 0, 910, 910, 2381, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 918, 0, 0, 0, 0, 2650, 913, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 913, 912, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 912, 0, 0, 0, 913, 4068, 0, 0, 0, 0, 6406, 0, 0, 0, 910, 0, 912, 2605, 0, 0, 910, 6410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6436, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 6406, 912, 0, 0, 2652, 907, 0, 0, 907, 0, 907, 0, 0, 0, 0, 907, 912, 0, 0, 912, 912, 0, 0, 0, 0, 6406, 0, 0, 5287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 912, 912, 0, 0, 0, 0, 0, 907, 0, 0, 909, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 5495, 0, 918, 0, 0, 0, 913, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 916, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5656, 909, 0, 0, 0, 909, 0, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 907, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 918, 0, 0, 0, 0, 0, 916, 0, 0, 0, 2652, 4316, 909, 0, 0, 0, 0, 909, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 4323, 0, 0, 0, 4323, 0, 0, 0, 910, 4334, 4335, 4336, 910, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 916, 4348, 0, 3546, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 4377, 4378, 4379, 4380, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 913, 2580, 0, 0, 0, 4401, 0, 4405, 4406, 4407, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2120, 0, 0, 2121, 5658, 0, 2645, 2122, 2123, 2124, 0, 910, 0, 0, 0, 0, 974, 0, 0, 0, 0, 0, 0, 0, 0, 1010, 910, 0, 907, 0, 0, 910, 0, 0, 0, 2643, 0, 0, 0, 1032, 0, 0, 2644, 0, 0, 0, 0, 3546, 0, 913, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4490, 0, 0, 0, 0, 0, 0, 0, 0, 4496, 0, 0, 0, 0, 0, 913, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 4506, 4507, 0, 0, 0, 4508, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 909, 0, 0, 909, 0, 909, 907, 915, 0, 0, 909, 0, 4550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 918, 0, 0, 0, 0, 918, 918, 0, 909, 0, 0, 0, -2992, -2992, 907, 0, 909, 0, 0, 0, 4587, 2381, 0, 0, 0, 4593, 0, 0, 0, 0, 0, 4599, 0, 0, 0, 0, 2650, 0, 0, 907, 2649, 909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 4638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, -2992, 0, 0, 0, 0, 0, 0, 4653, 0, 4654, 0, 0, 0, 0, 0, 2650, 0, 0, 0, 0, 0, 910, 0, 0, 910, 0, 910, 915, 0, 913, 0, 910, 0, 0, 0, 5495, 918, 909, 0, 909, 913, 0, 0, 0, 0, 0, 0, 0, 0, 917, 2652, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 917, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 918, 0, 910, 0, 0, 0, 913, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 913, 913, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 912, 912, 0, 2580, 0, 0, 913, 913, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 916, 910, 0, 910, 0, 0, 915, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 915, 0, 0, 0, 1102, 0, 909, 912, 0, 0, 1102, 0, 0, 912, 0, 0, 915, 2580, 0, 0, 0, 917, 1102, 907, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 955, 957, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 1018, 0, 0, 0, 0, 0, 0, 1028, 0, 0, 0, 909, 0, 0, 0, 0, 0, 913, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 4891, 909, 4892, 0, 0, 0, 0, 0, 0, 910, 0, 2642, 0, 0, 0, 4899, 916, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 4905, 2644, 0, 0, 4908, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 4921, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 4947, 0, 915, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 917, 4951, 0, 0, 0, 0, 0, 0, 0, 4955, 0, 0, 0, 0, 0, 909, 917, 907, 0, 0, 0, 0, 907, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 4990, 0, 0, 0, 4994, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 5004, 5005, 5006, 5007, 0, 0, 0, 0, 0, 0, 5011, 5012, 5013, 5014, 909, 0, 0, 0, 910, 5016, 5017, 0, 912, 0, 0, 5024, 5025, 0, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 0, 0, 0, 0, 909, 0, 2646, 0, 0, 5042, 0, 2647, 0, 5045, 5046, 5047, 5048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 916, 0, 0, 2648, 2314, 0, 4323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5068, 0, 0, 0, 0, 912, 0, 2649, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 910, 0, 0, 918, 5149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 910, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 4323, 0, 0, 0, 0, 912, 0, 5174, 0, 5175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 916, 0, 0, 912, 0, 916, 916, 0, 1744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 5201, 2652, 0, 912, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 0, 1088, 0, 1091, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 915, 0, 0, 1119, 0, 909, 0, 0, 0, 1123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 915, 0, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 5697, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 907, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 910, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 5334, 5335, 5336, 0, 910, 917, 5337, 5338, 5339, 5340, 0, 0, 2645, 5342, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 913, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 917, 0, 912, 0, 909, 912, 0, 912, 0, 0, 0, 0, 912, 0, 0, 0, 0, 907, 5375, 5376, 5377, 5378, 5379, 0, 5381, 5382, 0, 0, 0, 915, 0, 0, 0, 917, 0, 913, 5391, 5392, 0, 0, 915, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 915, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 5398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 912, 913, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 1621, 1622, 0, 0, 0, 915, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 915, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 915, 915, 0, 0, 0, 198, 0, 912, 907, 912, 0, 0, 0, 5461, 0, 0, 0, 1848, 909, 0, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 1860, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 1882, 1883, 917, 0, 0, 0, 907, 0, 0, 0, 200, 0, 0, 917, 0, 5512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1920, 0, 201, 917, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 0, 0, 0, 0, 0, 5528, 909, 0, 0, 0, 0, 0, 204, 1958, 1960, 0, 0, 0, 0, 0, 2652, 205, 3009, 913, 0, 0, 0, 0, 915, 0, 917, 0, 0, 912, 206, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 917, 0, 208, 917, 917, 910, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 912, 0, 0, 0, 0, 0, 209, 0, 0, 0, 0, 0, 907, 0, 0, 0, 0, 0, 917, 917, 909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 913, 0, 0, 659, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 211, 0, 912, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 916, 0, 6054, 0, 0, 912, 0, 909, 910, 0, 0, 0, 2120, 5645, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 212, 0, 912, 0, 0, 0, 0, 5655, 0, 0, 0, 0, 2642, 5661, 5662, 0, 0, 0, 0, 0, 0, 0, 2643, 5673, 3088, 0, 0, 213, 0, 2644, 5675, 0, 3105, 0, 913, 0, 910, 214, 215, 0, 3009, 216, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 917, 0, 913, 2645, 0, 907, 910, 0, 0, 0, 907, 907, 0, 5727, 5728, 0, 0, 217, 0, 0, 218, 0, 0, 0, 219, 0, 5736, 220, 5738, 0, 0, 0, 913, 3163, 221, 0, 0, 222, 0, 0, 0, 0, 912, 5752, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 0, 0, 0, 223, 0, 0, 3009, 0, 0, 0, 0, 224, 0, 0, 4323, 0, 225, 0, 226, 0, 0, 227, 0, 0, 910, 0, 228, 0, 0, 0, 0, 0, 5792, 0, 0, 0, 229, 0, 0, 0, 912, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 2646, 232, 0, 907, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 968, 978, 0, 0, 0, 0, 0, 0, 968, 0, 978, 968, 2649, 0, 0, 0, 0, 0, 0, 5857, 0, 0, 0, 0, 978, 0, 0, 907, 0, 2828, 0, 0, 0, 0, 910, 0, 909, 0, 0, 0, 0, 0, 0, 5874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2873, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 909, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 5934, 0, 913, 0, 0, 913, 0, 913, 2643, 0, 0, 0, 913, 0, 0, 2644, 0, 0, 0, 0, 0, 2963, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 2989, 2990, 2991, 2992, 913, 0, 0, 2652, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 4323, 0, 0, 910, 5984, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 909, 0, 0, 6020, 0, 912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6044, 0, 0, 0, 915, 0, 0, 0, 915, 915, 0, 0, 0, 0, 2646, 0, 0, 0, 2580, 2647, 0, 913, 0, 913, 6066, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 6065, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 3046, 3047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 3064, 915, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3107, 3108, 3109, 3110, 0, 0, 0, 912, 910, 0, 0, 2381, 0, 0, 915, 909, 0, 913, 0, 0, 909, 909, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 0, 912, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3184, 0, 0, 0, 0, 0, 3188, 0, 913, 0, 0, 0, 0, 0, 0, 6203, 917, 0, 978, 0, 917, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 2652, 978, 0, 0, 0, 0, 6216, 0, 0, 0, 0, 909, 0, 978, 0, 0, 0, 6226, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 978, 2122, 2123, 2124, 917, 913, 0, 0, 0, 0, 917, 910, 0, 0, 968, 978, 910, 910, 0, 2642, 0, 968, 0, 978, 968, 0, 0, 913, 907, 2643, 0, 0, 0, 0, 0, 0, 2644, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 913, 909, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 2580, 0, 0, 912, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 6088, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 6305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3374, 0, 0, 0, 0, 910, 0, 978, 0, 0, 0, 0, 0, 3535, 0, 0, 913, 0, 0, 0, 915, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 3551, 978, 0, 0, 3554, 0, 0, 0, 3557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 912, 2647, 0, 0, 3576, 0, 0, 0, 0, 913, 0, 0, 0, 0, 910, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 913, 978, 0, 0, 3618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 912, 0, 0, 0, 0, 1102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 917, 0, 915, 0, 0, 0, 0, 915, 0, 0, 0, 0, 2381, 3677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 2120, 915, 0, 2121, 3706, 0, 0, 2122, 2123, 2124, 3715, 0, 0, 0, 0, 0, 0, 6447, 0, 0, 0, 0, 0, 0, 3725, 2642, 1831, 0, 912, 0, 0, 1102, 0, 978, 3738, 2643, 0, 917, 0, 0, 3743, 917, 2644, 0, 968, 0, 0, 0, 968, 0, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3756, 913, 720, 0, 0, 0, 3759, 721, 2645, 0, 0, 0, 0, 3767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3782, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3808, 0, 0, 0, 722, 0, 0, 0, 0, 0, 0, 1102, 0, 0, 0, 0, 0, 723, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 912, 0, 0, 0, 725, 0, 913, 0, 978, 0, 0, 0, 917, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 726, 0, 0, 0, 0, 0, 913, 0, 0, 2646, 0, 0, 0, 727, 2647, 0, 0, 2580, 0, 917, 0, 0, 728, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 729, 0, 2648, 2314, 6311, 0, 730, 0, 978, 0, 0, 0, 0, 731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 2649, 0, 0, 732, 915, 0, 0, 915, 0, 915, 0, 978, 0, 0, 915, 909, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 3374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 912, 2650, 0, 0, 2651, 0, 733, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 4036, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4052, 734, 0, 0, 0, 0, 0, 4036, 0, 0, 0, 0, 912, 0, 735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 977, 736, 913, 0, 0, 0, 0, 0, 0, 977, 0, 214, 737, 0, 0, 738, 978, 0, 0, 0, 0, 0, 2652, 977, 978, 978, 0, 0, 0, 0, 910, 0, 0, 0, 0, 915, 0, 915, 0, 0, 0, 0, 0, 739, 0, 0, 740, 0, 0, 0, 741, 0, 0, 742, 0, 0, 0, 0, 0, 0, 743, 0, 0, 744, 0, 0, 917, 0, 0, 917, 0, 917, 0, 3601, 0, 0, 917, 1831, 2120, 0, 0, 2121, 0, 745, 0, 2122, 2123, 2124, 0, 0, 0, 746, 0, 0, 0, 0, 0, 0, 747, 0, 0, 748, 0, 2642, 0, 912, 749, 0, 0, 0, 0, 0, 0, 2643, 750, 0, 751, 0, 917, 0, 2644, 752, 0, 0, 0, 0, 917, 0, 2580, 0, 0, 0, 0, 915, 0, 753, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2645, 0, 754, 0, 6328, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 915, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 3750, 0, 0, 3753, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 917, 0, 917, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 0, 0, 2646, 912, 912, 0, 0, 2647, 0, 2645, 0, 915, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3848, 0, 0, 4315, 0, 0, 0, 0, 915, 0, 0, 2649, 0, 3861, 0, 0, 0, 978, 0, 917, 0, 3870, 0, 913, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 2642, 0, 0, 2381, 0, 0, 0, 0, 0, 3914, 2643, 0, 917, 0, 0, 0, 0, 2644, 2650, 912, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 2646, 3938, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 917, 0, 0, 2645, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 4400, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 3993, 0, 3995, 0, 0, 0, 0, 0, 978, 0, 0, 0, 2649, 0, 912, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 915, 2120, 0, 0, 2121, 0, 0, 917, 2122, 2123, 2124, 0, 0, 977, 2652, 1831, 0, 0, 0, 977, 0, 0, 0, 0, 0, 915, 2642, 2381, 0, 917, 3501, 977, 2120, 0, 0, 2121, 2643, 0, 978, 2122, 2123, 2124, 2650, 2644, 0, 2651, 978, 977, 0, 0, 0, 917, 0, 0, 978, 0, 0, 2642, 0, 0, 2646, 0, 977, 0, 4060, 2647, 0, 2643, 0, 2645, 977, 4067, 0, 4782, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 913, 0, 2648, 2314, 0, 4495, 0, 0, 977, 968, 968, 0, 978, 978, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 968, 0, 978, 968, 0, 0, 2649, 0, 0, 0, 2580, 3502, 0, 0, 0, 978, 978, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 2652, 0, 0, 6387, 917, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 4783, 2381, 0, 0, 0, 0, 0, 968, 0, 0, 0, 968, 968, 915, 0, 0, 2650, 0, 0, 2651, 0, 977, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 4149, 0, 917, 0, 0, 0, 4150, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 2646, 0, 917, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 0, 2649, 0, 2580, 2648, 2314, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 915, 977, 0, 0, 0, 3009, 2652, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 1831, 0, 0, 0, 0, 0, 915, 0, 0, 0, 913, 0, 4682, 0, 2650, 0, 4686, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 2580, 0, 0, 0, 0, 0, 977, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 3033, 2652, 0, 4319, 4320, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 2642, 0, 4151, 2122, 2123, 2124, 0, 0, 915, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 0, 917, 0, 0, 3503, 0, 2644, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 915, 917, 0, 0, 2645, 0, 0, 0, 0, 912, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 977, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6157, 0, 0, 0, 0, 0, 0, 0, 977, 0, 913, 0, 0, 0, 0, 913, 913, 0, 0, 0, 0, 0, 0, 0, 977, 0, 2646, 0, 0, 0, 4898, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 977, 2646, 0, 0, 0, 0, 2647, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 4503, 0, 0, 0, 0, 0, 0, 915, 2120, 0, 0, 2121, 2649, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 0, 917, 0, 0, 0, 2642, 2381, 0, 0, 0, 913, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 2650, 2644, 0, 2651, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 2645, 0, 6158, 0, 5023, 0, 0, 5026, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 977, 977, 0, 0, 0, 0, 0, 0, 0, 0, 913, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4656, 0, 0, 0, 915, 0, 0, 2652, 0, 0, 0, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5108, 0, 915, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 3009, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 978, 0, 0, 2649, 978, 2580, 0, 0, 0, 0, 0, 915, 0, 978, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 4086, 2580, 0, 978, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 968, 2381, 968, 968, 0, 4036, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 2650, 978, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 978, 978, 0, 4122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 4154, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 917, 0, 2644, 0, 0, 0, 0, 1831, 978, 0, 0, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 915, 0, 917, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 978, 0, 1831, 0, 977, 0, 978, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 978, 0, 0, 978, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 917, 0, 0, 978, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 1831, 0, 0, 0, 0, 0, 978, 0, 0, 2646, 0, 0, 0, 0, 2647, 2580, 0, 977, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 915, 0, 1377, 1377, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 917, 0, 5380, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 977, 5390, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, -136, 0, 0, 0, 0, 1377, 0, 0, 0, 0, 913, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 1, 0, 0, 0, 0, 977, 977, 0, 0, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 977, 977, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 5065, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 5067, 0, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 2652, 0, 0, 978, 0, 1831, 14, 0, 917, 15, 0, 0, 0, 0, 0, 0, 1741, 1745, 0, 0, 0, 0, 978, 0, 16, 0, 17, 0, 0, 978, 18, 0, 0, 0, 0, 0, 968, 19, 968, 968, 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 917, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4036, 0, 0, 0, 1830, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 1831, 0, 0, 0, 0, 0, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 915, 27, 0, 0, 0, 915, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 1057, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1058, 978, 0, 0, 4036, 0, 4036, 30, 0, 981, 0, 0, 0, 723, 1059, 0, 31, 0, 0, 0, 0, 1015, 0, 0, 0, 0, 1060, 0, 0, 0, 724, 32, 1034, 0, 0, 0, 0, 33, 34, 0, 35, 0, 0, 0, 0, 36, 2064, 0, 1061, 0, 0, 37, 915, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, 1062, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 727, 0, 0, 2090, 0, 0, 44, 0, 0, 728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 729, 45, 0, 0, 0, 0, 1063, 0, 0, 0, 2109, 2110, 2111, 915, 2113, 0, 0, 978, 978, 0, 0, 917, 46, 0, 0, 0, 917, 917, 0, 0, 0, 0, 0, 1064, 47, 2598, 0, 0, 978, 0, 48, 978, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 1065, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 51, 0, 52, 53, 54, 55, 56, 0, 0, 0, 2642, 733, 0, 0, 0, 0, 0, 0, 0, 57, 2643, 0, -136, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1831, 1831, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5406, 2645, 0, 1066, 2694, 0, 917, 0, 2706, 2711, 0, 0, 0, 978, 0, 5410, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 736, 0, 978, 0, 0, 0, 0, 0, 0, 0, 214, 1067, 2642, 0, 738, 4166, 0, 0, 0, 0, 0, 0, 2643, 0, 978, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 917, 1069, 0, 0, 0, 741, 0, 0, 742, 0, 0, 2645, 0, 0, 0, 743, 0, 0, 744, 0, 0, 0, 0, 0, 0, 0, 4159, 0, 0, 0, 0, 0, 5468, 0, 0, 0, 0, 0, 745, 0, 0, 0, 0, 0, 0, 2646, 1070, 0, 0, 0, 2647, 0, 0, 747, 0, 0, 1071, 0, 0, 0, 0, 749, 0, 0, 0, 0, 0, 0, 0, 1072, 978, 751, 0, 2648, 2314, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 754, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 1831, 0, 0, 0, 0, 0, 978, 0, 978, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 978, 0, 978, 0, 0, 0, 2381, 0, 0, 0, 0, 1054, 0, 0, 0, 0, 0, 1086, 0, 2648, 2314, 2650, 0, 0, 2651, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1741, 1741, 1741, 0, 0, 977, 0, 0, 2649, 977, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 977, 978, 0, 0, 0, 0, 2642, 5631, 2652, 5633, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 977, 977, 0, 2644, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 978, 0, 1830, 977, 0, 0, 1830, 0, 0, 0, 0, 0, 915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1402, 0, 0, 977, 0, 1830, 0, 0, 0, 977, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 1425, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 977, 0, 2580, 977, 0, 0, 0, 0, 0, 977, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 5757, 0, 977, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 4036, 0, 1831, 0, 0, 0, 2646, 977, 0, 0, 0, 2647, 1483, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 977, 0, 2648, 2314, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 1620, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 720, 3275, 0, 917, 0, 2797, 0, 2381, 0, 0, 3292, 3292, 3292, 3292, 3302, 3308, 3292, 3311, 3292, 3292, 0, 0, 2650, 0, 3318, 2651, 3319, 0, 3321, 0, 0, 3335, 3338, 3343, 0, 0, 0, 0, 0, 3352, 0, 0, 3357, 2798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 723, 3364, 3365, 3366, 0, 0, 0, 0, 978, 0, 0, 0, 5889, 0, 5891, 0, 0, 724, 0, 3367, 1880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1914, 1917, 1918, 0, 0, 0, 0, 0, 0, 0, 2799, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 1831, 0, 727, 0, 0, 1831, 0, 1831, 0, 0, 2120, 728, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 729, 977, 0, 1830, 0, 4713, 2800, 0, 0, 1831, 0, 2642, 0, 0, 4789, 0, 0, 0, 0, 0, 977, 2643, 0, 0, 0, 0, 0, 977, 2644, 0, 0, 0, 0, 1064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 978, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 1402, 0, 0, 0, 0, 0, 3375, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 733, 0, 0, 0, 0, 0, 1402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 3394, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 2801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 214, 2802, 978, 2647, 738, 0, 0, 0, 3396, 0, 0, 0, 6102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 1068, 0, 0, 2803, 0, 0, 0, 0, 0, 977, 742, 0, 0, 0, 0, 0, 0, 743, 0, 0, 744, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 745, 0, 0, 0, 0, 0, 2636, 0, 1070, 0, 0, 0, 0, 0, 0, 747, 0, 0, 1071, 0, 0, 0, 0, 749, 0, 2381, 978, 0, 0, 1831, 0, 2804, 0, 0, 0, 0, 0, 0, 2805, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6209, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 2727, 0, 0, 0, 0, 0, 977, 977, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2643, 2591, 977, 0, 0, 977, 0, 2644, 0, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 0, 3412, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 1377, 0, 1741, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 2840, 0, 0, 0, 0, 0, 0, 0, 0, 2869, 0, 3367, 0, 0, 0, 3375, 0, 0, 3394, 0, 3396, 0, 0, 3449, 0, 0, 0, 1830, 1830, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 6299, 0, 0, 2907, 0, 0, 0, 0, 0, 2919, 2919, 0, 0, 2919, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2937, 0, 0, 2940, 0, 1119, 1119, 977, 0, 2580, 0, 0, 2110, 2111, 978, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 2646, 977, 0, 0, 0, 2647, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 2993, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 978, 3013, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 978, 2649, 0, 2120, 0, 0, 2121, 0, 3579, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 0, 978, 0, 977, 0, 2643, 0, 0, 0, 0, 0, 2381, 2644, 1119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 5229, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 977, 0, 977, 0, 0, 0, 0, 0, 0, 0, 3035, 0, 0, 0, 0, 977, 0, 977, 0, 0, 0, 3038, 0, 1831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5239, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 3082, 2919, 0, 0, 2652, 0, 0, 2591, 0, 0, 0, 2591, 5246, 0, 0, 0, 0, 2648, 2314, 0, 0, 977, 0, 0, 0, 3117, 0, 0, 0, 0, 0, 0, 3130, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 2120, 0, 2649, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 2648, 2314, 0, 2642, 0, 0, 0, 0, 0, 0, 0, 978, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 2381, 0, 0, 0, 977, 2649, 0, 0, 977, 0, 3834, 3835, 1741, 0, 0, 2650, 3839, 3191, 2651, 0, 2727, 0, 2580, 2645, 0, 0, 0, 0, 0, 977, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 3868, 0, 0, 0, 0, 2381, 0, 0, 0, 1402, 1402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 3247, 0, 0, 3249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 978, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5245, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 1830, 2122, 2123, 2124, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 978, 0, 2652, 0, 0, 0, 0, 0, 2643, 0, 968, 2648, 2314, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 1831, 0, 0, 0, 0, 968, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 2381, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4073, 2650, 0, 0, 2651, 4079, 0, 0, 0, 0, 0, 0, 2580, 0, 2591, 0, 0, 5247, 3331, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 2591, 2591, 2591, 0, 2591, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 3343, 2647, 3343, 3343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4169, 0, 0, 4172, 0, 4174, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 1830, 0, 1830, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 4199, 0, 4202, 0, 4204, 0, 0, 0, 2120, 0, 0, 2121, 0, 1830, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 2650, 0, 0, 2651, 0, 0, 0, 977, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 2645, 0, 0, 2580, 0, 0, 0, 0, 0, 978, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 4274, 0, 0, 0, 0, 2694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1831, 0, 2711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 2652, 0, 0, 977, 977, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 977, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 4309, 0, 2120, 2644, 0, 2121, 0, 977, 0, 2122, 2123, 2124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 2642, 1831, 2645, 5823, 0, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4344, 0, 0, 0, 1831, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 3432, 0, 0, 2649, 0, 0, 0, 0, 2580, 0, 3437, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 977, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 1483, 0, 0, 0, 0, 0, 0, 2381, 0, 5806, 0, 0, 0, 0, 0, 1831, 0, 0, 978, 0, 0, 0, 2650, 0, 0, 2651, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 1483, 1483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2646, 0, 0, 0, 0, 2647, 1402, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 2381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1741, 2650, 0, 0, 2651, 0, 1741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2650, 978, 0, 2651, 0, 0, 0, 0, 0, 0, 5613, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 977, 0, 0, 0, 3646, 0, 0, 2591, 0, 0, 0, 0, 2591, 2580, 0, 0, 0, 0, 0, 3668, 4577, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 2652, 0, 0, 0, 0, 0, 968, 968, 3696, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 0, 2122, 2123, 2124, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 2642, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 2643, 0, 0, 0, 0, 0, 0, 2644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2645, 0, 0, 0, 0, 0, 978, 0, 0, 0, 0, 0, 0, 0, 3776, 3777, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4714, 2580, 1830, 0, 0, 0, 0, 0, 0, 4718, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 0, 0, 977, 0, 3292, 0, 0, 0, 4731, 3292, 3292, 0, 0, 0, 0, 3308, 0, 0, 4739, 0, 0, 4741, 0, 0, 0, 0, 0, 4743, 0, 4744, 0, 3902, 0, 2646, 0, 0, 0, 0, 2647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4766, 4767, 4768, 0, 0, 2648, 2314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3352, 0, 0, 0, 0, 1831, 0, 0, 4792, 0, 0, 4795, 0, 4797, 2649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 4801, 0, 0, 0, 0, 0, 0, 0, 4808, 4809, 0, 0, 0, 0, 0, 4814, 0, 0, 0, 0, 0, 671, 0, 0, 0, 0, 0, 0, 2381, 0, 0, 0, 0, 0, 0, 1831, 0, 0, 0, 672, 0, 0, 0, 2650, 3292, 0, 2651, 0, 968, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1831, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -886, 4868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 675, 0, 0, 977, 0, 977, 676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 677, 0, 0, 0, 2652, 0, 0, 0, 0, 0, 0, 0, 0, 678, 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 681, 0, 0, 0, 682, 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, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 683, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, -621, 0, 0, 0, 0, 0, 0, 0, 0, 4220, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 1483, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 2591, 684, 0, 2591, 685, 0, 0, 0, 0, 0, 2591, 2591, 0, 2591, 0, 0, 0, 0, 3331, 3331, 0, 4145, 0, 3331, 0, 0, 0, 2591, 686, 0, 2591, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 687, 0, 2591, 0, 0, 0, 0, 2591, -471, 0, 0, 0, 0, 0, 2591, 2591, 2591, 2591, 0, 0, 0, 0, 3331, 3331, 0, 2591, 0, 0, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 689, 0, 0, 0, 0, 0, 2591, -471, 2591, 0, 690, 0, 0, 0, 0, 2591, 2591, 2591, 2591, 2591, 2591, 2591, 2591, 2591, 2591, 0, 0, 0, 0, 0, 691, 0, 0, 5156, 5157, 0, 0, 0, 692, 0, 0, 0, 0, 0, 5164, -471, 0, 0, 693, 0, 694, 0, 695, 696, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 697, 0, 977, 0, 0, 0, 0, 0, 698, 0, 0, 699, 0, 0, 700, 0, 977, 0, 0, 5189, 0, 0, 0, 0, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5241, 0, 0, 0, 0, 0, 0, 4423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 1, 0, 0, 0, 0, 0, 1830, 0, 5260, 5262, 0, 2, 0, 3, 4, 5266, 5267, 0, 0, 0, 5268, 0, 0, 0, 0, 5269, 0, 0, 5272, 5273, 0, 0, 0, 0, 0, 5278, 0, 0, 0, 0, 0, 6, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 5313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1377, 0, 5320, 0, 0, 14, 0, 0, 15, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 977, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 5767, 0, 0, 0, 0, 0, 5345, 0, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 4554, 4555, 4556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 4565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4590, 4592, 0, 0, 0, 4597, 0, 0, 0, 0, 0, 0, 0, 0, 5394, 0, 0, 0, 0, 0, 0, 5396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 2591, 977, 28, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 2591, 0, 5431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 1402, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 33, 34, 0, 35, 0, 0, 0, 0, 36, 0, 0, 4628, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 3292, 0, 48, 0, 0, 0, 0, 49, 0, 0, 5547, 0, 0, 0, 0, 0, 5551, 5552, 5553, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4821, 4822, 4823, 0, 0, 2591, 5566, 5567, 0, 51, 5568, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5576, 57, 0, 0, -136, 0, 0, 0, 0, 0, 5588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4145, 4145, 0, 0, 3331, 3331, 3331, 3331, 0, 0, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 4145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 2591, 0, 0, 2591, 0, 2591, 0, 0, 4145, 4145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 3331, 3331, 2591, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5796, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5869, 0, 0, 0, 0, 0, 0, 3130, 0, 0, 0, 0, 0, 0, 0, 0, 5881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5918, 3191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6004, 0, 0, 0, 0, 0, 0, 0, 0, 6011, 6011, 6011, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5606, 0, 0, 0, 0, 0, 0, 0, 6040, 0, 0, 0, 0, 0, 0, 0, 0, 5282, 5283, 5284, 5285, 0, 0, 0, 0, 0, 0, 6055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 2591, 0, 2591, 2591, 0, 0, 0, 0, 4145, 4145, 4145, 4145, 0, 0, 0, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 2591, 2591, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 2591, 0, 2591, 0, 0, 0, 2591, 0, 0, 4145, 4145, 0, 0, 2591, 2591, 0, 0, 6011, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4145, 0, 6011, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 2591, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1741, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 3331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 2591, 0, 0, 0, 2591, 2591, 2591, 2591, 0, 0, 2591, 2591, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5711, 0, 0, 3331, 0, 1402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 5741, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 4145, 3331, 2591, 2591, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 2591, 2591, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 5941, 0, 3331, 0, 0, 4145, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 5964, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4145, 0, 3331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3331, 3331, 0, 0, 3331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4145, 4145, 0, 4145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1735, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 2591, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 1736, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 1737, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 1738, 0, 0, 0, 0, 0, 0, 1364, 1739, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 1208, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 0, 0, 0, 0, 1364, 5842, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 0, 0, 0, 0, 1364, 3333, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 0, 0, 0, 0, 1364, 4745, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 0, 0, 0, 0, 1364, 4811, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4251, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, -1838, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, -1838, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, -1838, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, -1838, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, -1838, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1838, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, -1838, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1476, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2736, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2737, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2739, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 2741, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 2834, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2736, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2737, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2739, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 2741, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 646, 647, 648, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 3957, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 3294, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 1208, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 1208, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 3339, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 3340, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 3341, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 3342, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2269, 245, 246, 247, 0, 0, 0, -2269, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, -2269, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, -2267, 245, 246, 247, 0, 0, 0, -2267, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, -2267, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 0, 0, 2061, 3268, 1364, 235, 0, 1280, 715, 0, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 1363, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2704, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 3294, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 3836, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 3340, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 3397, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2707, 2708, 0, 0, 0, 235, 0, 3516, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 4867, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 5249, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 5261, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 5596, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 5597, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 5598, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 5599, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 6008, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6009, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 6010, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6009, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 6010, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 5581, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3325, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3326, 3327, 0, 0, 0, 235, 0, 1280, 715, 3328, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, -2992, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 6009, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 1304, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, -2992, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 0, 0, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, -2992, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 1331, 460, 461, 0, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 1339, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, -2992, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 6010, 607, 608, 609, 0, 1349, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, -2992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 1362, 0, 0, 0, 235, 0, 1280, 715, 1364, 1281, 1282, 1283, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 1335, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3325, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3326, 3327, 235, 0, 1280, 715, 0, 1281, 1282, 3328, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3505, 3506, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3507, 3508, 235, 0, 1280, 715, 0, 1281, 1282, 3328, 777, 1284, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3325, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 1280, 715, 0, 1281, 1282, 0, 777, 1284, 0, 0, 0, 0, 0, 0, 3328, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 4776, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3325, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 1280, 715, 0, 1281, 1282, 0, 777, 1284, 0, 0, 0, 0, 0, 0, 3328, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 1285, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 1289, 1290, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 1305, 343, 344, 345, 346, 1306, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 1310, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 1332, 1333, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 3325, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 1346, 599, 1347, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 4836, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3328, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 3477, 1323, 412, 413, 414, 415, 416, 417, 418, 3478, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3479, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 1208, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 3480, 646, 647, 648, 0, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3481, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 3477, 1323, 412, 413, 414, 415, 416, 417, 418, 3478, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3479, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 3480, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3481, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3915, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 3477, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 3479, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 3480, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4911, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 969, 0, 1613, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 0, 0, 0, 6112, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 5896, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 969, 0, 0, 0, 0, 0, 0, 1614, 1615, 5897, 0, 0, 0, 0, 0, 0, 5898, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 3, 4, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 45, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 1208, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1048, 0, 0, 51, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5647, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 41, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 45, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 1208, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 50, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 51, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2913, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2914, 2915, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1870, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1424, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4015, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4213, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2119, 0, 0, 0, 0, 0, 0, 2120, 0, 0, 2121, 0, 0, 4853, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 0, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 0, 0, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 0, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 0, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 0, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 0, 0, 2264, 2265, 2266, 2267, 0, 2268, 2269, 2270, 2271, 2272, 0, 2273, 2274, 2275, 2276, 2277, 0, 2278, 2279, 0, 2280, 2281, 2282, 0, 2283, 2284, 0, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 0, 2311, 0, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 0, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 0, 2359, 2360, 0, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 0, 2390, 2391, 2392, 0, 2393, 2394, 2395, 2396, 2397, 0, 2398, 2399, 2400, 2401, 0, 0, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 0, 2414, 2415, 2416, 2417, 2418, 2419, 0, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 0, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 0, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 0, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 0, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 0, 2556, 2557, 2558, 2559, 2560, 2561, 0, 2562, 0, 0, 0, 0, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 0, 2578, 2579, 0, 2580, 0, 0, 0, 0, 0, 0, 0, 0, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 881, 0, 1613, 715, 0, 0, 0, 984, 777, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 885, 886, 275, 1760, 276, 277, 278, 279, 0, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 887, 888, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 889, 328, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 1779, 348, 1780, 349, 350, 351, 890, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 0, 1785, 0, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 0, 389, 390, 391, 392, 891, 892, 1789, 893, 1790, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 0, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 4521, 0, 459, 1796, 460, 461, 462, 463, 1797, 0, 465, 897, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 4522, 474, 475, 1801, 1802, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 0, 498, 0, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 901, 902, 1814, 1815, 596, 597, 0, 599, 0, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 0, 903, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 4523, 4524, 995, 996, 997, 998, 881, 0, 1613, 715, 0, 0, 0, 984, 777, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 885, 886, 275, 1760, 276, 277, 278, 279, 0, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 887, 888, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 889, 328, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 1779, 348, 1780, 349, 350, 351, 890, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 0, 1785, 0, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 0, 389, 390, 391, 392, 891, 892, 1789, 893, 1790, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 0, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 4982, 0, 459, 1796, 460, 461, 462, 463, 1797, 0, 465, 897, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 4522, 474, 475, 1801, 1802, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 0, 498, 0, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 901, 902, 1814, 1815, 596, 597, 0, 599, 0, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 0, 903, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 4523, 4524, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 988, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 989, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1105, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1106, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1171, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1172, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1173, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 1853, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 1854, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 3594, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 3595, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 656, 0, 0, 0, 0, 0, 0, 984, 0, 0, 0, 0, 0, 0, 985, 986, 987, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 5629, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 0, 0, 1747, 0, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 994, 995, 996, 997, 998, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 273, 274, 275, 1760, 276, 277, 278, 279, 280, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 327, 328, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1779, 348, 1780, 349, 350, 351, 352, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 364, 1785, 365, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1789, 395, 1790, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 420, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 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, 1796, 460, 461, 462, 463, 1797, 464, 465, 466, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 473, 474, 475, 1801, 1802, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 594, 595, 1814, 1815, 596, 597, 598, 599, 600, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 620, 621, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1826, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 870, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6080, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6082, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6212, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2736, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2737, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 2738, 476, 477, 2739, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 2741, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 3952, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2742, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2736, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2737, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 2738, 476, 477, 2739, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 2741, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 969, 0, 1613, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 0, 0, 2742, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2628, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 1613, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 1614, 1615, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2633, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 1613, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 1614, 1615, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 3561, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 1613, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 1614, 1615, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 777, 0, 0, 0, 0, 1614, 1615, 0, 0, 236, 237, 778, 239, 240, 241, 242, 243, 244, 779, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 780, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 781, 352, 353, 0, 354, 0, 355, 782, 0, 783, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 784, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 785, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 786, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 787, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 788, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 789, 790, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 3, 4, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1048, 1747, 0, 6402, 715, 0, 0, 0, 0, 777, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 273, 274, 275, 1760, 276, 277, 278, 279, 280, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 327, 328, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1779, 348, 1780, 349, 350, 351, 352, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 364, 1785, 365, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1789, 395, 1790, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 420, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 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, 1796, 460, 461, 462, 463, 1797, 464, 465, 466, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 473, 474, 475, 1801, 1802, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 594, 595, 1814, 1815, 596, 597, 598, 599, 600, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 620, 621, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 273, 274, 275, 1760, 276, 277, 278, 279, 280, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 327, 328, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1779, 348, 1780, 349, 350, 351, 352, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 364, 1785, 365, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1789, 395, 1790, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 420, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 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, 1796, 460, 461, 462, 463, 1797, 464, 465, 466, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 473, 474, 475, 1801, 1802, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 594, 595, 1814, 1815, 596, 597, 598, 599, 600, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 620, 621, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 1747, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 3669, 242, 243, 244, 1748, 245, 246, 247, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 248, 249, 250, 1756, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 1757, 264, 265, 266, 267, 268, 269, 270, 1758, 1759, 271, 272, 273, 274, 275, 1760, 276, 277, 278, 279, 280, 1761, 281, 1762, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 1763, 293, 294, 295, 296, 297, 298, 1764, 299, 300, 301, 302, 1765, 1766, 1767, 303, 1768, 1769, 1770, 304, 305, 306, 307, 308, 309, 310, 311, 312, 1771, 313, 1772, 314, 315, 316, 317, 318, 319, 320, 1773, 321, 322, 323, 324, 1774, 1775, 325, 326, 327, 3670, 329, 1776, 330, 331, 332, 333, 1777, 334, 335, 336, 337, 1778, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1779, 348, 1780, 349, 350, 351, 352, 353, 1781, 354, 1782, 355, 356, 357, 1783, 358, 359, 360, 361, 362, 1784, 363, 364, 1785, 365, 366, 367, 1786, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 1787, 378, 379, 380, 381, 382, 383, 384, 385, 1788, 386, 387, 388, 389, 390, 391, 392, 393, 394, 1789, 395, 1790, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 1791, 1792, 419, 420, 421, 422, 423, 1793, 424, 425, 426, 1794, 1795, 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, 1796, 460, 461, 462, 463, 1797, 464, 465, 466, 467, 468, 469, 1798, 470, 471, 472, 1799, 1800, 473, 474, 475, 1801, 1802, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 1803, 494, 495, 496, 497, 498, 499, 500, 501, 502, 1804, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1805, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 1806, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 1807, 551, 552, 553, 554, 555, 1808, 3671, 557, 558, 559, 560, 561, 562, 563, 564, 565, 1809, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 1810, 583, 584, 1811, 1812, 585, 586, 587, 588, 589, 590, 591, 592, 1813, 593, 594, 595, 1814, 1815, 596, 597, 598, 599, 600, 1816, 601, 602, 603, 604, 605, 606, 607, 608, 609, 1817, 1818, 610, 611, 612, 613, 614, 1819, 1820, 615, 616, 617, 618, 619, 620, 621, 1821, 622, 623, 624, 625, 626, 627, 1822, 1823, 628, 1824, 1825, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 1290, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 1293, 0, 1294, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 1306, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 1309, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 3476, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 410, 1323, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 1324, 421, 422, 423, 0, 424, 425, 426, 1325, 1326, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 1327, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 1330, 459, 0, 460, 461, 462, 463, 0, 1333, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 1336, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 1337, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 1340, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 1342, 582, 0, 583, 584, 1343, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 1346, 599, 1347, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 1350, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 1352, 1353, 1354, 1355, 640, 1356, 1357, 1358, 1359, 645, 646, 647, 648, 235, 0, 1280, 715, 0, 1281, 1282, 0, 777, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 1286, 261, 1287, 1288, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 1291, 1292, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 1302, 1303, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1307, 348, 0, 349, 350, 351, 1308, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 1311, 1312, 0, 1313, 0, 396, 397, 398, 399, 400, 6376, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 1328, 447, 1329, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 462, 463, 1332, 464, 465, 1334, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 1338, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 1341, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 1344, 1345, 0, 0, 596, 597, 598, 599, 600, 1348, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 1351, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1008, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1029, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1030, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3007, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 4033, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 1836, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 1837, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 1838, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1124, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1166, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1179, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 970, 303, 0, 0, 971, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1191, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 1192, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 972, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 2613, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1150, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1163, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1177, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1181, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 421, 422, 423, 0, 424, 425, 426, 0, 0, 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, 0, 460, 461, 462, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2841, 276, 277, 278, 279, 280, 0, 0, 2842, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2843, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2844, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2845, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 2846, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2847, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2848, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2841, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2843, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2844, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2845, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 3886, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2847, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2848, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 796, 245, 797, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 798, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 832, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 799, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 800, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 796, 245, 797, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 798, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 3568, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 799, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 800, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 2841, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 2843, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 2844, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2845, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 2847, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 2848, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 796, 245, 797, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 798, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 799, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 800, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3083, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2913, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2914, 2915, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 2016, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 2017, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 2018, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 2019, 355, 356, 0, 0, 0, 2020, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 2021, 2022, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 2023, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 2024, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 2025, 539, 540, 541, 542, 543, 544, 2026, 546, 547, 548, 549, 550, 0, 2027, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2028, 585, 0, 2029, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 2030, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 797, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 798, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 799, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 800, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 2913, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 2914, 2915, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1022, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1023, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3650, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3651, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 3663, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 3664, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 657, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 706, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 707, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 824, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 825, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 826, 595, 0, 0, 827, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 858, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 859, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 860, 595, 0, 0, 861, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 979, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 980, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1142, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 824, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1250, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1399, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 1410, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 1411, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 849, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1403, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 852, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1557, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 864, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 1618, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1619, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 3425, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 3426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 3427, 585, 0, 587, 588, 3428, 590, 3429, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 3430, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 777, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4251, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 4265, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4396, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4923, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 4996, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 5356, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 816, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 822, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 845, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 846, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 849, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 850, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 852, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 876, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1004, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1014, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1017, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1033, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1090, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1095, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1112, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1115, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1117, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1155, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1183, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1185, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1195, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1198, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1201, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 849, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1403, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 852, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1879, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1913, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1915, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1955, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1957, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 1959, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 2055, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 2729, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 0, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 849, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 1403, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 2762, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 852, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2824, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 2825, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 2826, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2910, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 2825, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 2826, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 2934, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 2825, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 2826, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3128, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3132, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3190, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3573, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 844, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 847, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 848, 536, 537, 538, 539, 540, 541, 542, 543, 544, 849, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 2825, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 851, 595, 0, 0, 2826, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 853, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3631, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3653, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3655, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 3805, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 3847, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 5109, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 366, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 6341, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 0, 256, 257, 258, 259, 260, 0, 262, 263, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 273, 274, 275, 0, 276, 277, 278, 279, 280, 0, 0, 0, 282, 283, 284, 285, 286, 287, 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 0, 300, 301, 302, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310, 311, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 0, 348, 0, 349, 350, 351, 352, 353, 0, 354, 0, 355, 356, 0, 0, 0, 359, 360, 361, 362, 0, 363, 364, 0, 365, 0, 367, 0, 368, 369, 370, 371, 372, 0, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 0, 388, 389, 390, 391, 392, 393, 394, 0, 395, 0, 396, 0, 0, 399, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 420, 0, 422, 0, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 0, 460, 461, 0, 463, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 478, 0, 480, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 0, 0, 494, 495, 496, 497, 498, 499, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 0, 513, 514, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 0, 535, 536, 537, 538, 539, 540, 0, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 558, 559, 560, 0, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 0, 583, 584, 0, 0, 585, 0, 587, 588, 589, 590, 591, 592, 0, 593, 594, 595, 0, 0, 596, 597, 598, 599, 600, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 620, 621, 0, 622, 0, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 2736, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 2737, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 2739, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 2741, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 2820, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 4622, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 2900, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 4418, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 6028, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 6384, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 1157, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 1189, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 899, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 2740, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 882, 261, 883, 884, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 885, 886, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 887, 888, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 889, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 890, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 891, 892, 0, 893, 0, 396, 397, 398, 399, 400, 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 895, 447, 896, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 897, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 898, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 0, 559, 560, 561, 562, 563, 900, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 901, 902, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 903, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648, 0, 0, 0, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, 0, 0, 261, 0, 0, 0, 264, 265, 266, 267, 268, 269, 270, 0, 0, 271, 272, 0, 0, 275, 0, 276, 277, 278, 279, 0, 0, 281, 0, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 0, 299, 300, 301, 302, 0, 0, 0, 303, 0, 0, 0, 304, 305, 306, 307, 308, 309, 0, 0, 312, 0, 313, 0, 314, 315, 316, 317, 318, 319, 320, 0, 321, 322, 323, 324, 0, 0, 325, 326, 327, 328, 329, 0, 330, 331, 332, 333, 0, 334, 335, 336, 337, 0, 338, 339, 340, 341, 0, 343, 344, 345, 346, 0, 0, 348, 0, 349, 350, 351, 0, 353, 0, 354, 0, 355, 356, 357, 0, 358, 359, 360, 361, 362, 0, 363, 0, 0, 0, 366, 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, 0, 386, 387, 0, 389, 390, 391, 392, 0, 0, 0, 0, 0, 396, 397, 398, 399, 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 413, 414, 415, 416, 417, 418, 0, 0, 419, 0, 421, 422, 423, 0, 424, 425, 426, 0, 0, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 0, 447, 0, 449, 450, 451, 452, 453, 454, 455, 456, 0, 0, 459, 0, 460, 461, 462, 463, 0, 0, 465, 0, 467, 468, 469, 0, 470, 471, 472, 0, 0, 473, 474, 475, 0, 0, 476, 477, 0, 479, 480, 481, 0, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, 495, 496, 0, 498, 0, 500, 501, 502, 0, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 0, 515, 516, 517, 518, 0, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 539, 0, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 0, 551, 552, 553, 554, 555, 0, 556, 557, 0, 559, 560, 561, 562, 563, 0, 565, 0, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 0, 582, 0, 583, 584, 0, 0, 585, 586, 587, 588, 589, 590, 591, 592, 0, 593, 0, 0, 0, 0, 596, 597, 0, 599, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 609, 0, 0, 610, 611, 612, 613, 614, 0, 0, 615, 616, 617, 618, 619, 0, 0, 0, 622, 623, 624, 625, 626, 627, 0, 0, 628, 0, 0, 629, 630, 631, 632, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 647, 648 }; static const yytype_int16 yycheck[] = { 6, 669, 0, 0, 0, 669, 0, 57, 0, 1043, 212, 0, 212, 684, 0, 1015, 0, 23, 0, 25, 798, 799, 800, 29, 21, 0, 804, 207, 663, 35, 36, 37, 0, 39, 0, 215, 42, 43, 218, 45, 0, 47, 0, 944, 0, 1169, 0, 1052, 54, 55, 56, 1232, 842, 1605, 845, 6, 190, 835, 1670, 1589, 938, 0, 940, 739, 899, 1016, 918, 1032, 887, 888, 1284, 2848, 1041, 2681, 869, 2723, 1047, 753, 897, 2724, 37, 716, 21, 1589, 46, 1271, 1118, 1582, 1045, 22, 198, 868, 1594, 3253, 1909, 28, 2053, 3141, 761, 217, 3641, 3076, 3643, 3434, 956, 3436, 902, 0, 3529, 852, 2080, 8, 1514, 231, 3921, 45, 3723, 2042, 15, 1737, 2744, 2745, 4280, 3937, 3088, 1256, 716, 1092, 763, 1260, 665, 1096, 1263, 1264, 981, 3607, 1101, 1635, 1636, 2061, 23, 1639, 3948, 2994, 4837, 3487, 1111, 3669, 3481, 3671, 192, 3103, 1704, 1705, 37, 3970, 4587, 2118, 4349, 1006, 1125, 3873, 192, 4308, 1011, 875, 1981, 2079, 2603, 1572, 4015, 176, 2607, 762, 1471, 2075, 2076, 2077, 2078, 752, 1582, 2081, 5230, 2083, 2084, 820, 4593, 1922, 4598, 4610, 967, 1156, 198, 199, 200, 4394, 1698, 203, 5351, 3532, 4739, 207, 4741, 209, 5147, 4666, 212, 737, 2972, 215, 740, 2, 218, 848, 4853, 221, 4855, 223, 5139, 5514, 226, 4555, 5441, 1725, 230, 982, 232, 3503, 5090, 1632, 5342, 51, 42, 2708, 36, 3296, 2640, 3539, 873, 3388, 2094, 43, 5477, 2710, 4916, 3935, 1649, 3393, 3041, 5518, 3043, 3044, 5134, 5746, 941, 3048, 3049, 3050, 848, 3052, 3053, 3054, 0, 4597, 941, 0, 6, 3486, 11, 3488, 3489, 1555, 21, 6, 13, 5, 5138, 6, 0, 1056, 21, 11, 5730, 2687, 4777, 38, 5398, 4447, 0, 13, 6, 54, 63, 78, 6001, 1052, 226, 63, 122, 1107, 935, 0, 120, 95, 6, 6, 45, 63, 1086, 5405, 5406, 25, 11, 2048, 6, 1123, 6, 35, 965, 47, 3084, 6, 6, 15, 16, 5438, 6, 72, 6, 1015, 29, 29, 6, 885, 886, 15, 16, 177, 1024, 78, 178, 171, 0, 6, 896, 757, 43, 6, 1034, 6, 6, 177, 148, 11, 80, 177, 15, 16, 6, 1006, 142, 32, 127, 125, 1011, 3609, 92, 6, 152, 51, 11, 29, 189, 222, 21, 6008, 63, 37, 43, 21, 5430, 47, 6, 1212, 6, 37, 3, 177, 5, 6, 1888, 5, 189, 1636, 11, 122, 1639, 11, 92, 80, 6, 76, 226, 120, 163, 179, 15, 177, 153, 5632, 308, 177, 4611, 63, 11, 329, 92, 1052, 37, 240, 302, 309, 256, 92, 311, 113, 140, 125, 173, 6141, 120, 52, 63, 293, 42, 112, 220, 384, 288, 177, 135, 402, 177, 179, 120, 1108, 1415, 329, 359, 402, 63, 1483, 85, 322, 216, 177, 1427, 35, 403, 271, 63, 5954, 29, 201, 447, 177, 201, 288, 292, 447, 124, 288, 2930, 124, 379, 13, 5358, 25, 177, 201, 39, 384, 684, 1302, 1303, 168, 13, 177, 6382, 201, 6388, 239, 6390, 37, 1204, 3103, 4927, 5945, 491, 226, 1176, 449, 201, 120, 1475, 324, 268, 45, 384, 389, 29, 47, 413, 5748, 1471, 1334, 6, 36, 216, 177, 4703, 4704, 4705, 120, 4707, 4708, 4709, 4710, 4711, 5, 314, 355, 734, 5645, 355, 11, 310, 438, 80, 419, 78, 6435, 418, 201, 88, 538, 494, 63, 297, 1345, 13, 78, 311, 3011, 6452, 538, 297, 5478, 354, 307, 538, 13, 245, 1239, 682, 292, 471, 470, 135, 223, 688, 130, 223, 484, 310, 292, 6288, 538, 156, 1255, 372, 393, 700, 402, 405, 538, 177, 534, 1365, 534, 267, 199, 140, 45, 177, 272, 1272, 292, 10, 344, 288, 13, 373, 491, 221, 17, 18, 19, 177, 478, 470, 445, 80, 1584, 80, 177, 292, 373, 1395, 32, 534, 1210, 29, 389, 29, 6118, 78, 80, 355, 36, 305, 36, 80, 80, 6267, 13, 534, 243, 3882, 256, 125, 5864, 1277, 5693, 92, 1888, 534, 534, 422, 470, 297, 136, 534, 1472, 1364, 297, 1413, 447, 664, 476, 510, 1418, 1419, 184, 670, 125, 672, 37, 674, 0, 5309, 677, 389, 184, 1503, 297, 1505, 447, 684, 476, 464, 184, 4394, 689, 201, 691, 373, 1277, 402, 538, 21, 697, 374, 332, 122, 454, 534, 395, 538, 370, 1665, 1735, 1736, 1668, 534, 487, 524, 472, 470, 669, 4422, 669, 538, 763, 538, 721, 538, 483, 5953, 447, 465, 447, 23, 373, 730, 1676, 57, 5188, 734, 447, 669, 737, 1442, 430, 740, 420, 421, 6230, 534, 1291, 1292, 481, 373, 6450, 120, 23, 538, 532, 5861, 477, 756, 536, 29, 5866, 5867, 6462, 470, 447, 452, 4566, 373, 491, 767, 5256, 1733, 430, 447, 538, 4928, 23, 373, 534, 470, 1620, 2058, 1410, 669, 1329, 447, 4939, 6228, 534, 538, 1418, 1419, 515, 515, 516, 2681, 538, 533, 530, 4606, 5889, 534, 525, 526, 538, 1508, 537, 4607, 534, 537, 1560, 810, 534, 530, 813, 814, 815, 944, 477, 4353, 1570, 1501, 537, 822, 6310, 534, 5740, 1410, 1656, 4429, 762, 1501, 537, 525, 526, 4435, 462, 2011, 1639, 534, 534, 524, 495, 842, 843, 537, 845, 846, 1742, 534, 495, 850, 778, 536, 780, 532, 782, 534, 538, 536, 6122, 534, 788, 534, 373, 864, 1983, 534, 192, 5744, 869, 1066, 6358, 1066, 525, 526, 875, 3478, 534, 1558, 3481, 6109, 534, 495, 534, 534, 537, 810, 1689, 1690, 1063, 525, 526, 534, 1067, 538, 1069, 932, 515, 516, 412, 2018, 792, 1448, 1449, 310, 4611, 1657, 4243, 932, 1660, 1661, 447, 2030, 538, 525, 526, 534, 525, 526, 1870, 184, 524, 922, 461, 3542, 6138, 3544, 3529, 4255, 532, 3532, 538, 4259, 536, 525, 526, 936, 301, 6044, 1580, 1620, 538, 934, 934, 934, 869, 934, 477, 934, 949, 3908, 934, 322, 538, 934, 1057, 934, 495, 934, 5625, 6066, 538, 1627, 370, 964, 934, 177, 262, 958, 4109, 4110, 534, 934, 4657, 934, 194, 4119, 384, 534, 386, 934, 4516, 934, 983, 934, 447, 934, 447, 988, 989, 262, 470, 1633, 525, 526, 527, 528, 529, 530, 52, 447, 934, 6291, 6232, 4300, 447, 447, 3765, 3766, 1650, 25, 412, 3770, 412, 262, 5952, 470, 813, 814, 815, 1020, 1021, 157, 538, 388, 949, 1555, 538, 538, 4242, 1436, 4244, 4245, 538, 5949, 5212, 5461, 4092, 120, 3508, 964, 538, 846, 1043, 1044, 452, 850, 934, 3509, 4515, 3448, 2079, 474, 171, 4194, 113, 63, 1057, 23, 1059, 125, 177, 876, 1063, 3851, 336, 1066, 1067, 113, 1069, 527, 528, 529, 530, 1074, 125, 5932, 156, 1535, 113, 6309, 527, 528, 529, 530, 201, 63, 1889, 308, 6236, 6237, 346, 5948, 329, 389, 2060, 178, 6203, 1098, 155, 309, 1852, 186, 6, 179, 1105, 1106, 23, 478, 6151, 296, 726, 309, 477, 360, 667, 522, 523, 524, 525, 526, 527, 528, 529, 530, 140, 397, 1127, 1128, 1129, 6, 1131, 6421, 1133, 6, 1135, 1136, 752, 37, 68, 5468, 389, 437, 196, 1493, 72, 1918, 3905, 201, 189, 2115, 216, 4422, 525, 526, 527, 528, 529, 530, 5614, 23, 29, 5347, 4578, 534, 437, 216, 155, 439, 1169, 441, 1171, 1172, 468, 482, 472, 4642, 25, 3, 5372, 113, 6, 6119, 31, 367, 6398, 123, 371, 206, 437, 155, 2142, 25, 266, 5827, 6110, 468, 332, 493, 252, 6, 103, 6130, 268, 1204, 172, 1835, 759, 72, 308, 72, 293, 1212, 6360, 89, 125, 3103, 37, 402, 292, 468, 493, 302, 409, 1020, 1021, 534, 491, 92, 23, 3, 477, 1232, 23, 1234, 491, 447, 534, 1238, 534, 1240, 208, 2027, 2028, 10, 493, 314, 314, 288, 329, 814, 17, 18, 19, 178, 3873, 23, 132, 120, 5682, 197, 5684, 534, 28, 447, 5688, 5689, 135, 23, 1269, 813, 1271, 312, 348, 538, 1275, 288, 1210, 23, 534, 89, 288, 538, 1953, 186, 837, 534, 496, 1212, 1289, 115, 5824, 140, 188, 491, 379, 10, 1967, 534, 13, 120, 6238, 5727, 17, 18, 19, 216, 140, 5712, 324, 1980, 5736, 532, 524, 2810, 534, 536, 6245, 91, 181, 1364, 5129, 5123, 132, 1215, 536, 1217, 92, 1219, 171, 1221, 1331, 1223, 1224, 1225, 89, 5136, 5738, 5742, 1230, 6382, 2112, 2842, 5758, 669, 3963, 262, 5186, 2744, 405, 4885, 5160, 367, 180, 407, 2059, 1141, 2061, 3087, 288, 1360, 1361, 1362, 2067, 1364, 292, 373, 5792, 193, 2073, 2074, 6308, 145, 491, 4909, 491, 434, 512, 132, 1946, 2042, 2085, 6319, 5711, 2042, 1385, 288, 402, 2679, 434, 472, 2095, 198, 6435, 297, 402, 373, 2101, 2894, 262, 434, 207, 301, 4349, 328, 470, 3312, 23, 487, 215, 1993, 1978, 218, 5741, 179, 1872, 434, 405, 3030, 384, 470, 297, 6359, 3, 1424, 297, 1950, 2092, 292, 302, 292, 1627, 1431, 2830, 314, 297, 476, 762, 763, 6367, 405, 1965, 1442, 25, 1968, 170, 271, 1062, 302, 274, 1486, 1487, 327, 1489, 534, 6392, 329, 1021, 1073, 354, 475, 3, 1486, 1487, 476, 1489, 399, 535, 262, 193, 538, 538, 262, 389, 1089, 329, 324, 1020, 3326, 3327, 5619, 6168, 344, 3331, 408, 3440, 259, 6424, 1488, 30, 385, 324, 1492, 1493, 314, 262, 2020, 25, 120, 361, 2024, 2025, 4838, 1503, 1504, 1505, 1506, 262, 1508, 5934, 224, 91, 123, 125, 3120, 4842, 125, 262, 327, 367, 4847, 437, 349, 4850, 3372, 3373, 389, 369, 389, 2058, 535, 140, 1532, 538, 367, 64, 351, 524, 389, 115, 33, 34, 444, 72, 310, 455, 314, 271, 114, 536, 120, 324, 468, 5976, 402, 491, 383, 156, 140, 27, 470, 299, 323, 123, 156, 440, 146, 1567, 393, 402, 397, 5087, 1572, 327, 437, 1575, 2604, 493, 120, 1503, 1986, 1505, 50, 348, 165, 4623, 197, 4016, 1588, 1589, 133, 3478, 6115, 6116, 3481, 389, 310, 1597, 309, 389, 1600, 144, 538, 465, 216, 468, 99, 932, 435, 934, 25, 2017, 140, 309, 339, 2021, 31, 193, 534, 205, 2026, 386, 389, 2029, 392, 120, 119, 1627, 208, 1629, 493, 440, 1632, 4579, 389, 1635, 1636, 197, 1253, 1639, 206, 2606, 3529, 437, 389, 3532, 262, 437, 143, 1649, 3139, 1641, 1652, 4255, 149, 1655, 1646, 4259, 538, 5467, 375, 534, 402, 156, 437, 122, 5372, 440, 163, 393, 437, 534, 253, 534, 468, 297, 217, 1677, 468, 5479, 534, 6106, 437, 534, 509, 450, 440, 452, 173, 4929, 402, 456, 437, 122, 1694, 271, 402, 4937, 274, 493, 343, 468, 288, 493, 524, 402, 1706, 1707, 1708, 1709, 1710, 5863, 532, 468, 534, 535, 536, 4504, 538, 534, 189, 100, 4509, 468, 1724, 140, 493, 256, 2679, 1719, 2079, 2080, 341, 1723, 472, 1735, 1736, 1737, 493, 3135, 534, 4586, 324, 3139, 534, 2094, 99, 4349, 493, 217, 292, 331, 322, 434, 2103, 297, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1961, 1962, 534, 1962, 2768, 1694, 4542, 487, 389, 472, 171, 4394, 1951, 5963, 534, 491, 324, 87, 395, 312, 367, 168, 183, 6311, 534, 332, 240, 29, 136, 324, 491, 395, 226, 538, 178, 763, 6226, 297, 395, 4422, 201, 449, 177, 522, 523, 524, 525, 526, 527, 528, 529, 530, 393, 447, 288, 402, 437, 4580, 389, 367, 395, 538, 266, 293, 294, 183, 201, 538, 212, 1834, 434, 534, 367, 1940, 288, 297, 538, 434, 371, 372, 1845, 83, 115, 227, 86, 6339, 494, 468, 1853, 1854, 324, 93, 820, 470, 135, 288, 137, 167, 292, 434, 482, 432, 58, 434, 1869, 363, 250, 402, 216, 402, 165, 25, 493, 152, 478, 6305, 171, 31, 463, 121, 1210, 478, 1887, 1888, 4835, 534, 471, 491, 120, 474, 524, 2092, 6049, 367, 491, 279, 283, 395, 1903, 1904, 1905, 1906, 536, 478, 324, 873, 2740, 1912, 343, 367, 721, 515, 534, 534, 1919, 6409, 491, 1922, 515, 730, 193, 355, 2878, 5729, 308, 395, 737, 159, 509, 740, 534, 2721, 1937, 129, 367, 1940, 434, 534, 386, 181, 515, 2940, 5747, 5756, 402, 1950, 1951, 367, 2904, 2658, 323, 405, 194, 534, 454, 1285, 1961, 1962, 253, 534, 1965, 178, 194, 1968, 434, 207, 466, 935, 323, 312, 372, 4578, 4579, 5305, 253, 1305, 377, 411, 1983, 1984, 478, 324, 402, 38, 482, 1990, 140, 1992, 4611, 154, 1995, 359, 180, 491, 378, 212, 367, 386, 271, 534, 402, 274, 476, 1623, 452, 60, 2011, 120, 478, 304, 227, 292, 2768, 2018, 449, 2020, 470, 515, 2023, 2024, 2025, 491, 2027, 2028, 367, 2030, 40, 2076, 396, 402, 6416, 402, 2037, 250, 1364, 5506, 534, 242, 203, 2044, 54, 3164, 2047, 2048, 5203, 515, 2051, 402, 3004, 2054, 2055, 6241, 6438, 323, 2059, 1993, 2061, 112, 171, 494, 292, 2066, 2067, 452, 534, 3, 434, 449, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 165, 4038, 2042, 2089, 2042, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 201, 2051, 2101, 111, 2103, 2104, 4056, 1997, 2107, 1999, 2042, 2001, 165, 2003, 2037, 2005, 25, 99, 171, 2009, 3070, 5089, 484, 2122, 2123, 2124, 393, 432, 324, 5, 3024, 3025, 3026, 534, 395, 11, 3624, 119, 402, 5946, 2768, 2140, 333, 3748, 3539, 4108, 483, 2918, 5947, 2920, 2920, 5108, 3359, 2993, 3549, 204, 2042, 4072, 5966, 91, 5128, 2840, 1486, 1487, 182, 1489, 471, 378, 5113, 2838, 5323, 367, 5325, 434, 156, 253, 5500, 324, 2054, 6363, 371, 2180, 91, 419, 355, 112, 422, 384, 4093, 2990, 69, 70, 5369, 4098, 2944, 5710, 4004, 368, 3156, 537, 253, 383, 2952, 152, 4097, 2955, 402, 215, 390, 4102, 4103, 402, 122, 145, 122, 397, 165, 478, 267, 3830, 367, 0, 171, 272, 133, 3836, 304, 398, 5762, 3624, 3721, 140, 333, 1847, 4835, 144, 5413, 434, 256, 288, 369, 4842, 509, 538, 1858, 172, 4847, 92, 266, 4850, 359, 304, 1057, 435, 35, 402, 515, 516, 1063, 48, 1874, 2940, 1067, 171, 1069, 5051, 367, 5053, 5054, 5055, 371, 220, 346, 534, 323, 534, 458, 3772, 182, 3229, 288, 208, 71, 4130, 4131, 4132, 4133, 396, 2287, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 2978, 210, 402, 210, 384, 253, 386, 3107, 3108, 3109, 3110, 179, 3112, 6111, 1641, 1928, 4233, 488, 491, 1646, 5784, 5077, 5735, 5079, 372, 3819, 434, 80, 259, 1133, 1943, 1135, 1136, 1946, 1947, 3013, 27, 3137, 182, 92, 452, 267, 515, 2341, 5, 213, 272, 324, 396, 4241, 11, 2698, 324, 256, 4200, 4201, 304, 3, 19, 50, 3130, 100, 206, 491, 1977, 1978, 314, 538, 5691, 417, 4255, 100, 452, 13, 4259, 484, 484, 38, 371, 288, 26, 288, 363, 292, 391, 292, 38, 515, 324, 6448, 367, 491, 1719, 324, 371, 367, 1723, 301, 94, 2397, 3944, 3350, 333, 5347, 243, 45, 6465, 3356, 60, 402, 538, 324, 256, 406, 395, 515, 324, 447, 324, 324, 491, 292, 439, 32, 441, 402, 297, 363, 491, 395, 402, 367, 363, 6231, 3089, 38, 367, 392, 78, 178, 371, 137, 472, 6242, 515, 91, 171, 6046, 171, 178, 59, 468, 515, 434, 367, 363, 359, 38, 171, 367, 112, 367, 367, 534, 4349, 265, 402, 3216, 434, 313, 195, 402, 195, 212, 3339, 538, 3341, 3342, 81, 60, 491, 352, 195, 212, 780, 781, 782, 535, 227, 785, 786, 787, 292, 282, 402, 1891, 402, 478, 227, 795, 146, 409, 80, 1633, 515, 86, 437, 534, 2121, 440, 491, 250, 478, 5113, 92, 1911, 464, 306, 6051, 6052, 1650, 250, 1010, 6437, 5, 491, 3295, 515, 516, 181, 11, 112, 113, 534, 515, 536, 439, 6451, 441, 120, 279, 1029, 3435, 533, 1032, 5489, 534, 534, 538, 515, 279, 529, 204, 534, 152, 201, 534, 143, 536, 439, 491, 441, 208, 149, 2968, 468, 2970, 165, 534, 6414, 2974, 5647, 6417, 171, 5518, 529, 5652, 5653, 159, 308, 534, 484, 536, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 22, 2591, 533, 439, 6395, 441, 28, 538, 181, 15, 16, 2601, 2602, 527, 2604, 2801, 452, 2801, 532, 270, 534, 2611, 536, 267, 152, 2672, 2673, 2674, 272, 465, 220, 204, 468, 452, 3328, 308, 2800, 165, 2802, 2803, 313, 5418, 5578, 171, 288, 369, 3340, 378, 308, 1006, 2640, 266, 2642, 313, 1011, 2645, 2646, 378, 392, 2649, 2641, 2651, 3777, 253, 2654, 33, 34, 532, 2658, 534, 5985, 536, 6197, 532, 439, 3610, 441, 536, 1993, 323, 3460, 3461, 3376, 266, 284, 285, 286, 287, 532, 96, 534, 2681, 220, 331, 267, 206, 4534, 2687, 2688, 272, 3441, 4578, 4579, 535, 3540, 2797, 538, 195, 2698, 535, 3645, 3438, 538, 5305, 304, 288, 270, 2707, 2708, 292, 535, 384, 385, 538, 314, 253, 3420, 2042, 372, 535, 452, 2721, 538, 3494, 535, 2837, 5764, 538, 87, 2729, 3395, 379, 535, 59, 4685, 538, 2681, 3550, 384, 385, 323, 472, 396, 535, 2105, 5347, 538, 2108, 152, 535, 4701, 2076, 538, 534, 5372, 536, 322, 392, 3933, 3724, 4366, 165, 6297, 417, 527, 535, 304, 171, 538, 532, 2770, 534, 2772, 536, 535, 2100, 314, 538, 535, 4588, 491, 538, 493, 431, 535, 10, 2786, 538, 13, 372, 384, 385, 17, 18, 19, 535, 535, 2797, 538, 538, 2800, 2801, 2802, 2803, 484, 535, 2806, 3213, 538, 2809, 35, 4019, 3441, 396, 243, 463, 220, 2929, 4364, 2770, 4366, 2772, 535, 471, 4730, 538, 474, 515, 516, 395, 2830, 4737, 4738, 534, 417, 4331, 419, 482, 535, 422, 535, 538, 2842, 538, 535, 535, 11, 538, 538, 253, 10, 4351, 491, 13, 493, 2855, 2856, 17, 18, 19, 535, 432, 2862, 538, 464, 5354, 5355, 535, 434, 5627, 538, 2871, 308, 535, 5492, 4055, 538, 5635, 5636, 535, 535, 534, 538, 538, 389, 2809, 152, 5489, 3914, 6043, 439, 538, 441, 2893, 3564, 3565, 384, 385, 3010, 165, 304, 491, 534, 493, 4300, 171, 4402, 439, 535, 441, 314, 538, 478, 59, 2914, 1213, 5518, 3876, 1216, 484, 1218, 3872, 1220, 48, 1222, 491, 464, 2927, 1226, 5816, 5817, 3611, 532, 511, 535, 6260, 536, 538, 535, 311, 535, 538, 135, 538, 137, 6014, 6015, 3719, 4835, 515, 2950, 534, 3724, 2953, 220, 4842, 135, 226, 137, 3588, 4847, 535, 535, 4850, 538, 538, 536, 2292, 534, 1158, 163, 5610, 491, 308, 493, 1164, 5578, 3326, 3327, 2979, 2980, 294, 3331, 535, 163, 1174, 538, 253, 535, 1178, 2914, 538, 308, 1182, 2994, 1184, 2996, 2997, 171, 224, 535, 1190, 511, 538, 3588, 5951, 535, 1196, 535, 538, 1199, 538, 535, 55, 56, 538, 3696, 5963, 535, 535, 48, 538, 538, 3372, 3373, 135, 311, 137, 3028, 3029, 3030, 511, 226, 535, 3034, 228, 538, 527, 304, 6364, 2967, 201, 3042, 3713, 535, 176, 538, 538, 314, 228, 535, 481, 534, 538, 4600, 3055, 535, 534, 340, 538, 464, 3061, 534, 3063, 224, 3735, 535, 535, 3870, 538, 538, 4595, 535, 37, 535, 538, 3076, 538, 534, 59, 535, 3081, 395, 538, 535, 310, 3260, 3087, 3262, 3263, 3090, 284, 285, 286, 287, 535, 177, 535, 291, 292, 538, 222, 3102, 3103, 297, 284, 285, 286, 287, 54, 222, 535, 291, 3113, 538, 6440, 535, 535, 297, 538, 538, 434, 491, 3123, 493, 3125, 535, 4616, 534, 538, 3902, 1937, 535, 5735, 1940, 538, 6105, 535, 535, 535, 538, 538, 538, 535, 1950, 1951, 538, 536, 535, 535, 310, 538, 538, 201, 535, 3257, 101, 538, 3103, 1965, 535, 3567, 1968, 538, 3164, 478, 3166, 535, 3168, 535, 538, 535, 538, 534, 538, 4350, 6122, 4352, 491, 535, 4355, 126, 538, 535, 2799, 535, 538, 495, 538, 535, 2805, 534, 538, 535, 3194, 535, 538, 537, 464, 3395, 145, 534, 515, 3203, 5846, 150, 535, 535, 4173, 538, 538, 367, 536, 535, 2020, 4166, 538, 157, 2024, 2025, 4616, 534, 535, 3893, 537, 3895, 5113, 172, 157, 535, 535, 176, 538, 538, 534, 3122, 535, 2852, 535, 538, 535, 538, 535, 538, 535, 538, 191, 538, 535, 3878, 537, 3880, 535, 4042, 308, 538, 535, 3257, 3258, 538, 3260, 454, 3262, 3263, 4227, 3265, 532, 201, 535, 535, 536, 538, 3272, 466, 367, 454, 535, 3277, 535, 538, 535, 538, 535, 538, 3328, 538, 308, 466, 535, 6235, 535, 538, 157, 538, 3878, 6241, 3880, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3193, 3503, 4273, 157, 201, 535, 4063, 535, 538, 535, 538, 535, 538, 157, 538, 535, 2647, 4224, 538, 4226, 3326, 3327, 3328, 5235, 5236, 3331, 3376, 3962, 535, 308, 171, 538, 4944, 3339, 3340, 3341, 3342, 535, 367, 4824, 538, 4826, 4260, 5951, 4262, 157, 297, 6124, 251, 3355, 2681, 5286, 3358, 5288, 3360, 5963, 522, 523, 524, 525, 526, 527, 528, 529, 530, 122, 3372, 3373, 472, 308, 3376, 534, 3962, 301, 171, 535, 72, 72, 292, 38, 292, 495, 4058, 78, 534, 308, 292, 48, 5242, 3395, 48, 3397, 292, 3399, 457, 3401, 292, 92, 91, 324, 4365, 352, 484, 484, 4910, 87, 452, 171, 157, 347, 157, 6363, 5305, 534, 3420, 4125, 157, 3423, 157, 495, 10, 3427, 157, 13, 157, 120, 25, 122, 538, 157, 0, 3481, 31, 157, 157, 157, 4393, 157, 4395, 157, 171, 3062, 3448, 157, 157, 157, 157, 46, 157, 4159, 4664, 308, 434, 222, 5347, 45, 10, 534, 4639, 13, 38, 251, 52, 171, 4421, 171, 3428, 3429, 3430, 308, 534, 4323, 3478, 43, 6, 3481, 3482, 76, 4297, 6, 3486, 3487, 3488, 3489, 534, 534, 181, 171, 78, 3495, 534, 45, 0, 534, 3500, 534, 534, 534, 52, 534, 4210, 6, 6, 534, 534, 6, 6, 534, 3920, 3515, 534, 534, 534, 534, 6122, 210, 534, 534, 534, 534, 534, 534, 534, 3529, 78, 3531, 3532, 3478, 534, 99, 3481, 534, 131, 534, 133, 534, 534, 534, 534, 4490, 534, 140, 534, 299, 534, 144, 534, 4512, 492, 534, 534, 534, 320, 534, 534, 166, 222, 38, 103, 251, 150, 538, 538, 38, 3570, 4233, 534, 37, 5525, 4233, 445, 445, 532, 172, 532, 447, 177, 447, 3529, 447, 534, 3532, 152, 447, 6361, 538, 171, 304, 3594, 3595, 171, 99, 302, 389, 68, 165, 5489, 292, 447, 4500, 447, 171, 297, 483, 447, 447, 196, 177, 389, 208, 536, 201, 447, 183, 447, 4027, 186, 389, 253, 447, 190, 371, 79, 3244, 3630, 5518, 447, 6235, 447, 524, 92, 389, 157, 6241, 308, 394, 248, 447, 3259, 447, 297, 128, 196, 3264, 152, 447, 471, 201, 437, 344, 220, 329, 222, 308, 384, 302, 534, 165, 194, 447, 447, 534, 252, 171, 92, 4422, 361, 128, 324, 177, 201, 3873, 538, 3294, 157, 183, 447, 472, 186, 472, 447, 3687, 190, 253, 447, 5578, 128, 447, 114, 288, 128, 59, 447, 292, 447, 447, 5550, 59, 252, 447, 276, 4672, 447, 302, 447, 3711, 312, 447, 351, 447, 447, 447, 220, 312, 351, 3721, 437, 351, 447, 329, 310, 447, 447, 47, 329, 324, 539, 5581, 447, 538, 4687, 447, 447, 224, 304, 535, 224, 308, 308, 224, 447, 308, 224, 447, 314, 253, 224, 224, 224, 534, 38, 224, 224, 4108, 457, 6363, 310, 5159, 224, 157, 308, 1956, 157, 292, 120, 157, 157, 472, 367, 1964, 465, 370, 371, 157, 308, 4130, 4131, 4132, 4133, 259, 292, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 3122, 483, 292, 292, 38, 304, 171, 38, 243, 308, 472, 534, 402, 391, 375, 314, 534, 157, 4164, 157, 157, 472, 157, 402, 301, 447, 407, 177, 487, 276, 276, 13, 447, 3830, 296, 186, 319, 449, 194, 3836, 194, 534, 534, 511, 535, 534, 534, 511, 538, 534, 3847, 5735, 532, 393, 4200, 4201, 535, 538, 535, 535, 274, 535, 407, 535, 535, 488, 240, 405, 220, 430, 309, 3193, 538, 472, 38, 538, 375, 472, 2681, 317, 59, 535, 389, 483, 297, 475, 297, 3884, 3885, 3886, 534, 297, 447, 4560, 4561, 447, 447, 534, 171, 297, 308, 4247, 48, 464, 3901, 411, 308, 534, 240, 240, 251, 292, 251, 270, 384, 251, 308, 447, 3915, 128, 437, 538, 538, 308, 308, 201, 5098, 488, 308, 490, 491, 4679, 513, 367, 491, 434, 3933, 3934, 3935, 195, 355, 399, 3939, 402, 525, 526, 527, 528, 529, 530, 447, 512, 5473, 447, 3951, 535, 314, 38, 224, 472, 472, 243, 350, 4789, 524, 464, 157, 171, 513, 302, 484, 4012, 38, 173, 535, 435, 537, 538, 351, 3591, 525, 526, 527, 528, 529, 530, 534, 3599, 4857, 488, 399, 490, 491, 534, 2797, 157, 157, 2800, 157, 2802, 2803, 302, 292, 491, 38, 292, 3328, 38, 308, 27, 4007, 308, 192, 512, 243, 4012, 472, 302, 4015, 192, 171, 38, 172, 243, 171, 308, 201, 399, 292, 60, 3951, 201, 201, 532, 4031, 4032, 535, 536, 537, 59, 538, 201, 447, 201, 495, 4042, 177, 273, 491, 308, 534, 538, 538, 538, 3376, 536, 301, 177, 4055, 314, 535, 477, 375, 3947, 135, 330, 320, 5951, 512, 177, 291, 447, 266, 177, 4775, 186, 470, 4074, 3400, 5963, 535, 112, 59, 4208, 538, 535, 4083, 511, 4869, 538, 5633, 3703, 488, 3705, 3416, 535, 538, 538, 535, 3983, 4097, 533, 538, 5059, 4101, 4102, 4103, 535, 535, 535, 535, 4108, 535, 534, 4111, 535, 538, 4114, 261, 514, 538, 4042, 534, 4120, 534, 4122, 488, 534, 4125, 157, 308, 535, 535, 4130, 4131, 4132, 4133, 311, 535, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 447, 214, 308, 4149, 4150, 4151, 534, 3478, 535, 535, 3481, 515, 447, 4159, 533, 297, 4206, 534, 4164, 534, 447, 534, 4168, 160, 204, 292, 447, 157, 206, 422, 4176, 402, 394, 4179, 157, 4181, 534, 4934, 157, 4534, 3801, 534, 534, 394, 10, 251, 394, 13, 206, 4860, 160, 4197, 4394, 308, 4200, 4201, 524, 447, 3529, 4205, 4206, 3532, 472, 160, 4210, 488, 4212, 4213, 389, 253, 331, 5182, 331, 469, 160, 4221, 4222, 4223, 419, 45, 4422, 447, 447, 447, 3845, 389, 52, 267, 447, 6122, 4906, 263, 272, 263, 128, 4241, 4242, 4243, 4244, 4245, 263, 4247, 4248, 447, 389, 4251, 389, 10, 288, 4255, 13, 447, 78, 4259, 4216, 4217, 4218, 4219, 389, 4265, 157, 4673, 4674, 4675, 4676, 4677, 402, 447, 292, 47, 447, 447, 447, 4233, 47, 4233, 535, 535, 535, 224, 224, 533, 45, 323, 447, 447, 4292, 189, 535, 52, 447, 3103, 312, 447, 4233, 3, 535, 538, 171, 457, 5078, 48, 113, 10, 4255, 538, 13, 535, 4259, 171, 17, 18, 19, 534, 38, 78, 157, 6171, 6172, 535, 3941, 6175, 447, 157, 150, 524, 171, 302, 35, 189, 157, 472, 372, 5009, 472, 308, 534, 389, 524, 478, 4233, 389, 6235, 4349, 4350, 4351, 4352, 389, 6241, 4355, 389, 4357, 399, 389, 155, 155, 396, 224, 224, 224, 224, 224, 147, 5765, 3985, 224, 538, 224, 224, 4375, 196, 224, 465, 228, 465, 201, 308, 417, 308, 532, 5281, 59, 308, 25, 535, 308, 535, 150, 13, 31, 538, 320, 291, 177, 10, 483, 533, 13, 4349, 227, 535, 17, 18, 19, 538, 535, 318, 535, 534, 4611, 227, 535, 535, 535, 5315, 436, 59, 535, 534, 35, 315, 535, 534, 4778, 4430, 190, 252, 534, 444, 457, 5106, 171, 375, 196, 76, 38, 243, 472, 201, 472, 447, 59, 214, 437, 2639, 3257, 157, 472, 3260, 86, 3262, 3263, 419, 181, 457, 394, 4077, 160, 447, 447, 447, 389, 447, 447, 389, 535, 5423, 535, 535, 367, 6363, 534, 491, 534, 59, 6087, 437, 478, 171, 4485, 78, 157, 113, 308, 310, 457, 535, 224, 224, 252, 224, 133, 224, 534, 240, 209, 447, 495, 140, 308, 534, 38, 144, 4436, 535, 329, 305, 3, 4129, 457, 308, 44, 4518, 447, 4447, 399, 538, 224, 477, 534, 534, 538, 534, 90, 535, 538, 4532, 183, 4534, 184, 172, 113, 177, 4154, 224, 4541, 535, 145, 297, 241, 241, 4547, 535, 297, 5668, 297, 5670, 310, 297, 177, 59, 10, 4558, 535, 13, 535, 489, 535, 17, 18, 19, 535, 489, 320, 535, 329, 208, 4573, 534, 538, 535, 534, 4578, 4579, 538, 227, 534, 490, 457, 302, 4586, 407, 177, 444, 208, 491, 45, 78, 195, 4595, 195, 297, 38, 52, 59, 447, 538, 297, 437, 4605, 524, 538, 72, 310, 447, 447, 5018, 5019, 224, 5021, 447, 4617, 4618, 157, 160, 447, 3947, 535, 224, 78, 534, 127, 4628, 10, 179, 120, 13, 4578, 4579, 38, 17, 18, 19, 4639, 4640, 201, 302, 399, 534, 472, 5821, 38, 292, 173, 407, 302, 288, 491, 35, 399, 292, 4657, 3983, 59, 84, 437, 491, 38, 4860, 5450, 302, 177, 308, 4669, 534, 4671, 3478, 171, 362, 3481, 312, 211, 311, 524, 5679, 222, 177, 5348, 416, 5860, 538, 4012, 324, 477, 59, 535, 535, 513, 535, 535, 38, 81, 447, 392, 310, 535, 534, 5373, 534, 525, 526, 527, 528, 529, 530, 534, 308, 4713, 202, 38, 361, 4604, 535, 5384, 157, 157, 534, 3529, 447, 534, 3532, 534, 534, 4729, 534, 5906, 5907, 171, 370, 371, 534, 534, 38, 297, 399, 264, 157, 196, 534, 472, 535, 4747, 201, 534, 113, 38, 535, 312, 177, 535, 513, 414, 457, 414, 171, 92, 136, 538, 38, 308, 402, 535, 525, 526, 527, 528, 529, 530, 205, 4775, 112, 538, 4778, 38, 535, 35, 534, 437, 534, 194, 4786, 4787, 171, 534, 472, 538, 534, 4793, 4794, 534, 437, 288, 4798, 252, 206, 534, 308, 4803, 6, 164, 4806, 4807, 385, 495, 535, 385, 72, 4813, 534, 311, 72, 4817, 4818, 4819, 4820, 522, 523, 524, 525, 526, 527, 528, 529, 530, 537, 136, 141, 491, 487, 4835, 149, 308, 4838, 475, 168, 476, 4842, 224, 5795, 477, 535, 4847, 491, 477, 4850, 4851, 5556, 4853, 535, 4855, 168, 310, 4858, 538, 4860, 330, 443, 534, 265, 534, 5570, 177, 443, 4869, 437, 4871, 358, 208, 437, 297, 308, 399, 308, 38, 5831, 4206, 534, 4883, 38, 311, 311, 534, 5592, 179, 4835, 202, 5298, 5242, 179, 5599, 534, 4842, 156, 5898, 402, 495, 4847, 5309, 6079, 4850, 353, 495, 4233, 353, 4910, 4911, 522, 523, 524, 525, 526, 527, 528, 529, 530, 384, 5916, 153, 59, 4925, 59, 315, 5679, 310, 4255, 81, 4883, 38, 4259, 368, 59, 535, 59, 447, 423, 125, 470, 6, 5895, 535, 5295, 399, 534, 4564, 141, 495, 308, 495, 407, 308, 35, 535, 297, 5663, 5664, 534, 534, 293, 3153, 534, 293, 402, 24, 3158, 384, 3160, 538, 538, 308, 388, 10, 384, 388, 13, 81, 3170, 534, 316, 3173, 478, 3175, 3176, 6163, 6164, 3179, 4991, 447, 149, 3183, 177, 3185, 534, 4998, 3188, 477, 4928, 538, 156, 425, 425, 414, 6, 120, 414, 478, 45, 4939, 315, 535, 491, 491, 332, 52, 179, 5020, 179, 472, 534, 81, 534, 477, 5499, 535, 534, 934, 974, 6, 3441, 2978, 5035, 5665, 2887, 3645, 4393, 4368, 1722, 3005, 6070, 78, 1419, 3864, 3059, 5426, 6211, 5679, 5895, 4558, 5473, 4366, 4366, 5068, 5449, 3633, 3571, 513, 3203, 6050, 5347, 6200, 3254, 5066, 5926, 5925, 522, 523, 524, 525, 526, 527, 528, 529, 530, 52, 6091, 6235, 3638, 5082, 5113, 4579, 4605, 4590, 5868, 10, 5089, 4548, 13, 3073, 5865, 4388, 17, 18, 19, 5098, 3670, 3073, 3912, 1016, 4574, 5107, 5456, 3956, 4641, 5777, 6320, 6454, 10, 6429, 5113, 13, 5440, 150, 4613, 17, 18, 19, 3872, 6103, 5386, 5650, 5878, 5126, 1882, 5128, 5389, 18, 28, 665, 4031, 4684, 5839, 1240, 5841, 5618, 38, 4687, 522, 523, 524, 525, 526, 527, 528, 529, 530, 6316, 4616, 5348, 3089, 5154, 1926, 2745, 3549, 5499, 1923, 1937, 5765, 196, 3967, 1961, 5165, 717, 201, 5113, 3804, 750, 3004, 4421, 3721, 6130, 6367, 5372, 4645, 863, 3035, 4647, 5181, 2688, 5589, 1995, 6293, 5186, 1835, 5384, 4669, 5384, 1539, 5181, 5614, 5617, 1435, 1396, 5862, 41, 41, 4729, 5550, 1496, 3500, 1495, 3515, 6033, 5843, 3481, 5383, 4243, 2698, 6211, 4261, 1498, 5306, 5578, 3478, 252, 5577, 4670, 3478, 6345, 6027, 198, 5830, 6176, 3478, 5554, 5229, 6383, 1452, 5581, 207, 208, 5844, 4168, 3418, 5125, 5239, 2597, 215, 5242, 217, 218, 5245, 5246, 5247, 2596, 5845, 2096, 3273, 3398, 4578, 5428, 3400, 3034, 231, 5794, 6385, 3388, 3309, 4100, 2602, 2686, -1, 5672, -1, -1, 5898, 5270, 5271, -1, -1, 5274, -1, 310, -1, 4893, 4604, 922, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5291, 5179, 5180, 10, 5295, -1, 13, -1, -1, -1, 5301, 224, -1, -1, 5305, -1, -1, -1, 5309, -1, -1, 5312, -1, 5314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, 45, -1, 4946, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5347, 5348, 5349, -1, 5351, -1, 4968, -1, -1, -1, -1, -1, -1, 5305, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, 6408, -1, -1, 5383, 5384, 3574, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5347, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, 6370, -1, -1, -1, -1, -1, 5040, -1, 5318, 5428, -1, -1, -1, -1, -1, 150, -1, -1, -1, -1, -1, 5440, 6070, -1, -1, -1, 5445, -1, -1, -1, 4255, 5450, -1, -1, 4259, -1, -1, -1, -1, -1, 5459, -1, -1, -1, -1, -1, 3654, -1, 3656, 6130, 5469, -1, -1, 6130, 5473, -1, -1, 5476, -1, 6429, 513, 196, 5830, -1, -1, -1, 201, -1, 5487, 5488, 5489, -1, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, 6454, -1, -1, -1, 5499, 5499, 5499, -1, 5499, -1, 5499, -1, -1, 5499, 4842, 5518, 5499, 5520, 5499, 4847, 5499, -1, 4850, -1, -1, -1, -1, 5499, 6303, 6304, 5533, -1, 6430, 252, 5499, -1, 5499, -1, -1, -1, 4349, 5489, 5499, 5161, 5499, -1, 5499, 5550, 5499, -1, -1, 5554, 5599, 5556, -1, -1, -1, -1, -1, -1, -1, 5488, -1, 5499, 5454, -1, -1, 5570, -1, -1, 5518, -1, -1, -1, -1, 5578, -1, -1, 5581, 6211, 6245, -1, 5585, -1, 6245, -1, -1, -1, -1, 5592, -1, 310, -1, 6300, -1, 5485, 5599, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 3800, 5499, -1, -1, -1, -1, 3806, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 5578, 5634, -1, -1, -1, -1, -1, -1, 5641, -1, -1, -1, -1, 6350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5657, -1, -1, -1, -1, -1, 5663, 5664, -1, 5862, -1, 5668, 5669, 5670, 5671, -1, -1, 6023, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 663, -1, 407, -1, -1, -1, -1, 5311, -1, -1, 5699, -1, -1, -1, -1, -1, 6367, -1, 5707, 682, 6367, -1, -1, -1, -1, 688, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 700, -1, -1, -1, -1, -1, 5732, -1, -1, 5735, -1, -1, -1, -1, -1, -1, 716, -1, -1, -1, -1, 721, -1, -1, -1, -1, 726, -1, -1, -1, 730, 731, -1, -1, -1, 5761, -1, 737, -1, 739, 740, -1, -1, -1, -1, -1, 4578, 4579, -1, -1, -1, -1, 752, 753, -1, -1, -1, -1, -1, -1, -1, -1, -1, 763, 5735, -1, -1, -1, 5794, -1, -1, 513, -1, -1, 5125, -1, -1, 3992, -1, 3994, 5806, 3996, -1, 525, 526, 527, 528, 529, 530, 5815, 5816, 5817, -1, -1, -1, 5821, 6171, 6172, -1, -1, 6175, 5827, -1, -1, 5830, -1, -1, -1, 22, -1, -1, -1, -1, 5839, 28, 5841, -1, 5843, 5844, -1, 820, -1, -1, 10, 5737, 5851, 13, -1, 5179, 5180, -1, -1, -1, -1, 5860, -1, 5862, -1, -1, -1, -1, 25, 842, 843, 5870, -1, -1, 31, 848, -1, -1, -1, -1, -1, -1, -1, -1, 6057, 45, -1, -1, -1, 46, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, 873, -1, 875, -1, -1, -1, -1, 5906, 5907, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 76, -1, -1, -1, -1, -1, -1, 899, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 922, -1, -1, 5951, -1, -1, -1, -1, -1, 6131, 6132, -1, -1, 935, -1, 5963, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, -1, 133, -1, -1, -1, -1, 5305, -1, 140, -1, -1, -1, 144, -1, -1, 150, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5951, -1, 6008, -1, -1, -1, -1, -1, 172, -1, -1, -1, 5963, -1, -1, -1, -1, 6023, -1, -1, -1, 6027, -1, 4835, -1, -1, 5647, 6033, -1, 196, 4842, 5652, 5653, -1, 201, 4847, -1, -1, 4850, 4851, -1, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, 6057, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1043, 1044, 1045, 6072, -1, -1, -1, -1, -1, 1052, 6079, -1, -1, -1, 1057, -1, -1, -1, -1, 1062, 1063, -1, 252, -1, 1067, -1, 1069, 5983, -1, -1, 1073, -1, -1, -1, -1, -1, 6105, -1, -1, -1, -1, -1, -1, 6112, -1, -1, 1089, -1, -1, -1, -1, -1, -1, 6122, -1, -1, -1, -1, -1, -1, 5454, 288, 6131, 6132, 6133, 292, -1, -1, 6137, 6130, -1, -1, 6141, -1, -1, 302, -1, -1, -1, -1, 310, -1, 5766, -1, -1, 312, -1, -1, -1, -1, 1133, 5485, 1135, 1136, 6163, 6164, 6165, 324, -1, -1, -1, -1, 6171, 6172, -1, 5499, 6175, 6130, 6122, 6178, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6130, -1, -1, -1, 6245, 1176, -1, -1, 6205, -1, -1, -1, 367, -1, -1, 370, 371, -1, -1, -1, 6104, -1, 5834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1204, -1, -1, -1, -1, 6235, 6236, 6237, -1, -1, -1, 6241, -1, 6130, 402, -1, 407, -1, -1, -1, -1, -1, -1, 6245, -1, -1, -1, -1, -1, 6259, -1, -1, -1, -1, -1, 1239, -1, 6267, 6442, 6443, -1, -1, -1, -1, 5599, 6275, 5082, -1, -1, 1253, -1, 1255, -1, 6283, -1, -1, -1, -1, 6288, -1, 6235, 6245, -1, 6293, -1, -1, 6241, -1, 1272, -1, 6300, 0, -1, 1277, -1, -1, -1, 5113, -1, -1, -1, -1, 6245, -1, -1, 1289, -1, 475, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6337, 6338, 6339, 6340, -1, -1, -1, -1, 6345, -1, -1, -1, -1, 6350, -1, 513, -1, -1, -1, -1, 1331, 6245, -1, 6360, -1, -1, 6363, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, 6367, -1, -1, -1, -1, -1, -1, -1, 6383, -1, -1, 1360, 1361, 1362, -1, 1364, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 0, -1, -1, -1, -1, -1, -1, 6408, 6409, 5735, 1385, 5737, 6367, -1, -1, -1, -1, 6363, -1, -1, -1, -1, -1, 25, 6425, -1, -1, -1, -1, 31, -1, -1, -1, 6367, -1, 1410, -1, -1, -1, -1, -1, 6442, 6443, 1418, 1419, 6446, -1, 6448, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4653, 6465, 165, 4656, 1442, -1, -1, -1, 171, -1, -1, 76, -1, -1, 177, -1, 6367, -1, -1, -1, 183, -1, -1, 186, -1, -1, -1, 190, -1, -1, -1, -1, -1, 1471, -1, 5305, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4700, -1, -1, 1488, -1, -1, -1, 1492, 1493, -1, 220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, 1508, -1, -1, -1, -1, 140, 1514, 5347, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, 152, 253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, 172, 171, -1, -1, -1, -1, 5383, 177, -1, -1, -1, -1, -1, 183, -1, -1, 186, -1, -1, 778, 190, 780, -1, 782, -1, -1, -1, -1, -1, 788, 789, 790, -1, -1, 304, -1, 208, 1582, 308, -1, -1, -1, -1, -1, 314, -1, -1, -1, -1, -1, 220, 5428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1623, -1, -1, -1, -1, 253, -1, -1, -1, 5983, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, 375, -1, -1, -1, -1, -1, 1656, 5489, -1, -1, -1, 288, -1, 35, -1, 292, -1, -1, -1, -1, -1, -1, -1, 45, -1, 302, 4891, -1, -1, 304, 52, -1, -1, 308, -1, 312, 5518, -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, 6344, -1, -1, 78, -1, -1, 434, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1720, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4947, 4948, -1, 1735, 1736, 1737, -1, 464, 367, -1, -1, 370, 371, -1, 5578, -1, -1, -1, 375, -1, -1, 6104, -1, -1, -1, -1, -1, -1, -1, -1, -1, 488, -1, 490, 491, -1, 982, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, 6130, -1, -1, -1, -1, -1, -1, -1, 512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 532, -1, 434, 535, 536, 537, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 196, -1, 5041, 5042, -1, 201, -1, -1, -1, -1, -1, 1835, -1, -1, 1052, 464, -1, 17, -1, -1, -1, -1, -1, 1847, 475, 45, 26, -1, 224, 225, -1, -1, 52, -1, 1858, -1, -1, -1, -1, 488, -1, 490, 491, -1, -1, -1, 1870, -1, -1, -1, 1874, 5707, -1, -1, -1, -1, 252, -1, 78, -1, -1, -1, -1, 512, -1, -1, -1, -1, -1, 1893, 6245, 38, -1, -1, -1, -1, -1, 1901, -1, 5735, -1, -1, -1, 532, -1, 1909, 535, 536, 537, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 295, -1, -1, -1, -1, 1928, -1, -1, -1, -1, -1, -1, -1, -1, 1937, 310, -1, 1940, 313, -1, 1943, -1, -1, 1946, 1947, -1, -1, 1950, 1951, -1, 1953, 1954, 98, 5171, -1, -1, 5174, 5175, -1, -1, -1, -1, 1965, -1, 1967, 1968, -1, -1, -1, -1, -1, -1, -1, -1, 1977, 1978, 10, 1980, 1981, 13, -1, -1, -1, 17, 18, 19, -1, 5205, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 35, 201, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 6367, -1, 161, -1, 2020, 52, -1, -1, 2024, 2025, -1, -1, 224, 225, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, 198, 252, -1, -1, 2059, -1, 2061, -1, -1, -1, -1, 2066, 2067, -1, -1, -1, -1, -1, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, -1, -1, -1, 2089, -1, 2091, -1, 2093, 2094, 2095, 2096, 2097, 2098, 295, 243, 2101, -1, 2103, 2104, 248, -1, 2107, -1, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, 5951, -1, 2121, 2122, 2123, 2124, -1, -1, -1, -1, -1, -1, 5963, -1, -1, -1, -1, -1, -1, -1, -1, 2140, 513, 2142, -1, -1, -1, -1, -1, -1, 292, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, 196, -1, 539, -1, -1, 201, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, 325, -1, 17, 18, 19, -1, -1, -1, 333, -1, -1, 224, 225, -1, -1, -1, -1, 1413, -1, -1, 35, -1, 1418, 1419, -1, -1, -1, -1, -1, 407, 45, -1, -1, -1, -1, -1, -1, 52, -1, 252, -1, -1, -1, 6057, -1, -1, 371, -1, -1, -1, 1446, 376, -1, -1, -1, -1, -1, -1, -1, 1455, 385, 1457, -1, 78, -1, 1461, -1, -1, -1, 394, -1, -1, 1468, -1, -1, -1, -1, 402, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, -1, -1, 310, -1, 424, 313, -1, -1, -1, 429, 2287, -1, -1, 6122, -1, -1, -1, -1, -1, -1, -1, -1, 6131, 6132, -1, -1, -1, -1, -1, -1, 450, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, 2341, -1, 486, -1, -1, 1560, 490, -1, -1, -1, -1, -1, -1, -1, -1, 1570, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 224, 225, -1, -1, -1, -1, 2397, -1, -1, 1614, 1615, -1, 6235, -1, 5620, -1, -1, -1, 6241, 20, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 31, -1, 33, 34, -1, -1, 6259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, 1657, -1, -1, 1660, 1661, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, 5674, -1, -1, 295, 73, -1, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, -1, -1, 310, -1, -1, 313, -1, 513, -1, -1, -1, -1, 97, -1, 99, 666, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, 116, 6339, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, 6363, -1, -1, -1, -1, -1, 147, -1, -1, 716, 717, -1, -1, -1, -1, 156, -1, 158, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, 407, -1, -1, 6409, 5793, -1, -1, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 200, 2591, -1, 6425, -1, -1, -1, -1, -1, -1, -1, -1, 2602, -1, 2604, -1, 38, -1, -1, -1, 6442, 6443, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, 1852, -1, 816, -1, 2642, -1, 254, 255, 2646, -1, -1, 2649, 260, 2651, -1, -1, 2654, -1, -1, -1, 2658, -1, 836, -1, -1, -1, -1, 275, 98, -1, 844, -1, -1, 847, 848, 849, -1, -1, -1, -1, -1, 2679, 513, 2681, -1, -1, 294, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 2698, -1, -1, -1, 535, -1, -1, 538, -1, 2707, 2708, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, -1, 161, -1, -1, 342, 2733, -1, -1, -1, -1, -1, -1, 2740, -1, -1, -1, 2744, 2745, -1, 357, -1, -1, -1, 2751, -1, 363, 364, 2755, 366, -1, -1, 2759, -1, 371, -1, -1, -1, -1, 198, 377, 2768, -1, 380, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, -1, -1, 2783, 394, 395, 2786, -1, -1, -1, -1, -1, 402, -1, -1, -1, 406, 2797, -1, 2799, 2800, -1, 2802, 2803, -1, 2805, -1, 417, -1, -1, -1, 243, -1, -1, -1, -1, 248, 2817, -1, -1, -1, -1, -1, -1, 434, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2837, 2838, -1, -1, -1, -1, -1, -1, 455, -1, -1, -1, -1, -1, -1, 2852, -1, -1, 2069, 2070, 467, -1, -1, 292, -1, -1, 473, -1, -1, -1, -1, 478, -1, -1, -1, 2086, 2087, 2874, 2875, 1052, -1, 2878, -1, -1, 491, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, 325, 13, -1, -1, -1, 17, 18, 19, 333, 2902, 2117, 2904, 515, -1, -1, 2908, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, 2922, -1, 534, -1, 45, 537, -1, 2929, -1, -1, 2932, 52, -1, -1, -1, 25, 2938, 371, -1, -1, -1, 31, 376, -1, -1, -1, -1, -1, 38, -1, -1, 385, -1, -1, -1, -1, 2958, 78, -1, -1, 394, -1, 2964, -1, -1, -1, -1, -1, 402, 2971, 60, -1, -1, -1, -1, -1, -1, 6194, -1, -1, -1, 415, -1, 2985, -1, -1, 76, -1, -1, -1, 424, -1, -1, -1, -1, 429, -1, 2999, -1, -1, -1, -1, 3004, -1, -1, -1, -1, -1, 3010, -1, -1, -1, -1, -1, -1, -1, 450, -1, -1, -1, -1, -1, 112, -1, -1, -1, 3028, 3029, 3030, -1, -1, -1, 3034, -1, 25, -1, -1, -1, -1, -1, 31, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, 486, -1, 144, 46, 490, -1, -1, 3061, 3062, -1, -1, -1, -1, -1, -1, 1245, 3070, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, 172, -1, -1, 76, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 1277, -1, 3103, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, 35, 204, -1, -1, -1, 208, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 252, -1, 3135, -1, -1, -1, 3139, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, 267, -1, -1, -1, 172, 272, -1, -1, -1, -1, -1, 1366, 310, -1, -1, 313, -1, -1, -1, -1, 1375, 288, -1, -1, -1, 292, -1, -1, -1, -1, -1, -1, -1, -1, -1, 302, 1391, -1, -1, -1, 208, -1, -1, -1, -1, 312, -1, -1, 3227, -1, 3229, -1, -1, -1, -1, 1410, 323, 324, 1413, 1414, 52, -1, -1, 1418, 1419, 3244, -1, 3246, -1, -1, -1, -1, -1, -1, 3253, -1, -1, -1, 3257, -1, 3259, 3260, -1, 3262, 3263, 3264, -1, -1, -1, -1, -1, -1, -1, 3272, -1, -1, -1, 196, 3277, -1, 367, -1, 201, 370, 371, 372, -1, -1, -1, 407, -1, -1, -1, -1, -1, 3294, -1, -1, -1, -1, 288, -1, -1, -1, 292, 224, 225, -1, -1, 396, -1, -1, -1, -1, 302, 402, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, 3326, 3327, 3328, 417, -1, 3331, 252, -1, -1, 324, -1, -1, -1, 3339, 3340, 3341, 3342, -1, -1, -1, -1, -1, -1, -1, 3350, -1, -1, -1, -1, 3355, 3356, -1, 3358, -1, 3360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3372, 3373, -1, 295, 3376, -1, 367, -1, -1, 370, 371, -1, -1, -1, -1, 475, -1, -1, 310, -1, -1, 313, 513, -1, -1, 3397, -1, 3399, -1, 3401, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 25, 402, -1, -1, -1, -1, 31, 538, 3420, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 3441, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 2669, 2670, -1, -1, -1, -1, 2675, -1, 76, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, 3478, -1, -1, 3481, 52, -1, -1, -1, 475, 407, -1, -1, -1, -1, -1, 2707, 2708, 3495, -1, -1, 1674, -1, 3500, -1, -1, -1, -1, -1, 1682, -1, 78, -1, -1, -1, -1, -1, -1, 3515, -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, 3529, -1, 144, 3532, -1, -1, -1, -1, -1, -1, 3539, -1, -1, 3542, -1, 3544, 62, -1, -1, 10, 3549, -1, 13, -1, -1, 2768, 17, 18, 19, -1, 172, -1, -1, -1, -1, 3564, 3565, -1, -1, -1, -1, 3570, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 98, -1, 45, -1, 3585, -1, -1, 3588, -1, 52, 3591, -1, 513, -1, 208, -1, -1, -1, 3599, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, 78, -1, 538, -1, -1, -1, -1, -1, 3624, -1, 196, -1, -1, -1, 3630, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2855, -1, -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3669, 3670, 3671, -1, -1, -1, 288, -1, -1, -1, 292, -1, 198, 252, -1, -1, -1, -1, -1, -1, 302, -1, -1, -1, -1, 3694, -1, -1, -1, -1, 312, -1, -1, -1, 3703, -1, 3705, -1, -1, -1, -1, -1, 324, -1, 3713, -1, -1, -1, -1, -1, -1, 1896, -1, -1, -1, 1900, 295, -1, -1, -1, -1, 2944, 248, -1, -1, 196, 3735, -1, -1, 2952, 201, 310, 2955, 25, 313, -1, -1, -1, -1, 31, -1, -1, -1, -1, 2967, 367, 38, -1, 370, 371, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 292, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 402, 252, -1, -1, 76, -1, -1, 10, -1, -1, 13, -1, 3801, -1, 17, 18, 19, -1, -1, 325, -1, -1, -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, 35, -1, -1, -1, 3825, -1, -1, -1, 112, 3830, 45, -1, 295, -1, -1, 3836, 407, 52, -1, -1, -1, -1, -1, -1, 3845, -1, -1, 310, -1, 133, 313, -1, -1, 371, -1, 373, 140, -1, 376, -1, 144, 475, -1, 78, -1, -1, -1, 385, -1, -1, -1, 3872, 3873, -1, -1, -1, 394, 3878, -1, 3880, -1, -1, -1, -1, 402, -1, -1, -1, 172, -1, -1, -1, 3893, -1, 3895, 2072, -1, 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, -1, -1, 429, 726, -1, 3915, -1, -1, -1, -1, -1, 204, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 752, -1, 3941, -1, 513, -1, 407, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 3962, 3963, -1, 535, -1, -1, -1, 486, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, 196, -1, 267, 3985, -1, 201, -1, 272, -1, -1, 52, -1, -1, -1, 35, -1, -1, -1, -1, -1, 3216, -1, 4004, 288, 45, -1, -1, 292, 224, 225, -1, 52, -1, -1, -1, -1, -1, 302, -1, -1, -1, -1, -1, -1, -1, -1, -1, 312, -1, -1, -1, 4033, -1, -1, -1, 4037, 252, 78, 323, 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, 4058, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 4074, -1, -1, 4077, -1, -1, -1, 295, -1, 4083, 367, -1, 899, 370, 371, 372, -1, -1, -1, -1, -1, -1, 310, 4097, -1, 313, -1, 4101, 4102, 4103, -1, -1, -1, -1, 4108, -1, -1, 4111, -1, 396, 4114, -1, -1, -1, -1, 402, 4120, -1, 4122, -1, -1, 4125, -1, -1, -1, 4129, 4130, 4131, 4132, 4133, 417, -1, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, -1, -1, -1, 4149, 4150, 4151, -1, -1, 4154, -1, -1, 196, -1, 4159, -1, -1, 201, -1, 4164, -1, 4166, -1, 4168, -1, -1, -1, -1, -1, -1, -1, 4176, -1, -1, 4179, -1, 4181, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, 475, 407, -1, -1, -1, 4197, -1, -1, 4200, 4201, -1, -1, -1, 4205, 4206, -1, -1, -1, 4210, -1, 4212, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3439, -1, 3441, -1, -1, 1043, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 4241, -1, 3457, 17, 18, 19, 4247, -1, 1062, -1, -1, -1, -1, -1, 4255, 295, -1, -1, 4259, 1073, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, 310, 45, -1, 313, -1, 1089, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4292, 3507, 3508, -1, -1, -1, -1, 513, 4300, -1, -1, -1, -1, 78, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, 4326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 407, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4388, -1, -1, 25, 35, 4393, 4394, 4395, -1, 31, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4421, 4422, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 1253, -1, 76, -1, -1, 2621, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4467, -1, -1, 4470, -1, -1, -1, 513, -1, -1, -1, -1, 252, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, 133, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4534, -1, -1, 310, 172, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, 4560, 4561, -1, -1, 4564, -1, -1, -1, -1, -1, -1, 4571, -1, -1, 208, -1, -1, -1, 4578, 4579, -1, 224, 225, -1, -1, -1, -1, -1, 4588, -1, -1, -1, 2768, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 4611, -1, -1, -1, -1, 4616, 4617, 4618, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4628, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2824, -1, -1, -1, 295, -1, 288, -1, -1, -1, 292, 3873, -1, -1, -1, -1, -1, -1, 726, 310, 302, -1, 313, 4671, -1, 25, -1, -1, -1, -1, 312, 31, -1, -1, 3896, -1, 4684, -1, -1, 4687, -1, -1, 324, -1, 752, -1, -1, -1, -1, -1, -1, -1, -1, 1514, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4713, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, 4729, -1, -1, -1, 367, 2910, -1, 370, 371, -1, -1, 513, -1, -1, -1, -1, -1, -1, 4747, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 2934, -1, -1, -1, 535, -1, 407, -1, -1, -1, 402, 1582, -1, 52, -1, -1, -1, 4775, -1, -1, 4778, -1, -1, 133, -1, -1, -1, -1, 4786, 4787, 140, 4789, -1, -1, 144, 4793, 4794, -1, -1, -1, 4798, -1, -1, -1, -1, 4803, -1, -1, 4806, 4807, -1, -1, 1623, -1, -1, 4813, -1, -1, -1, -1, -1, -1, 172, -1, 2998, -1, -1, -1, 3002, -1, -1, -1, -1, -1, -1, -1, -1, 4835, -1, -1, -1, 899, -1, 475, 4842, 1656, -1, -1, -1, 4847, -1, 4063, 4850, 4851, -1, -1, -1, -1, 208, -1, 4858, -1, -1, -1, -1, 3039, -1, 3041, -1, 3043, 3044, 4869, 513, 4871, 3048, 3049, 3050, -1, 3052, 3053, 3054, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 4893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4906, -1, 25, -1, -1, 4911, -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, 1735, 1736, 1737, -1, -1, -1, -1, -1, 3106, 8, -1, -1, -1, -1, 288, 14, 15, -1, 292, -1, -1, 20, -1, 22, 4946, -1, 23, -1, 302, 28, -1, 28, 31, 3131, -1, -1, -1, 76, 312, -1, -1, 4963, -1, -1, -1, -1, 4968, -1, -1, -1, 324, 50, 51, 4975, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4991, -1, -1, -1, -1, -1, -1, 4998, -1, -1, -1, 1062, -1, 79, 80, -1, -1, -1, 5009, -1, -1, -1, 1073, -1, 367, 133, -1, 370, 371, -1, 96, -1, 140, -1, -1, -1, 144, -1, 1089, -1, -1, -1, -1, 1847, -1, -1, -1, -1, 114, 5040, -1, -1, -1, -1, 1858, -1, -1, -1, -1, 402, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, 1874, -1, 138, -1, -1, 5066, -1, -1, 25, -1, -1, -1, -1, -1, 31, 151, -1, -1, -1, -1, -1, 5082, -1, -1, 160, -1, 5087, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, 179, -1, 5106, -1, -1, -1, -1, -1, -1, 5113, -1, 1928, -1, -1, -1, -1, 76, -1, -1, 475, 201, -1, -1, -1, 205, -1, 1943, 206, -1, 1946, 1947, -1, 213, -1, -1, 216, -1, -1, 219, 220, -1, 222, -1, 224, -1, -1, 227, -1, 229, -1, -1, -1, -1, -1, -1, 5159, -1, 5161, -1, -1, 1977, 1978, -1, -1, -1, 244, -1, 288, -1, -1, -1, 292, -1, 133, -1, -1, 4394, 25, -1, -1, 140, 302, -1, 31, 144, -1, -1, 266, -1, 1253, -1, 312, -1, -1, -1, -1, -1, -1, -1, 5203, -1, -1, -1, 324, 4422, -1, -1, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, 5229, -1, -1, 76, 4447, -1, -1, -1, -1, -1, 5239, -1, -1, 5242, -1, -1, 5245, 5246, 5247, -1, -1, 367, -1, 208, 370, 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3441, 2079, -1, -1, -1, 5270, 5271, 347, 348, 5274, -1, 351, -1, -1, -1, 2093, -1, -1, 2096, -1, 402, -1, -1, -1, 133, -1, 5291, -1, -1, -1, 5295, 140, -1, -1, -1, 144, 5301, -1, 52, 379, 5305, -1, 382, 2121, 4523, 4524, 5311, 5312, -1, 389, -1, -1, -1, -1, -1, -1, 396, -1, 5323, 399, 5325, -1, -1, 172, -1, -1, -1, 288, -1, -1, -1, 292, -1, -1, -1, -1, -1, -1, -1, 419, -1, 302, 5347, -1, -1, -1, -1, 427, 1413, -1, -1, 312, -1, 475, 434, -1, -1, 437, -1, 208, -1, -1, 442, 324, -1, -1, -1, 5372, 5373, -1, -1, -1, -1, -1, -1, -1, -1, 457, 5383, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 4611, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 484, -1, 367, 3588, -1, 370, 371, 35, -1, -1, -1, -1, -1, -1, 5423, -1, -1, 45, -1, 5428, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288, 726, 402, -1, 292, -1, -1, 52, -1, -1, 1514, -1, -1, -1, 302, 78, -1, -1, -1, -1, -1, 4679, -1, -1, 312, -1, -1, 752, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, -1, 5489, -1, -1, 5492, -1, -1, -1, -1, -1, -1, 3675, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5518, 475, 5520, -1, 1582, 367, -1, -1, 370, 371, -1, -1, -1, -1, -1, 5533, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5550, -1, -1, -1, 5554, -1, 5556, 3733, 402, -1, -1, -1, -1, 1623, -1, -1, -1, -1, -1, -1, 5570, -1, -1, -1, -1, -1, -1, 196, 5578, -1, -1, 5581, 201, -1, -1, -1, -1, 664, -1, -1, -1, -1, 5592, -1, -1, -1, 1656, -1, 675, 5599, -1, -1, 679, -1, -1, 224, 225, -1, -1, 686, 687, -1, -1, 690, -1, 692, 693, -1, 899, -1, -1, -1, -1, -1, -1, -1, -1, 3803, -1, -1, 707, 475, -1, 252, -1, -1, -1, -1, -1, -1, -1, 5641, -1, -1, -1, -1, -1, 5647, 725, -1, -1, -1, 5652, 5653, -1, -1, -1, 5657, -1, -1, -1, -1, -1, 5663, 5664, 5665, -1, -1, -1, 746, -1, 748, -1, -1, -1, 3851, 295, -1, -1, 5679, -1, 758, -1, -1, -1, -1, -1, 3863, 3864, -1, -1, 310, -1, -1, 313, -1, -1, 3873, -1, 5699, -1, -1, 3878, -1, 3880, -1, -1, 5707, -1, -1, 5710, -1, -1, -1, 4928, 792, -1, -1, -1, -1, 4934, -1, -1, -1, -1, 4939, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5735, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3926, -1, 4966, 4967, -1, -1, -1, 4971, 4972, -1, -1, -1, -1, -1, -1, 5765, 5766, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1062, -1, -1, -1, 3961, 3962, 1847, 407, -1, -1, 2604, 1073, -1, 5794, 5795, -1, -1, 1858, 876, -1, 62, -1, -1, -1, -1, 5806, -1, 1089, -1, -1, -1, -1, -1, 1874, 5815, 5816, 5817, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5830, 5831, -1, -1, 5834, -1, -1, 98, -1, 5839, -1, 5841, -1, 5843, -1, -1, -1, -1, -1, -1, -1, 5851, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1928, -1, 5870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1943, 961, -1, 1946, 1947, -1, -1, -1, -1, -1, -1, 513, 5895, -1, -1, 5898, -1, 161, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 1977, 1978, -1, -1, -1, -1, -1, -1, -1, -1, 2740, -1, -1, -1, 2744, 2745, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5951, -1, -1, -1, -1, -1, -1, 1035, -1, -1, -1, -1, 5963, -1, -1, -1, -1, -1, -1, -1, -1, 1253, -1, -1, -1, -1, 726, -1, -1, -1, -1, -1, 1060, -1, -1, 2799, 248, -1, -1, -1, -1, 2805, -1, -1, -1, -1, -1, 1075, 4175, 1077, -1, -1, 752, -1, -1, -1, -1, 6008, -1, 1087, -1, -1, -1, -1, -1, -1, 1094, -1, -1, -1, -1, -1, 6023, -1, -1, -1, 288, -1, -1, -1, 292, -1, 6033, -1, -1, -1, -1, -1, 2852, -1, -1, -1, 6043, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6057, -1, -1, 1137, 2121, 1139, 324, 325, -1, 10, -1, -1, 13, 6070, -1, 333, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, 367, -1, 52, -1, 371, -1, 6112, -1, -1, 376, -1, -1, -1, -1, 10, -1, 6122, 13, 385, 726, -1, 17, 18, 19, -1, 6131, 6132, 394, 78, -1, -1, 6137, 1215, -1, 1217, 402, 1219, -1, 1221, 35, 1223, 1224, 1225, -1, 899, 752, -1, 1230, 415, 45, -1, -1, 5372, -1, -1, -1, 52, 424, -1, 1242, -1, -1, 429, -1, -1, 6171, 6172, -1, 10, 6175, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 6211, -1, -1, -1, -1, 52, 3030, 4394, -1, -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, 1514, -1, 6235, -1, -1, -1, -1, -1, 6241, 78, -1, -1, -1, 4422, -1, -1, 3062, -1, -1, 196, -1, -1, -1, -1, 201, -1, 6259, -1, 4437, -1, -1, 4440, -1, 4442, 6267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 6283, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 899, -1, 6300, 1582, -1, -1, -1, -1, 196, -1, 252, -1, -1, 201, 4488, 1062, -1, -1, -1, -1, -1, -1, -1, -1, 3135, -1, 1073, -1, 3139, -1, 4504, -1, -1, -1, -1, 4509, 224, 225, -1, -1, -1, 6339, 1089, -1, 1623, -1, 6344, -1, -1, -1, -1, -1, 6350, 295, -1, -1, -1, -1, -1, -1, 1435, -1, 196, -1, 252, 6363, -1, 201, 310, -1, -1, 313, 6370, -1, -1, -1, -1, 1656, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 295, -1, -1, 6408, 6409, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, 310, -1, -1, 313, -1, 6425, -1, -1, -1, 6429, -1, 3244, 4608, -1, -1, 4611, -1, 98, -1, -1, -1, -1, 6442, 6443, -1, -1, 3259, -1, -1, -1, -1, 3264, -1, -1, 6454, -1, -1, -1, -1, 295, -1, 1062, -1, 407, -1, 5679, -1, -1, -1, -1, -1, -1, 1073, -1, 310, -1, -1, 313, -1, 1556, -1, 3294, -1, -1, -1, -1, -1, -1, 1089, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 161, -1, -1, -1, 1253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, 4702, 4703, 4704, 4705, -1, 4707, 4708, 4709, 4710, 4711, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1628, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1847, -1, -1, 513, -1, 407, -1, -1, -1, -1, -1, 1858, 522, 523, 524, 525, 526, 527, 528, 529, 530, 248, -1, -1, -1, 535, -1, 1874, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, 288, -1, -1, -1, 292, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, 1928, -1, 4825, -1, 4827, 1253, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1943, 324, 325, 1946, 1947, -1, -1, -1, -1, -1, 333, 5887, -1, -1, -1, 513, -1, -1, 2740, -1, -1, -1, 2744, 2745, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 1977, 1978, -1, 535, -1, -1, -1, -1, -1, -1, 367, -1, -1, -1, 371, -1, -1, -1, -1, 376, -1, -1, -1, -1, -1, -1, -1, -1, 385, -1, 3539, -1, -1, 3542, -1, 3544, -1, 394, -1, -1, 3549, -1, -1, 2799, -1, 402, -1, -1, -1, 2805, -1, -1, -1, -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, 10, 1514, 1843, 13, 429, -1, -1, 17, 18, 19, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, 3599, -1, -1, 35, -1, -1, 2852, -1, -1, -1, -1, -1, -1, 45, -1, 1878, -1, -1, -1, -1, 52, -1, -1, -1, -1, 3624, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 486, 17, 18, 19, -1, -1, -1, 78, 1582, -1, -1, -1, -1, -1, -1, 2121, -1, -1, -1, 35, -1, -1, 1924, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 5038, 5039, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, 1623, 5051, -1, 5053, 5054, 5055, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, 3703, -1, 3705, 1970, -1, 1972, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1656, -1, -1, 1987, -1, 1989, 1514, -1, -1, -1, -1, -1, -1, 1997, -1, 1999, -1, 2001, -1, 2003, -1, 2005, -1, -1, -1, 2009, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5119, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2046, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 1582, 5158, -1, -1, -1, -1, -1, 3801, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3062, -1, -1, 196, 252, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, 3830, -1, -1, -1, -1, 1623, 3836, -1, -1, -1, -1, -1, -1, -1, -1, 3845, 224, 225, -1, 5212, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, 726, -1, -1, 1656, -1, -1, -1, -1, 3873, 252, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, 3135, -1, -1, 752, 3139, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1847, -1, -1, -1, -1, -1, 295, 10, -1, -1, 13, 1858, -1, -1, 17, 18, 19, -1, -1, -1, -1, 310, -1, -1, 313, -1, 98, 1874, -1, -1, 3941, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, 3963, 52, -1, -1, -1, -1, 6370, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3985, 78, -1, -1, -1, -1, -1, 1928, -1, -1, -1, -1, 3244, -1, -1, 161, -1, -1, -1, -1, -1, -1, 1943, -1, 5372, 1946, 1947, 3259, -1, -1, -1, -1, 3264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6429, 407, -1, -1, -1, -1, -1, -1, -1, 198, 899, -1, -1, 1977, 1978, -1, -1, -1, -1, 3294, -1, -1, -1, -1, -1, 6454, -1, 5418, -1, -1, -1, 1847, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1, 1858, -1, -1, -1, -1, -1, -1, 4077, -1, -1, 513, -1, -1, -1, -1, -1, 1874, 248, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, 4129, -1, 292, 224, 225, -1, 513, -1, -1, -1, -1, 1928, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 4154, 1943, -1, 535, 1946, 1947, 252, -1, -1, 324, 325, -1, -1, -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2121, -1, -1, -1, 1977, 1978, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1062, -1, 295, -1, -1, 367, -1, -1, -1, 371, -1, 1073, -1, -1, 376, -1, -1, 310, -1, -1, 313, -1, -1, 385, -1, -1, -1, 1089, -1, -1, -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 415, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, 10, -1, 429, 13, -1, -1, 2740, 17, 18, 19, 2744, 2745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 3539, -1, 38, 3542, -1, 3544, -1, -1, 4300, 45, 3549, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, 407, 5679, -1, -1, -1, 5683, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, 2799, -1, 2121, 78, -1, -1, 2805, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3624, -1, -1, -1, -1, -1, 35, 2852, -1, -1, -1, -1, -1, -1, -1, 1253, 45, 4394, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 4422, -1, -1, -1, 78, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 3703, 201, 3705, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2734, 2735, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, 2753, 2754, -1, 2756, 2757, -1, -1, -1, 2761, 2762, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, 2776, -1, -1, -1, 2780, -1, -1, -1, 2784, 2785, -1, -1, 2788, 2789, -1, -1, -1, -1, -1, 2795, -1, -1, -1, 5898, -1, -1, -1, 5902, -1, 5904, -1, 2807, 196, 5908, 5909, -1, -1, 201, -1, 295, -1, -1, 3801, 2819, -1, -1, -1, -1, 2824, -1, -1, -1, 4564, -1, 310, -1, -1, 313, -1, -1, 224, 225, -1, 2839, -1, -1, -1, 2843, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2854, -1, -1, 2857, 3062, 2859, 2860, 2861, 3845, -1, 252, -1, 2866, 2867, -1, -1, -1, -1, -1, -1, -1, 4611, 2876, -1, -1, -1, 4616, -1, 2882, -1, -1, -1, 2886, -1, -1, -1, 3873, -1, -1, -1, -1, -1, -1, -1, 2898, 2899, -1, -1, 726, 2903, -1, -1, -1, 295, -1, 2909, 2910, -1, -1, -1, -1, -1, -1, 1514, -1, -1, -1, -1, 310, 2923, -1, 313, 2926, 407, 752, -1, -1, 3135, -1, 2933, 2934, 3139, -1, 10, -1, 2939, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 2951, -1, -1, 2954, -1, -1, -1, 3941, 2959, -1, -1, 35, -1, -1, 2965, 2966, -1, -1, -1, -1, -1, 45, 2973, -1, -1, -1, 2977, -1, 52, 3963, 2981, 2982, 2983, 2984, 1582, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3000, 3001, 3985, 3003, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 3014, 3015, 3016, -1, -1, 407, -1, -1, -1, -1, -1, -1, 1623, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, 3244, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 4789, -1, 3259, -1, -1, -1, 1656, 3264, -1, -1, -1, -1, -1, -1, -1, 2740, -1, -1, 3071, 2744, 2745, -1, 899, -1, -1, -1, 3079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3294, -1, -1, -1, 4077, -1, -1, -1, 3098, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, 513, -1, 2799, 201, -1, -1, -1, -1, 2805, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 4129, 535, 3148, -1, -1, 224, 225, -1, -1, -1, -1, 4893, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3167, -1, 3169, -1, 4154, -1, -1, 52, -1, -1, -1, -1, 252, 2852, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4946, -1, -1, 35, -1, -1, 2740, -1, -1, -1, 2744, 2745, 295, 45, -1, -1, -1, -1, -1, -1, 52, -1, 4968, -1, -1, -1, -1, 310, 1062, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, 1073, 1847, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 1858, -1, -1, -1, 1089, 3266, -1, -1, -1, -1, 6370, -1, -1, -1, 2799, -1, 1874, 6377, -1, -1, 2805, 6381, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5040, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6415, 4300, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2852, -1, 6429, 1928, -1, -1, 407, 3539, -1, -1, 3542, -1, 3544, -1, -1, -1, -1, 3549, 1943, -1, -1, 1946, 1947, -1, -1, -1, -1, 6454, -1, -1, 6457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 1977, 1978, -1, -1, -1, -1, -1, 3591, -1, -1, 3062, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, 4394, -1, -1, -1, -1, -1, -1, -1, -1, 3624, -1, -1, 5159, -1, 5161, -1, -1, -1, 1253, 252, -1, -1, -1, -1, -1, -1, -1, -1, 4422, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, 3135, -1, -1, -1, 3139, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, 3703, -1, 3705, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2121, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3062, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3244, -1, -1, 5311, -1, -1, -1, -1, -1, 4564, -1, -1, -1, 407, 3586, 3259, -1, -1, -1, -1, 3264, -1, -1, -1, -1, 3801, -1, -1, -1, -1, -1, 3603, -1, -1, -1, 3607, -1, -1, -1, 3135, 3612, 3613, 3614, 3139, -1, -1, -1, -1, -1, -1, 3294, -1, -1, -1, -1, -1, 4611, -1, -1, -1, -1, 4616, 3634, -1, 5372, -1, -1, -1, -1, 3845, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 3657, 3658, 3659, 3660, -1, -1, -1, -1, -1, -1, -1, -1, 3873, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, 1514, 513, -1, -1, -1, 3695, -1, 3697, 3698, 3699, 522, 523, 524, 525, 526, 527, 528, 529, 530, 10, -1, -1, 13, 535, -1, 78, 17, 18, 19, -1, 3244, -1, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, 217, 3259, -1, 3941, -1, -1, 3264, -1, -1, -1, 45, -1, -1, -1, 231, -1, -1, 52, -1, -1, -1, -1, 5492, -1, 1582, 3963, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3294, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, 3985, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1623, -1, -1, -1, -1, -1, -1, 4789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3817, -1, -1, -1, -1, -1, -1, -1, -1, 3826, -1, -1, -1, -1, -1, 1656, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, 726, -1, -1, -1, 3852, 3853, -1, -1, -1, 3857, -1, -1, -1, 224, 225, -1, -1, -1, -1, 3539, -1, -1, 3542, -1, 3544, 4077, 752, -1, -1, 3549, -1, 3879, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4893, 5647, -1, -1, -1, -1, 5652, 5653, -1, 3591, -1, -1, -1, 224, 225, 4129, -1, 3599, -1, -1, -1, 3931, 295, -1, -1, -1, 3936, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, 310, -1, -1, 4154, 252, 3624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4946, -1, -1, -1, -1, -1, -1, -1, -1, 3972, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, 4001, -1, 4003, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, -1, 3539, -1, -1, 3542, -1, 3544, 899, -1, 1847, -1, 3549, -1, -1, -1, 5765, 5766, 3703, -1, 3705, 1858, -1, -1, -1, -1, -1, -1, -1, -1, 726, 407, -1, -1, -1, -1, -1, 1874, -1, -1, -1, -1, -1, -1, 5040, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, 752, -1, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4300, -1, 5834, -1, 3624, -1, -1, -1, 1928, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1943, -1, -1, 1946, 1947, -1, -1, -1, -1, -1, 3801, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2740, -1, -1, -1, 2744, 2745, -1, 513, -1, -1, 1977, 1978, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, 3845, -1, -1, -1, -1, 5161, 3703, -1, 3705, -1, -1, 1062, -1, -1, -1, -1, -1, 4394, -1, -1, -1, -1, 1073, -1, -1, -1, 682, -1, 3873, 2799, -1, -1, 688, -1, -1, 2805, -1, -1, 1089, 513, -1, -1, -1, 899, 700, 4422, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2852, 199, 200, -1, -1, 203, -1, -1, -1, -1, -1, -1, -1, -1, 3941, -1, -1, -1, -1, -1, -1, -1, 3801, -1, -1, 223, -1, -1, -1, -1, -1, -1, 230, -1, -1, -1, 3963, -1, -1, -1, -1, -1, 2121, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 4312, 3985, 4314, -1, -1, -1, -1, -1, -1, 3845, -1, 35, -1, -1, -1, 4327, 5311, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 4339, 52, -1, -1, 4343, -1, -1, -1, -1, -1, 3873, -1, -1, -1, -1, 4354, -1, -1, -1, -1, -1, 4564, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 4373, -1, 1253, -1, -1, -1, 1062, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5372, 1073, 4391, -1, -1, -1, -1, -1, -1, -1, 4399, -1, -1, -1, -1, -1, 4077, 1089, 4611, -1, -1, -1, -1, 4616, -1, -1, -1, -1, 3941, -1, -1, -1, -1, -1, -1, 4424, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3963, -1, -1, -1, 4443, 4444, 4445, 4446, -1, -1, -1, -1, -1, -1, 4453, 4454, 4455, 4456, 4129, -1, -1, -1, 3985, 4462, 4463, -1, 3062, -1, -1, 4468, 4469, -1, 4471, 4472, 4473, 4474, 4475, 4476, 4477, -1, -1, -1, -1, 4154, -1, 196, -1, -1, 4487, -1, 201, -1, 4491, 4492, 4493, 4494, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5492, -1, -1, 224, 225, -1, 4515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4533, -1, -1, -1, -1, 3135, -1, 252, -1, 3139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1253, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, 4789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, 4129, -1, -1, 6344, 4609, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4300, -1, 4154, -1, -1, -1, -1, -1, 1514, -1, -1, -1, -1, -1, 4642, -1, -1, -1, -1, 3244, -1, 4649, -1, 4651, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3259, -1, 5647, -1, -1, 3264, -1, 5652, 5653, -1, 6408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4893, -1, -1, -1, -1, 4694, 407, -1, 3294, -1, -1, -1, -1, -1, -1, 1582, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4394, -1, -1, -1, -1, -1, -1, 672, -1, 674, -1, -1, 677, -1, -1, -1, -1, -1, -1, -1, 4946, -1, -1, 1623, -1, -1, 691, -1, 4422, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4300, -1, 1656, -1, -1, -1, -1, 5766, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, 1514, -1, -1, -1, -1, 5040, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 5834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, 4394, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4564, -1, 4894, 4895, 4896, -1, 4422, 1582, 4900, 4901, 4902, 4903, -1, -1, 78, 4907, -1, -1, -1, -1, -1, -1, -1, -1, 2740, -1, -1, -1, 2744, 2745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4611, 1623, -1, 3539, -1, 4616, 3542, -1, 3544, -1, -1, -1, -1, 3549, -1, -1, -1, -1, 5161, 4958, 4959, 4960, 4961, 4962, -1, 4964, 4965, -1, -1, -1, 1847, -1, -1, -1, 1656, -1, 2799, 4976, 4977, -1, -1, 1858, 2805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, 1874, -1, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, -1, -1, 5010, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, 3624, 2852, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4564, -1, -1, -1, -1, 988, 989, -1, -1, -1, 1928, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1943, -1, -1, 1946, 1947, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, 4611, -1, -1, -1, -1, 4616, -1, -1, -1, -1, -1, -1, 1977, 1978, -1, -1, -1, 28, -1, 3703, 5311, 3705, -1, -1, -1, 5112, -1, -1, -1, 1059, 4789, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 1074, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, 1105, 1106, 1847, -1, -1, -1, 5372, -1, -1, -1, 96, -1, -1, 1858, -1, 5177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1131, -1, 114, 1874, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, -1, -1, 3801, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, 5220, 4893, -1, -1, -1, -1, -1, 151, 1171, 1172, -1, -1, -1, -1, -1, 407, 160, 1720, 3062, -1, -1, -1, -1, 2121, -1, 1928, -1, -1, 3845, 173, -1, -1, -1, -1, -1, 179, -1, -1, -1, -1, 1943, -1, 186, 1946, 1947, 4789, -1, -1, -1, -1, -1, -1, -1, -1, 4946, -1, 3873, -1, -1, -1, -1, -1, 206, -1, -1, -1, -1, -1, 5492, -1, -1, -1, -1, -1, 1977, 1978, 4968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3135, -1, -1, -1, 3139, -1, -1, 5318, -1, 244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 266, -1, 3941, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 6344, -1, 535, -1, -1, 3963, -1, 5040, 4893, -1, -1, -1, 10, 5374, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 310, -1, 3985, -1, -1, -1, -1, 5393, -1, -1, -1, -1, 35, 5399, 5400, -1, -1, -1, -1, -1, -1, -1, 45, 5409, 1893, -1, -1, 337, -1, 52, 5416, -1, 1901, -1, 3244, -1, 4946, 347, 348, -1, 1909, 351, -1, -1, -1, -1, -1, -1, -1, 3259, -1, -1, 2121, -1, 3264, 78, -1, 5647, 4968, -1, -1, -1, 5652, 5653, -1, 5451, 5452, -1, -1, 379, -1, -1, 382, -1, -1, -1, 386, -1, 5464, 389, 5466, -1, -1, -1, 3294, 1954, 396, -1, -1, 399, -1, -1, -1, -1, 4077, 5481, -1, -1, -1, -1, -1, -1, -1, 5161, -1, -1, -1, -1, -1, 419, -1, -1, 1981, -1, -1, -1, -1, 427, -1, -1, 5506, -1, 432, -1, 434, -1, -1, 437, -1, -1, 5040, -1, 442, -1, -1, -1, -1, -1, 5524, -1, -1, -1, 452, -1, -1, -1, 4129, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 471, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4154, -1, 196, 484, -1, 5766, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 207, 208, -1, -1, -1, -1, -1, -1, 215, -1, 217, 218, 252, -1, -1, -1, -1, -1, -1, 5622, -1, -1, -1, -1, 231, -1, -1, 5834, -1, 1575, -1, -1, -1, -1, 5161, -1, 5311, -1, -1, -1, -1, -1, -1, 5646, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1600, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 5372, -1, -1, 4300, -1, -1, -1, -1, -1, -1, -1, 35, -1, 5713, -1, 3539, -1, -1, 3542, -1, 3544, 45, -1, -1, -1, 3549, -1, -1, 52, -1, -1, -1, -1, -1, 1677, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 1706, 1707, 1708, 1709, 3591, -1, -1, 407, -1, -1, -1, -1, 3599, -1, -1, -1, -1, -1, -1, -1, -1, 5784, -1, -1, 5311, 5788, -1, -1, -1, -1, -1, -1, -1, -1, 4394, -1, -1, 3624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5492, -1, -1, 5823, -1, 4422, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5372, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5858, -1, -1, -1, 2740, -1, -1, -1, 2744, 2745, -1, -1, -1, -1, 196, -1, -1, -1, 513, 201, -1, 3703, -1, 3705, 5882, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, 1853, 1854, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2799, -1, -1, -1, -1, 1869, 2805, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5942, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1903, 1904, 1905, 1906, -1, -1, -1, 4564, 5492, -1, -1, 295, -1, -1, 2852, 5647, -1, 3801, -1, -1, 5652, 5653, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4611, -1, -1, -1, -1, 4616, -1, 3845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1984, -1, -1, -1, -1, -1, 1990, -1, 3873, -1, -1, -1, -1, -1, -1, 6056, 2740, -1, 663, -1, 2744, 2745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 682, -1, -1, -1, -1, 407, 688, -1, -1, -1, -1, 6089, -1, -1, -1, -1, 5766, -1, 700, -1, -1, -1, 6100, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 716, 17, 18, 19, 2799, 3941, -1, -1, -1, -1, 2805, 5647, -1, -1, 730, 731, 5652, 5653, -1, 35, -1, 737, -1, 739, 740, -1, -1, 3963, 6344, 45, -1, -1, -1, -1, -1, -1, 52, 753, -1, -1, -1, -1, -1, -1, -1, -1, -1, 763, -1, 3985, 5834, -1, -1, -1, -1, -1, -1, 2852, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3062, -1, -1, -1, -1, 513, -1, -1, 4789, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 535, -1, -1, -1, -1, 820, -1, -1, -1, -1, -1, -1, -1, -1, 6225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2180, -1, -1, -1, -1, 5766, -1, 848, -1, -1, -1, -1, -1, 2733, -1, -1, 4077, -1, -1, -1, 3135, -1, -1, -1, 3139, -1, -1, -1, -1, -1, -1, 2751, 873, -1, -1, 2755, -1, -1, -1, 2759, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 4893, 201, -1, -1, 2783, -1, -1, -1, -1, 4129, -1, -1, -1, -1, 5834, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, 4154, 935, -1, -1, 2817, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, 4946, -1, -1, -1, -1, 2837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3244, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, 3062, -1, 3259, -1, -1, -1, -1, 3264, -1, -1, -1, -1, 295, 2875, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, 10, 3294, -1, 13, 2902, -1, -1, 17, 18, 19, 2908, -1, -1, -1, -1, -1, -1, 6432, -1, -1, -1, -1, -1, -1, 2922, 35, 1045, -1, 5040, -1, -1, 2929, -1, 1052, 2932, 45, -1, 3135, -1, -1, 2938, 3139, 52, -1, 1063, -1, -1, -1, 1067, -1, 1069, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2958, 4300, 23, -1, -1, -1, 2964, 28, 78, -1, -1, -1, -1, 2971, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2985, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2999, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 3010, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3244, -1, -1, 5161, -1, -1, -1, 114, -1, 4394, -1, 1176, -1, -1, -1, 3259, -1, -1, -1, -1, 3264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, 4422, -1, -1, 196, -1, -1, -1, 151, 201, -1, -1, 513, -1, 3294, -1, -1, 160, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 173, -1, 224, 225, 535, -1, 179, -1, 1239, -1, -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1255, -1, -1, -1, -1, -1, 252, -1, -1, 206, 3539, -1, -1, 3542, -1, 3544, -1, 1272, -1, -1, 3549, 6344, 1277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, 2645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, 5311, 310, -1, -1, 313, -1, 266, 3599, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4564, -1, -1, -1, 3227, -1, 3624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3246, 310, -1, -1, -1, -1, -1, 3253, -1, -1, -1, -1, 5372, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4611, -1, -1, 208, 337, 4616, -1, -1, -1, -1, -1, -1, 217, -1, 347, 348, -1, -1, 351, 1410, -1, -1, -1, -1, -1, 407, 231, 1418, 1419, -1, -1, -1, -1, 6344, -1, -1, -1, -1, 3703, -1, 3705, -1, -1, -1, -1, -1, 379, -1, -1, 382, -1, -1, -1, 386, -1, -1, 389, -1, -1, -1, -1, -1, -1, 396, -1, -1, 399, -1, -1, 3539, -1, -1, 3542, -1, 3544, -1, 2806, -1, -1, 3549, 1471, 10, -1, -1, 13, -1, 419, -1, 17, 18, 19, -1, -1, -1, 427, -1, -1, -1, -1, -1, -1, 434, -1, -1, 437, -1, 35, -1, 5492, 442, -1, -1, -1, -1, -1, -1, 45, 450, -1, 452, -1, 3591, -1, 52, 457, -1, -1, -1, -1, 3599, -1, 513, -1, -1, -1, -1, 3801, -1, 471, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 78, -1, 484, -1, 535, 3624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4789, -1, 3845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, 3873, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 2950, -1, -1, 2953, -1, -1, -1, -1, -1, -1, -1, 35, -1, 3703, -1, 3705, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5647, -1, -1, -1, 196, 5652, 5653, -1, -1, 201, -1, 78, -1, 3941, -1, -1, -1, -1, -1, 4893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 3963, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3042, -1, -1, 3585, -1, -1, -1, -1, 3985, -1, -1, 252, -1, 3055, -1, -1, -1, 1720, -1, 3801, -1, 3063, -1, 4946, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, 35, -1, -1, 295, -1, -1, -1, -1, -1, 3102, 45, -1, 3845, -1, -1, -1, -1, 52, 310, 5766, -1, 313, -1, -1, -1, -1, -1, -1, -1, 196, 3123, -1, -1, -1, 201, -1, -1, -1, -1, -1, 3873, -1, -1, 78, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, 3694, -1, -1, -1, -1, 5040, -1, -1, -1, -1, -1, -1, 3166, -1, 3168, -1, -1, -1, -1, -1, 1835, -1, -1, -1, 252, -1, 5834, -1, -1, -1, -1, -1, -1, -1, 663, -1, -1, -1, -1, -1, 4129, 10, -1, -1, 13, -1, -1, 3941, 17, 18, 19, -1, -1, 682, 407, 1870, -1, -1, -1, 688, -1, -1, -1, -1, -1, 4154, 35, 295, -1, 3963, 39, 700, 10, -1, -1, 13, 45, -1, 1893, 17, 18, 19, 310, 52, -1, 313, 1901, 716, -1, -1, -1, 3985, -1, -1, 1909, -1, -1, 35, -1, -1, 196, -1, 731, -1, 3258, 201, -1, 45, -1, 78, 739, 3265, -1, 341, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 753, -1, 5161, -1, 224, 225, -1, 3825, -1, -1, 763, 1950, 1951, -1, 1953, 1954, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1965, -1, 1967, 1968, -1, -1, 252, -1, -1, -1, 513, 130, -1, -1, -1, 1980, 1981, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 407, -1, -1, 535, 4077, -1, -1, -1, -1, -1, -1, -1, 820, -1, -1, -1, -1, -1, -1, 426, 295, -1, -1, -1, -1, -1, 2020, -1, -1, -1, 2024, 2025, 4300, -1, -1, 310, -1, -1, 313, -1, 848, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 171, -1, 4129, -1, -1, -1, 177, -1, -1, -1, -1, 873, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 196, -1, 4154, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5311, -1, -1, -1, -1, -1, -1, 252, -1, 513, 224, 225, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 4394, 935, -1, -1, -1, 4004, 407, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, 2142, -1, -1, -1, -1, -1, 4422, -1, -1, -1, 5372, -1, 4033, -1, 310, -1, 4037, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4300, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1045, 513, -1, -1, -1, -1, -1, 1052, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 533, 407, -1, 3594, 3595, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 5492, -1, -1, -1, -1, -1, 10, -1, -1, 13, 35, -1, 407, 17, 18, 19, -1, -1, 4564, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 4394, -1, -1, 472, -1, 52, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4611, -1, -1, -1, -1, 4616, 4422, -1, -1, 78, -1, -1, -1, -1, 6344, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, 1176, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, 170, -1, -1, -1, -1, -1, -1, -1, 1239, -1, 5647, -1, -1, -1, -1, 5652, 5653, -1, -1, -1, -1, -1, -1, -1, 1255, -1, 196, -1, -1, -1, 4326, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1272, -1, -1, -1, -1, 1277, 196, -1, -1, -1, -1, 201, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4564, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, 3847, -1, -1, -1, -1, -1, -1, 4789, 10, -1, -1, 13, 252, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, 4611, -1, -1, -1, -1, 4616, -1, -1, -1, 35, 295, -1, -1, -1, 5766, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, 310, 52, -1, 313, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, 78, -1, 339, -1, 4467, -1, -1, 4470, -1, -1, -1, -1, 1410, -1, -1, -1, -1, -1, -1, -1, 1418, 1419, -1, -1, -1, -1, -1, -1, -1, -1, 5834, -1, -1, -1, -1, 4893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, 1471, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4007, -1, -1, -1, 4946, -1, -1, 407, -1, -1, -1, 2679, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4571, -1, 4968, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, 4588, 4789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, 2733, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2751, -1, -1, -1, 2755, -1, -1, 252, 2759, 513, -1, -1, -1, -1, -1, 5040, -1, 2768, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 512, 513, -1, 2783, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 2800, 295, 2802, 2803, -1, 4684, -1, -1, -1, -1, -1, -1, -1, -1, 4893, -1, 310, 2817, -1, 313, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 2837, 2838, -1, 334, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, 4946, -1, 52, -1, -1, -1, -1, 2874, 2875, -1, -1, 2878, -1, -1, -1, -1, -1, -1, -1, -1, 5161, -1, 4968, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, 2902, -1, 2904, -1, 1720, -1, 2908, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, 2922, -1, -1, -1, -1, -1, -1, 2929, -1, -1, 2932, -1, -1, -1, -1, -1, 2938, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2958, -1, -1, 5040, -1, -1, 2964, -1, -1, -1, -1, -1, -1, 2971, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2985, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2999, -1, -1, -1, -1, 3004, -1, -1, -1, -1, -1, 3010, -1, -1, 196, -1, -1, -1, -1, 201, 513, -1, 1835, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 5311, -1, 842, 843, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, 3070, -1, -1, -1, -1, -1, -1, -1, -1, 1893, -1, -1, 5161, -1, 4963, -1, -1, 1901, -1, -1, -1, -1, -1, -1, -1, 1909, 4975, -1, 5372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, 0, -1, -1, -1, -1, 922, -1, -1, -1, -1, 6344, -1, -1, 310, -1, -1, 313, -1, -1, -1, 20, -1, -1, -1, -1, 1953, 1954, -1, -1, -1, -1, 31, -1, 33, 34, -1, -1, -1, -1, 1967, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 1980, 1981, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, 4518, -1, -1, -1, -1, -1, -1, -1, 73, -1, 75, 76, -1, -1, 4532, -1, -1, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, 99, -1, -1, -1, -1, 5492, -1, -1, -1, -1, -1, 407, -1, -1, 3227, -1, 3229, 116, -1, 5311, 119, -1, -1, -1, -1, -1, -1, 1043, 1044, -1, -1, -1, -1, 3246, -1, 134, -1, 136, -1, -1, 3253, 140, -1, -1, -1, -1, -1, 3260, 147, 3262, 3263, -1, -1, -1, -1, -1, -1, 156, -1, 158, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5372, -1, -1, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 200, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5203, -1, -1, -1, 2142, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 3350, -1, -1, -1, -1, -1, 3356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, 255, -1, -1, -1, 5647, 260, -1, -1, -1, 5652, 5653, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, 294, -1, -1, -1, -1, 5492, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, 3441, -1, -1, 5323, -1, 5325, 333, -1, 209, -1, -1, -1, 79, 80, -1, 342, -1, -1, -1, -1, 221, -1, -1, -1, -1, 92, -1, -1, -1, 96, 357, 232, -1, -1, -1, -1, 363, 364, -1, 366, -1, -1, -1, -1, 371, 1289, -1, 114, -1, -1, 377, 5766, -1, 380, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, -1, -1, -1, 394, 395, -1, -1, 138, -1, -1, -1, 402, -1, -1, -1, 406, -1, -1, -1, -1, 151, -1, -1, 1331, -1, -1, 417, -1, -1, 160, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 173, 434, -1, -1, -1, -1, 179, -1, -1, -1, 1360, 1361, 1362, 5834, 1364, -1, -1, 3564, 3565, -1, -1, 5647, 455, -1, -1, -1, 5652, 5653, -1, -1, -1, -1, -1, 206, 467, 1385, -1, -1, 3585, -1, 473, 3588, -1, -1, -1, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 491, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, 244, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 515, -1, 517, 518, 519, 520, 521, -1, -1, -1, 35, 266, -1, -1, -1, -1, -1, -1, -1, 534, 45, -1, 537, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3669, 3670, 3671, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5020, 78, -1, 310, 1488, -1, 5766, -1, 1492, 1493, -1, -1, -1, 3694, -1, 5035, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, 337, -1, 3713, -1, -1, -1, -1, -1, -1, -1, 347, 348, 35, -1, 351, 38, -1, -1, -1, -1, -1, -1, 45, -1, 3735, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, 5834, 382, -1, -1, -1, 386, -1, -1, 389, -1, -1, 78, -1, -1, -1, 396, -1, -1, 399, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, 5126, -1, -1, -1, -1, -1, 419, -1, -1, -1, -1, -1, -1, 196, 427, -1, -1, -1, 201, -1, -1, 434, -1, -1, 437, -1, -1, -1, -1, 442, -1, -1, -1, -1, -1, -1, -1, 450, 3825, 452, -1, 224, 225, -1, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 484, -1, -1, -1, -1, -1, -1, 2679, -1, -1, -1, -1, -1, -1, 3872, -1, -1, -1, -1, -1, 3878, -1, 3880, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, 3893, -1, 3895, -1, -1, -1, 295, -1, -1, -1, -1, 664, -1, -1, -1, -1, -1, 670, -1, 224, 225, 310, -1, -1, 313, -1, 2733, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1735, 1736, 1737, -1, -1, 2751, -1, -1, 252, 2755, -1, -1, -1, 2759, -1, -1, -1, -1, -1, -1, -1, -1, 2768, -1, -1, -1, -1, -1, -1, -1, 3962, -1, -1, -1, -1, -1, -1, 2783, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 310, -1, -1, 313, -1, 2817, 4004, -1, -1, -1, -1, 35, 5349, 407, 5351, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, 2837, 2838, -1, 52, -1, -1, -1, -1, -1, -1, 4033, -1, -1, -1, 4037, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 4058, -1, 2874, 2875, -1, -1, 2878, -1, -1, -1, -1, -1, 6344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 845, -1, -1, 2902, -1, 2904, -1, -1, -1, 2908, 407, -1, -1, -1, -1, -1, -1, -1, -1, 864, -1, -1, -1, 2922, -1, -1, -1, -1, -1, -1, 2929, -1, 513, 2932, -1, -1, -1, -1, -1, 2938, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2958, -1, -1, -1, 5487, -1, 2964, -1, -1, -1, -1, -1, -1, 2971, -1, -1, -1, -1, -1, -1, 6043, -1, 4166, -1, -1, -1, 196, 2985, -1, -1, -1, 201, 936, -1, -1, -1, -1, -1, -1, -1, -1, 2999, -1, -1, -1, -1, 3004, -1, -1, -1, -1, -1, 3010, -1, 224, 225, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 983, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3070, -1, -1, -1, -1, -1, 23, 2066, -1, 6344, -1, 28, -1, 295, -1, -1, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, -1, -1, 310, -1, 2089, 313, 2091, -1, 2093, -1, -1, 2096, 2097, 2098, -1, -1, -1, -1, -1, 2104, -1, -1, 2107, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, 2122, 2123, 2124, -1, -1, -1, -1, 4326, -1, -1, -1, 5669, -1, 5671, -1, -1, 96, -1, 2140, 1098, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1127, 1128, 1129, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, 4388, -1, 151, -1, -1, 4393, -1, 4395, -1, -1, 10, 160, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, 173, 3227, -1, 3229, -1, 443, 179, -1, -1, 4421, -1, 35, -1, -1, 38, -1, -1, -1, -1, -1, 3246, 45, -1, -1, -1, -1, -1, 3253, 52, -1, -1, -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, 4467, -1, -1, 4470, -1, -1, -1, -1, -1, -1, -1, 1238, -1, -1, -1, -1, -1, 2287, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 266, -1, -1, -1, -1, -1, 1271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3350, -1, 2341, -1, -1, -1, 3356, -1, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4560, 4561, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4571, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, 347, 348, 4588, 201, 351, -1, -1, -1, 2397, -1, -1, -1, 5937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, 379, -1, -1, 382, -1, -1, -1, -1, -1, 3441, 389, -1, -1, -1, -1, -1, -1, 396, -1, -1, 399, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 419, -1, -1, -1, -1, -1, 1424, -1, 427, -1, -1, -1, -1, -1, -1, 434, -1, -1, 437, -1, -1, -1, -1, 442, -1, 295, 4684, -1, -1, 4687, -1, 450, -1, -1, -1, -1, -1, -1, 457, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6072, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, 1504, -1, -1, -1, -1, -1, 3564, 3565, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, 45, 1377, 3585, -1, -1, 3588, -1, 52, -1, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, -1, 2591, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, 2602, -1, 2604, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1432, -1, -1, 1588, -1, -1, -1, -1, -1, -1, -1, -1, 1597, -1, 2642, -1, -1, -1, 2646, -1, -1, 2649, -1, 2651, -1, -1, 2654, -1, -1, -1, 3669, 3670, 3671, -1, -1, -1, -1, -1, -1, -1, -1, 6205, -1, -1, 1629, -1, -1, -1, -1, -1, 1635, 1636, -1, -1, 1639, 3694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1652, -1, -1, 1655, -1, 6236, 6237, 3713, -1, 513, -1, -1, 2707, 2708, 4906, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 196, 3735, -1, -1, -1, 201, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, 1710, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, 4963, 1724, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, 4975, 252, -1, 10, -1, -1, 13, -1, 2786, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, 5009, -1, 3825, -1, 45, -1, -1, -1, -1, -1, 295, 52, 6360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, 330, -1, -1, -1, 3872, -1, -1, -1, -1, -1, 3878, -1, 3880, -1, -1, -1, -1, -1, -1, -1, 1834, -1, -1, -1, -1, 3893, -1, 3895, -1, -1, -1, 1845, -1, 5087, -1, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, 5106, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, 1887, 1888, -1, -1, 407, -1, -1, 1741, -1, -1, -1, 1745, 171, -1, -1, -1, -1, 224, 225, -1, -1, 3962, -1, -1, -1, 1912, -1, -1, -1, -1, -1, -1, 1919, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 10, -1, 252, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4004, -1, 224, 225, -1, 35, -1, -1, -1, -1, -1, -1, -1, 5203, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, 295, -1, -1, -1, 4033, 252, -1, -1, 4037, -1, 3028, 3029, 3030, -1, -1, 310, 3034, 1992, 313, -1, 1995, -1, 513, 78, -1, -1, -1, -1, -1, 4058, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 3061, -1, -1, -1, -1, 295, -1, -1, -1, 2027, 2028, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, 313, -1, -1, 2044, -1, -1, 2047, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5323, -1, 5325, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 4166, 17, 18, 19, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, 5373, -1, 407, -1, -1, -1, -1, -1, 45, -1, 5383, 224, 225, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 5423, -1, -1, -1, -1, 5428, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, 295, -1, 2064, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3272, 310, -1, -1, 313, 3277, -1, -1, -1, -1, -1, -1, 513, -1, 2090, -1, -1, 150, 2094, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 2109, 2110, 2111, -1, 2113, -1, -1, -1, -1, -1, 4326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3328, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, 3339, 201, 3341, 3342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3355, -1, -1, 3358, -1, 3360, -1, -1, 224, 225, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, 4388, -1, -1, -1, -1, 4393, -1, 4395, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, 3397, -1, 3399, -1, 3401, -1, -1, -1, 10, -1, -1, 13, -1, 4421, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 295, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, 310, -1, -1, 313, -1, -1, -1, 4467, -1, -1, 4470, -1, -1, -1, -1, -1, -1, -1, -1, 5665, -1, -1, -1, -1, 78, -1, -1, 513, -1, -1, -1, -1, -1, 5679, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, 3495, -1, -1, -1, -1, 3500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5710, -1, 3515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, -1, -1, -1, 407, -1, -1, 4560, 4561, -1, -1, -1, -1, -1, 35, -1, -1, -1, 4571, -1, -1, -1, -1, -1, 45, -1, -1, -1, 3570, -1, 10, 52, -1, 13, -1, 4588, -1, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 35, 5795, 78, 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3630, -1, -1, -1, 5831, -1, -1, -1, -1, -1, 78, -1, -1, -1, 2601, -1, -1, 252, -1, -1, -1, -1, 513, -1, 2611, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, 4684, -1, -1, 4687, -1, -1, -1, -1, -1, -1, 2640, -1, -1, -1, -1, -1, -1, 295, -1, 171, -1, -1, -1, -1, -1, 5895, -1, -1, 5898, -1, -1, -1, 310, -1, -1, 313, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, 2687, 2688, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, -1, -1, 201, 2721, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, 2598, -1, -1, -1, -1, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3830, 310, -1, -1, 313, -1, 3836, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6043, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, 6057, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, 6070, -1, 313, -1, -1, -1, -1, -1, -1, 487, -1, -1, -1, -1, -1, -1, -1, 2694, -1, -1, -1, -1, 4906, -1, -1, -1, 2856, -1, -1, 2706, -1, -1, -1, -1, 2711, 513, -1, -1, -1, -1, -1, 2871, 3915, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 407, -1, -1, -1, -1, -1, 6131, 6132, 2893, -1, -1, -1, 10, -1, -1, 13, -1, -1, -1, 17, 18, 19, -1, -1, 4963, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4975, 35, -1, -1, -1, 407, -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5009, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, 6211, -1, -1, -1, -1, -1, -1, -1, 2979, 2980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4074, 513, 5087, -1, -1, -1, -1, -1, -1, 4083, 522, 523, 524, 525, 526, 527, 528, 529, 530, -1, -1, 5106, -1, 4097, -1, -1, -1, 4101, 4102, 4103, -1, -1, -1, -1, 4108, -1, -1, 4111, -1, -1, 4114, -1, -1, -1, -1, -1, 4120, -1, 4122, -1, 3081, -1, 196, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4149, 4150, 4151, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4168, -1, -1, -1, -1, 6370, -1, -1, 4176, -1, -1, 4179, -1, 4181, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5203, -1, -1, -1, -1, 4197, -1, -1, -1, -1, -1, -1, -1, 4205, 4206, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, 6429, -1, -1, -1, 41, -1, -1, -1, 310, 4241, -1, 313, -1, 6442, 6443, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6454, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, 4292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, -1, 5323, -1, 5325, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, -1, 407, -1, -1, -1, -1, -1, -1, -1, -1, 151, -1, -1, -1, -1, -1, -1, -1, -1, 160, -1, -1, -1, -1, -1, -1, 5373, -1, -1, -1, -1, -1, 173, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5423, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, 256, 522, 523, 524, 525, 526, 527, 528, 529, 530, 266, -1, -1, -1, -1, -1, -1, -1, -1, 3427, 3275, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3292, -1, -1, 3448, -1, -1, -1, -1, -1, -1, 3302, -1, -1, -1, -1, -1, 3308, 310, -1, 3311, 313, -1, -1, -1, -1, -1, 3318, 3319, -1, 3321, -1, -1, -1, -1, 3326, 3327, -1, 3329, -1, 3331, -1, -1, -1, 3335, 337, -1, 3338, -1, -1, -1, -1, 3343, -1, -1, -1, -1, -1, -1, 351, -1, 3352, -1, -1, -1, -1, 3357, 359, -1, -1, -1, -1, -1, 3364, 3365, 3366, 3367, -1, -1, -1, -1, 3372, 3373, -1, 3375, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, 389, -1, -1, -1, -1, -1, 3394, 396, 3396, -1, 399, -1, -1, -1, -1, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, -1, -1, -1, -1, -1, 419, -1, -1, 4617, 4618, -1, -1, -1, 427, -1, -1, -1, -1, -1, 4628, 434, -1, -1, 437, -1, 439, -1, 441, 442, -1, -1, -1, -1, -1, -1, -1, 3449, -1, -1, -1, -1, -1, -1, 457, -1, 5665, -1, -1, -1, -1, -1, 465, -1, -1, 468, -1, -1, 471, -1, 5679, -1, -1, 4671, -1, -1, -1, -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5710, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4713, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4747, -1, -1, -1, -1, -1, -1, 3711, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3579, -1, -1, 20, -1, -1, -1, -1, -1, 5795, -1, 4786, 4787, -1, 31, -1, 33, 34, 4793, 4794, -1, -1, -1, 4798, -1, -1, -1, -1, 4803, -1, -1, 4806, 4807, -1, -1, -1, -1, -1, 4813, -1, -1, -1, -1, -1, 61, 5831, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, -1, 75, 76, -1, -1, -1, -1, -1, 82, -1, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, -1, 99, 4858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4869, -1, 4871, -1, -1, 116, -1, -1, 119, -1, -1, -1, -1, -1, -1, 5895, -1, -1, 5898, -1, -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, 147, -1, -1, -1, -1, -1, 4911, -1, -1, 156, -1, 158, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, 3884, 3885, 3886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, 3901, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3934, 3935, -1, -1, -1, 3939, -1, -1, -1, -1, -1, -1, -1, -1, 4991, -1, -1, -1, -1, -1, -1, 4998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, 255, -1, -1, -1, -1, 260, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3834, 3835, 6043, 275, -1, 3839, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 294, -1, -1, -1, -1, -1, -1, 6070, -1, -1, -1, -1, 3868, -1, 5066, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, -1, -1, 4055, -1, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 357, -1, -1, -1, -1, -1, 363, 364, -1, 366, -1, -1, -1, -1, 371, -1, -1, 374, -1, -1, 377, -1, -1, 380, -1, -1, -1, -1, -1, -1, 387, -1, -1, -1, -1, -1, -1, 394, 395, -1, -1, -1, -1, -1, -1, 402, -1, -1, -1, 406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 434, -1, -1, -1, -1, -1, -1, -1, 6211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 455, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 467, -1, -1, -1, 5229, -1, 473, -1, -1, -1, -1, 478, -1, -1, 5239, -1, -1, -1, -1, -1, 5245, 5246, 5247, -1, 491, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4221, 4222, 4223, -1, -1, 4073, 5270, 5271, -1, 515, 5274, 4079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5291, 534, -1, -1, 537, -1, -1, -1, -1, -1, 5301, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5312, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4126, 4127, -1, -1, 4130, 4131, 4132, 4133, -1, -1, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6370, -1, -1, -1, -1, -1, 4169, -1, -1, 4172, -1, 4174, -1, -1, 4177, 4178, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4199, 4200, 4201, 4202, -1, 4204, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, -1, -1, -1, 5520, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5533, -1, -1, -1, -1, -1, -1, 4344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5554, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4541, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5599, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4573, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5641, -1, -1, -1, -1, -1, -1, 4605, -1, -1, -1, -1, -1, -1, -1, -1, 5657, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4640, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5699, 4657, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4577, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5794, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5806, -1, -1, -1, -1, -1, -1, -1, -1, 5815, 5816, 5817, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5843, -1, -1, -1, -1, -1, -1, -1, 5851, -1, -1, -1, -1, -1, -1, -1, -1, 4817, 4818, 4819, 4820, -1, -1, -1, -1, -1, -1, 5870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4714, -1, -1, -1, 4718, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4731, -1, -1, -1, -1, -1, -1, -1, 4739, -1, 4741, -1, 4743, 4744, -1, -1, -1, -1, 4749, 4750, 4751, 4752, -1, -1, -1, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4792, -1, -1, 4795, -1, 4797, -1, -1, -1, 4801, -1, -1, 4804, 4805, -1, -1, 4808, 4809, -1, -1, 6008, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6033, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4868, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5069, -1, 6267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6283, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5156, 5157, -1, -1, -1, -1, -1, -1, 5164, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6408, -1, -1, -1, -1, -1, 5218, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5241, 5242, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5260, -1, 5262, -1, -1, -1, 5266, 5267, 5268, 5269, -1, -1, 5272, 5273, -1, -1, -1, -1, 5278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5445, -1, -1, 5295, -1, 5450, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5313, -1, -1, 5469, -1, -1, -1, 5320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5394, -1, 5396, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5431, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5634, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5547, -1, 5549, 5550, 5551, 5552, 5553, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5566, 5567, 5568, -1, -1, -1, -1, -1, -1, -1, 5576, -1, -1, 5732, -1, 5581, -1, -1, 5584, -1, -1, -1, 5588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5606, -1, 5761, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5791, -1, -1, -1, -1, 5796, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5807, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5828, -1, 5830, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5869, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5881, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5918, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6004, -1, -1, -1, -1, -1, -1, 6011, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6040, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6055, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6171, 6172, -1, -1, 6175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6258, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6277, 6278, -1, 6280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 6346, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, 135, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, -1, -1, 534, 535, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, -1, -1, 254, 255, 256, -1, -1, 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, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 535, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, 535, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, 509, 510, 511, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, 535, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 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, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, 247, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 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, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 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, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, -1, -1, 532, 533, 534, 3, -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 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, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, 447, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, -1, 3, -1, 5, 6, 534, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 3, -1, 5, 6, -1, 8, 9, 534, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, 3, -1, 5, 6, -1, 8, 9, 534, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, -1, 11, 12, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, 37, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 525, 526, 527, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 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, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, 515, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 534, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, 13, -1, -1, 534, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, 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, -1, -1, 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, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, -1, 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, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, -1, 167, 168, 169, 170, -1, 172, 173, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, -1, 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, -1, 221, -1, 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, -1, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, -1, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, 313, -1, 315, 316, 317, 318, -1, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 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, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, 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, -1, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, -1, 482, 483, 484, 485, 486, 487, -1, 489, -1, -1, -1, -1, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, -1, 510, 511, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, 5, 6, -1, -1, -1, 10, 11, -1, -1, -1, -1, -1, 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, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 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, -1, 158, 159, 160, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, -1, 186, -1, 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, -1, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, -1, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, 337, -1, 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, 381, 382, 383, -1, 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, -1, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, -1, 452, -1, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, 5, 6, -1, -1, -1, 10, 11, -1, -1, -1, -1, -1, 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, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 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, -1, 158, 159, 160, 161, -1, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, -1, 186, -1, 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, -1, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, -1, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, 337, -1, 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, 381, 382, 383, -1, 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, -1, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, -1, 452, -1, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 3, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 522, 523, 524, 525, 526, 527, 528, 529, 530, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, 314, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 527, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, 314, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, 527, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, 177, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 525, 526, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 3, -1, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, 433, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, 5, 6, -1, 8, 9, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, 186, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, 308, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, 106, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, 250, 251, 252, -1, 254, 255, 256, -1, -1, 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, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, 183, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, 183, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 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, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, 465, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, 173, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 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, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, 471, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, 309, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, 434, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, -1, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, 188, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, -1, -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, -1, -1, -1, 179, 180, 181, 182, -1, 184, 185, -1, 187, -1, 189, -1, 191, 192, 193, 194, 195, -1, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, -1, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, -1, -1, 226, -1, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, 249, -1, 251, -1, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, -1, 296, -1, 298, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, -1, 319, -1, 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, -1, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, -1, 379, 380, 381, 382, 383, 384, -1, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, -1, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, -1, 431, 432, -1, -1, 435, -1, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, 478, 479, -1, 481, -1, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, 317, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, 434, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, 171, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, 171, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, 218, 219, -1, 221, -1, 223, 224, 225, 226, 227, 228, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, 300, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, -1, 405, 406, 407, 408, 409, 410, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, 445, 446, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, 479, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, 54, -1, -1, -1, 58, 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, -1, -1, 71, -1, 73, 74, 75, 76, -1, -1, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, 96, 97, 98, -1, 100, 101, 102, 103, -1, -1, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, -1, -1, 119, -1, 121, -1, 123, 124, 125, 126, 127, 128, 129, -1, 131, 132, 133, 134, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, -1, 158, 159, 160, 161, -1, -1, 164, -1, 166, 167, 168, -1, 170, -1, 172, -1, 174, 175, 176, -1, 178, 179, 180, 181, 182, -1, 184, -1, -1, -1, 188, 189, -1, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, -1, 202, 203, 204, 205, 206, 207, 208, 209, -1, 211, 212, -1, 214, 215, 216, 217, -1, -1, -1, -1, -1, 223, 224, 225, 226, 227, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240, 241, 242, 243, 244, 245, -1, -1, 248, -1, 250, 251, 252, -1, 254, 255, 256, -1, -1, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, 291, -1, 293, 294, 295, 296, -1, -1, 299, -1, 301, 302, 303, -1, 305, 306, 307, -1, -1, 310, 311, 312, -1, -1, 315, 316, -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, -1, -1, 335, 336, 337, -1, 339, -1, 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, -1, 376, 377, 378, 379, 380, 381, 382, 383, -1, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, -1, 396, 397, 398, 399, 400, -1, 402, 403, -1, 405, 406, 407, 408, 409, -1, 411, -1, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, -1, 429, -1, 431, 432, -1, -1, 435, 436, 437, 438, 439, 440, 441, 442, -1, 444, -1, -1, -1, -1, 449, 450, -1, 452, -1, -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, -1, -1, 466, 467, 468, 469, 470, -1, -1, 473, 474, 475, 476, 477, -1, -1, -1, 481, 482, 483, 484, 485, 486, -1, -1, 489, -1, -1, 492, 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 510, 511 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 20, 31, 33, 34, 51, 61, 73, 75, 76, 82, 84, 97, 99, 116, 119, 134, 136, 140, 147, 156, 158, 165, 183, 200, 254, 255, 260, 275, 294, 333, 342, 357, 363, 364, 366, 371, 377, 380, 387, 394, 395, 402, 406, 417, 434, 455, 467, 473, 478, 491, 515, 517, 518, 519, 520, 521, 534, 541, 542, 543, 544, 549, 550, 556, 557, 559, 560, 561, 562, 564, 567, 579, 584, 585, 588, 589, 590, 610, 613, 614, 629, 680, 683, 684, 687, 690, 691, 692, 700, 707, 709, 710, 713, 716, 717, 721, 730, 734, 735, 736, 739, 741, 742, 743, 744, 752, 754, 774, 778, 780, 781, 791, 793, 800, 801, 804, 805, 806, 807, 808, 817, 819, 821, 824, 828, 829, 839, 840, 845, 850, 861, 893, 896, 897, 898, 903, 906, 908, 910, 912, 913, 917, 918, 921, 923, 924, 928, 929, 930, 933, 934, 935, 936, 937, 944, 946, 947, 948, 949, 955, 957, 958, 964, 965, 966, 969, 970, 971, 972, 974, 975, 977, 978, 980, 981, 983, 995, 997, 1000, 1002, 1004, 1013, 1015, 1021, 1026, 1036, 1040, 1041, 1042, 1043, 1044, 1045, 1051, 1087, 449, 494, 950, 28, 79, 96, 114, 120, 138, 151, 160, 173, 179, 186, 206, 244, 266, 310, 337, 347, 348, 351, 379, 382, 386, 389, 396, 399, 419, 427, 432, 434, 437, 442, 452, 457, 471, 484, 706, 950, 3, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 100, 101, 102, 103, 107, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 123, 124, 125, 126, 127, 128, 129, 131, 132, 133, 134, 137, 138, 139, 140, 141, 143, 144, 145, 146, 148, 149, 150, 151, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 164, 166, 167, 168, 169, 170, 172, 174, 175, 176, 178, 179, 180, 181, 182, 184, 185, 187, 188, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207, 208, 209, 211, 212, 213, 214, 215, 216, 217, 218, 219, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 248, 249, 250, 251, 252, 254, 255, 256, 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, 293, 294, 295, 296, 298, 299, 300, 301, 302, 303, 305, 306, 307, 310, 311, 312, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 337, 338, 339, 340, 341, 342, 343, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 396, 397, 398, 399, 400, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 431, 432, 435, 436, 437, 438, 439, 440, 441, 442, 444, 445, 446, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 466, 467, 468, 469, 470, 473, 474, 475, 476, 477, 478, 479, 481, 482, 483, 484, 485, 486, 489, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 1155, 1248, 1260, 1261, 1265, 1266, 1267, 3, 29, 1037, 1245, 1260, 1265, 482, 534, 988, 308, 343, 950, 54, 534, 621, 23, 41, 66, 79, 114, 120, 138, 151, 160, 173, 182, 186, 256, 310, 313, 337, 351, 379, 389, 399, 419, 427, 437, 439, 441, 442, 457, 465, 468, 471, 630, 689, 796, 851, 862, 29, 342, 1245, 1037, 29, 336, 397, 439, 441, 6, 243, 904, 905, 1251, 23, 28, 66, 79, 96, 114, 138, 151, 160, 173, 179, 186, 206, 266, 310, 323, 337, 348, 351, 379, 382, 386, 389, 396, 399, 419, 427, 434, 437, 442, 450, 452, 457, 471, 484, 706, 809, 811, 812, 950, 1245, 99, 482, 534, 684, 687, 690, 983, 996, 1000, 1003, 1013, 1020, 1026, 1036, 1040, 1051, 11, 22, 29, 49, 168, 175, 177, 201, 245, 283, 345, 365, 525, 526, 825, 826, 1037, 1250, 1252, 29, 31, 99, 361, 395, 830, 831, 832, 1260, 173, 1260, 1247, 1251, 434, 1054, 825, 1260, 371, 402, 406, 449, 1245, 323, 266, 534, 916, 387, 1260, 29, 400, 445, 449, 571, 580, 581, 1260, 183, 830, 831, 1260, 343, 950, 1260, 242, 29, 135, 1056, 1057, 67, 93, 256, 277, 379, 389, 400, 445, 449, 497, 568, 569, 570, 571, 29, 400, 445, 449, 571, 449, 309, 1099, 1100, 1243, 1260, 1054, 527, 1260, 178, 534, 989, 534, 359, 1046, 1047, 1245, 1046, 3, 53, 55, 56, 69, 70, 117, 118, 139, 169, 218, 219, 221, 228, 278, 280, 300, 356, 404, 410, 445, 446, 479, 1128, 1130, 1132, 1134, 1136, 1138, 1139, 1140, 1142, 1143, 1144, 1146, 1147, 1151, 1261, 1265, 1056, 1057, 1058, 1256, 12, 1257, 1258, 1260, 1257, 1257, 1041, 1042, 1045, 0, 537, 534, 988, 152, 220, 314, 464, 1059, 1060, 1041, 1043, 1044, 125, 216, 268, 470, 538, 35, 954, 878, 1248, 814, 1260, 814, 1245, 346, 814, 452, 1245, 113, 434, 866, 1248, 1260, 1267, 3, 106, 110, 401, 1253, 1254, 1262, 1265, 1266, 1267, 29, 195, 1243, 301, 484, 10, 17, 18, 19, 74, 164, 522, 523, 524, 525, 526, 527, 528, 529, 530, 900, 902, 1186, 1187, 1260, 195, 1245, 866, 1245, 29, 1253, 1254, 866, 1245, 1245, 195, 1243, 1245, 195, 814, 1245, 371, 402, 29, 195, 1099, 1245, 392, 1245, 814, 29, 263, 1253, 1254, 195, 1243, 243, 122, 226, 292, 355, 951, 952, 953, 534, 532, 536, 1212, 1214, 512, 982, 983, 984, 985, 1262, 1243, 1245, 1260, 28, 66, 80, 92, 114, 138, 179, 206, 244, 310, 348, 379, 382, 427, 437, 450, 457, 809, 810, 811, 812, 1251, 954, 999, 1003, 1013, 1020, 1026, 1040, 1243, 270, 814, 534, 195, 814, 1245, 814, 452, 195, 1245, 113, 434, 439, 441, 1253, 1254, 439, 441, 74, 164, 900, 369, 1245, 1245, 1253, 195, 545, 1260, 195, 1245, 195, 546, 814, 1245, 1245, 392, 814, 263, 1253, 359, 396, 434, 484, 266, 96, 206, 28, 92, 179, 348, 386, 450, 452, 456, 701, 29, 1245, 1038, 578, 1251, 1262, 905, 270, 195, 878, 879, 195, 909, 195, 1245, 195, 816, 1128, 452, 113, 434, 195, 865, 866, 195, 1254, 1255, 87, 484, 74, 164, 195, 901, 902, 59, 195, 865, 195, 1255, 195, 865, 195, 1245, 195, 1245, 392, 909, 195, 816, 195, 263, 1255, 243, 195, 813, 814, 195, 1244, 1245, 195, 1245, 954, 534, 1001, 630, 996, 478, 982, 988, 216, 470, 1252, 826, 827, 29, 827, 1252, 827, 29, 827, 1252, 827, 827, 827, 1252, 1250, 1250, 1037, 827, 346, 534, 432, 534, 657, 657, 657, 308, 447, 538, 657, 389, 1099, 1101, 538, 945, 581, 569, 571, 29, 571, 1251, 534, 998, 59, 484, 982, 114, 206, 389, 432, 434, 914, 915, 1260, 48, 511, 226, 536, 311, 308, 177, 311, 1251, 447, 954, 171, 822, 308, 5, 8, 9, 10, 12, 37, 53, 55, 56, 65, 66, 69, 70, 77, 79, 104, 105, 106, 107, 108, 109, 110, 117, 118, 120, 157, 162, 163, 169, 185, 187, 218, 219, 221, 228, 229, 230, 231, 232, 233, 234, 235, 236, 238, 249, 257, 258, 269, 278, 280, 290, 292, 297, 298, 300, 310, 321, 338, 356, 384, 401, 410, 428, 433, 445, 446, 451, 453, 454, 465, 471, 479, 499, 500, 501, 502, 504, 505, 506, 507, 513, 525, 526, 527, 534, 1041, 1131, 1134, 1137, 1138, 1139, 1141, 1142, 1143, 1146, 1147, 1151, 1152, 1154, 1155, 1156, 1158, 1182, 1183, 1184, 1188, 1206, 1211, 1237, 1240, 1241, 1248, 1249, 1250, 1251, 1260, 1239, 1240, 1251, 29, 586, 1242, 1243, 400, 568, 120, 577, 1251, 578, 1251, 48, 71, 568, 511, 411, 952, 311, 177, 447, 524, 48, 511, 226, 953, 534, 1243, 527, 1214, 1101, 982, 176, 990, 1152, 1191, 1046, 538, 534, 991, 481, 1145, 1145, 1145, 534, 1133, 1133, 340, 534, 1135, 69, 70, 1145, 1133, 1130, 515, 516, 534, 1148, 534, 1148, 37, 1129, 534, 115, 193, 271, 274, 393, 509, 534, 1149, 1150, 536, 815, 1133, 1239, 1215, 535, 535, 543, 982, 992, 993, 994, 1243, 29, 135, 1055, 1055, 59, 1055, 165, 171, 253, 304, 1063, 1065, 1066, 1081, 1083, 1084, 1085, 1059, 1060, 177, 222, 222, 1099, 1102, 534, 68, 288, 324, 367, 402, 534, 876, 324, 363, 367, 402, 815, 324, 367, 402, 3, 91, 145, 259, 324, 333, 363, 367, 402, 437, 440, 491, 579, 582, 959, 960, 961, 962, 846, 25, 140, 324, 367, 402, 475, 595, 1245, 25, 140, 402, 470, 563, 495, 195, 1099, 62, 98, 161, 198, 248, 288, 292, 324, 325, 367, 376, 385, 394, 402, 415, 424, 429, 486, 579, 583, 882, 894, 922, 534, 863, 1214, 367, 563, 201, 157, 25, 31, 46, 76, 133, 140, 144, 172, 208, 288, 292, 302, 312, 324, 367, 370, 371, 402, 475, 591, 593, 594, 724, 922, 5, 525, 526, 698, 1252, 29, 195, 1243, 814, 814, 534, 899, 324, 402, 536, 157, 308, 324, 367, 402, 894, 922, 25, 140, 324, 367, 402, 201, 558, 367, 491, 515, 551, 558, 324, 367, 402, 894, 922, 308, 324, 367, 157, 38, 60, 112, 204, 267, 272, 288, 323, 367, 372, 396, 402, 417, 591, 695, 696, 324, 367, 483, 724, 732, 157, 324, 367, 402, 25, 91, 133, 140, 144, 324, 363, 367, 402, 409, 581, 569, 201, 157, 46, 131, 288, 367, 402, 591, 592, 324, 367, 371, 402, 89, 132, 327, 440, 308, 25, 31, 140, 324, 367, 402, 611, 612, 558, 171, 367, 551, 558, 157, 367, 402, 591, 1245, 251, 122, 309, 496, 538, 951, 29, 135, 480, 527, 535, 871, 1152, 1192, 1193, 1261, 1152, 1213, 3, 29, 33, 34, 35, 36, 37, 38, 39, 43, 57, 65, 66, 72, 78, 80, 92, 99, 104, 105, 106, 108, 109, 110, 120, 122, 130, 135, 136, 142, 147, 152, 163, 165, 171, 173, 177, 183, 186, 190, 201, 210, 220, 222, 246, 247, 253, 257, 258, 292, 297, 304, 308, 309, 313, 314, 334, 344, 361, 375, 395, 401, 412, 430, 433, 434, 443, 447, 448, 454, 464, 465, 471, 472, 480, 487, 488, 490, 491, 527, 1246, 1263, 1265, 1266, 1267, 1268, 1212, 535, 538, 163, 308, 454, 575, 578, 698, 986, 472, 979, 308, 878, 534, 814, 1245, 1128, 866, 301, 74, 164, 902, 866, 866, 171, 1128, 814, 1245, 1245, 535, 657, 1245, 72, 1128, 292, 177, 534, 782, 551, 38, 973, 1245, 292, 551, 495, 195, 1243, 551, 814, 814, 782, 468, 630, 308, 171, 491, 890, 551, 292, 48, 565, 292, 457, 731, 292, 991, 91, 324, 708, 89, 132, 327, 440, 38, 782, 171, 195, 551, 484, 195, 1243, 195, 685, 1243, 1243, 484, 814, 87, 547, 1248, 452, 1248, 1248, 1245, 171, 1245, 706, 40, 54, 111, 215, 288, 391, 157, 63, 373, 538, 548, 157, 534, 157, 551, 157, 538, 548, 495, 157, 538, 548, 157, 538, 195, 813, 195, 814, 195, 814, 157, 538, 548, 1255, 157, 548, 157, 157, 548, 157, 548, 157, 89, 132, 327, 440, 171, 157, 548, 157, 171, 195, 157, 538, 548, 157, 538, 548, 157, 308, 1191, 434, 535, 996, 222, 1102, 827, 1037, 827, 1037, 827, 1037, 827, 1037, 827, 1037, 1037, 1037, 827, 1037, 534, 658, 659, 1260, 658, 29, 114, 138, 173, 179, 243, 244, 326, 348, 382, 389, 396, 434, 437, 457, 835, 1242, 1255, 832, 1245, 201, 538, 1016, 1251, 1128, 1195, 38, 1255, 547, 535, 547, 547, 547, 251, 1260, 171, 835, 1255, 171, 387, 1260, 578, 308, 534, 1215, 532, 1041, 1196, 1152, 1210, 534, 534, 171, 534, 534, 1041, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 1152, 534, 534, 534, 534, 534, 534, 534, 534, 299, 646, 534, 534, 534, 534, 534, 534, 534, 534, 1152, 1152, 1152, 1041, 1152, 1191, 1214, 1251, 534, 1251, 3, 10, 13, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 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, 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, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 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, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 167, 168, 169, 170, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 184, 185, 187, 188, 189, 191, 192, 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, 221, 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, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 272, 273, 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, 305, 306, 307, 309, 310, 311, 312, 313, 315, 316, 317, 318, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 334, 335, 336, 337, 338, 339, 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, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 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, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 489, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511, 513, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1186, 1188, 1190, 1264, 1269, 492, 1169, 320, 1152, 166, 1170, 222, 538, 1052, 534, 1251, 1214, 1052, 123, 197, 587, 538, 71, 120, 578, 38, 3, 120, 256, 576, 698, 1147, 1251, 1251, 94, 137, 1164, 103, 120, 572, 573, 575, 698, 120, 572, 251, 1243, 95, 372, 818, 535, 988, 35, 45, 52, 78, 196, 201, 224, 252, 310, 313, 407, 535, 538, 1047, 1244, 38, 534, 1191, 1250, 1145, 1145, 37, 1129, 445, 445, 1250, 1250, 532, 532, 1250, 447, 447, 447, 534, 447, 1250, 1246, 536, 1133, 177, 1088, 15, 524, 1212, 1259, 535, 538, 991, 1043, 1043, 1061, 1062, 1152, 1043, 168, 283, 1072, 240, 288, 355, 405, 470, 29, 1067, 1152, 525, 526, 1068, 1069, 1152, 1154, 1081, 1082, 1066, 1065, 1063, 1064, 171, 1084, 302, 1086, 1063, 1081, 1102, 1005, 1243, 1102, 38, 1260, 1191, 68, 447, 447, 389, 201, 213, 314, 317, 404, 480, 527, 869, 870, 871, 873, 875, 877, 1128, 1261, 447, 483, 447, 389, 447, 447, 389, 253, 447, 79, 447, 437, 568, 324, 959, 961, 524, 963, 171, 183, 201, 377, 847, 848, 72, 92, 292, 654, 655, 92, 120, 292, 447, 92, 447, 120, 292, 389, 92, 133, 144, 324, 367, 779, 389, 714, 28, 66, 138, 179, 310, 348, 382, 450, 457, 809, 810, 1245, 157, 367, 402, 591, 308, 698, 394, 248, 447, 1260, 447, 297, 698, 124, 223, 389, 400, 449, 570, 814, 373, 402, 882, 895, 128, 535, 864, 869, 447, 471, 437, 1243, 72, 80, 92, 153, 173, 195, 344, 465, 637, 652, 653, 1260, 80, 92, 919, 329, 308, 384, 386, 452, 92, 919, 32, 370, 384, 386, 452, 384, 1243, 172, 208, 302, 814, 534, 447, 447, 194, 534, 599, 23, 262, 437, 468, 493, 599, 92, 538, 128, 5, 5, 324, 201, 157, 367, 402, 591, 922, 472, 472, 289, 1128, 447, 389, 534, 900, 1245, 1243, 447, 447, 389, 895, 128, 107, 434, 435, 931, 932, 1100, 1243, 1260, 932, 447, 447, 782, 932, 114, 402, 582, 447, 553, 582, 447, 447, 389, 895, 128, 1243, 447, 447, 1243, 1130, 698, 59, 697, 698, 698, 112, 267, 272, 59, 447, 551, 276, 389, 551, 288, 696, 447, 447, 297, 1251, 724, 814, 447, 447, 389, 419, 351, 1251, 351, 447, 351, 447, 351, 782, 782, 437, 1099, 329, 329, 92, 447, 919, 389, 447, 447, 599, 599, 814, 814, 814, 814, 1243, 47, 477, 47, 47, 477, 447, 47, 447, 477, 389, 534, 538, 582, 471, 740, 1254, 447, 553, 582, 1243, 447, 919, 389, 324, 367, 355, 368, 398, 574, 951, 1192, 1192, 1193, 535, 15, 16, 538, 1059, 1060, 533, 539, 1243, 984, 1245, 1243, 224, 1128, 224, 308, 224, 224, 698, 814, 814, 224, 224, 224, 1128, 224, 224, 224, 308, 447, 177, 447, 615, 457, 534, 38, 157, 814, 783, 784, 1263, 959, 1128, 308, 157, 711, 1245, 292, 329, 534, 552, 796, 472, 359, 484, 1243, 29, 932, 782, 552, 157, 1254, 99, 183, 566, 629, 691, 754, 828, 850, 955, 157, 1251, 732, 733, 157, 308, 1251, 1254, 259, 814, 814, 814, 814, 148, 354, 534, 740, 292, 552, 1243, 292, 693, 695, 292, 38, 302, 329, 534, 657, 657, 195, 688, 1243, 171, 195, 545, 1260, 534, 786, 876, 1245, 534, 867, 867, 38, 1128, 27, 50, 217, 755, 243, 491, 493, 1039, 391, 879, 878, 1128, 1245, 534, 816, 1128, 865, 866, 1255, 1254, 157, 548, 157, 472, 157, 472, 901, 902, 548, 865, 1255, 865, 1245, 1245, 1128, 816, 1255, 740, 157, 813, 814, 1244, 1245, 1245, 814, 535, 195, 1243, 996, 1005, 402, 1037, 1037, 1037, 1037, 1037, 1037, 658, 535, 538, 535, 180, 349, 383, 397, 435, 1244, 813, 113, 399, 865, 1244, 301, 833, 834, 1260, 865, 865, 1244, 1242, 1242, 1244, 813, 447, 184, 491, 844, 152, 253, 737, 738, 23, 155, 384, 405, 1017, 1099, 296, 1018, 535, 538, 999, 447, 1243, 1245, 1243, 545, 830, 831, 177, 844, 831, 1260, 28, 80, 138, 179, 244, 348, 382, 457, 809, 810, 1191, 533, 1191, 1196, 1197, 487, 1207, 1208, 1152, 1191, 534, 1250, 1250, 3, 115, 193, 271, 274, 393, 509, 1198, 1199, 1251, 1191, 1191, 1152, 1225, 375, 1041, 1042, 1225, 1229, 1236, 1225, 1225, 1152, 1154, 1192, 1229, 1232, 1233, 1152, 1233, 1225, 1152, 1225, 1225, 1191, 1250, 1250, 535, 1152, 1152, 900, 1152, 1192, 1194, 1201, 384, 525, 526, 534, 1153, 1154, 1188, 1202, 535, 1191, 1152, 1194, 1203, 1152, 57, 177, 247, 448, 1152, 1191, 1204, 135, 292, 1041, 1191, 276, 1154, 1152, 1162, 1163, 1164, 276, 1152, 1164, 535, 538, 1250, 1149, 1128, 1152, 1152, 1152, 1152, 1263, 256, 445, 43, 430, 1216, 814, 1152, 534, 1041, 1205, 135, 137, 163, 228, 284, 285, 286, 287, 291, 292, 297, 454, 466, 1200, 1230, 1152, 534, 1152, 447, 52, 196, 201, 252, 407, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 29, 36, 412, 1185, 186, 1170, 384, 534, 1182, 534, 319, 1174, 182, 256, 434, 439, 441, 468, 1053, 1243, 1241, 1088, 1192, 1088, 1243, 449, 534, 1251, 538, 535, 194, 194, 548, 994, 983, 987, 1152, 535, 266, 292, 1048, 1191, 535, 535, 532, 511, 511, 535, 535, 1250, 533, 1250, 535, 193, 271, 1150, 271, 1150, 1150, 1250, 274, 535, 1246, 228, 237, 246, 385, 508, 534, 1041, 1089, 1090, 1091, 1099, 1105, 1115, 1122, 1155, 1157, 1158, 1237, 1260, 488, 1110, 1256, 994, 992, 538, 39, 130, 472, 859, 384, 385, 525, 526, 1069, 1071, 1154, 405, 240, 309, 538, 5, 1070, 1250, 1070, 384, 385, 1071, 1242, 296, 409, 1019, 1082, 1064, 472, 1014, 38, 472, 1260, 535, 1254, 1245, 1245, 317, 59, 1261, 535, 871, 873, 870, 873, 1261, 314, 535, 538, 815, 1254, 1245, 1245, 1254, 1245, 1245, 1254, 483, 1245, 1245, 120, 575, 698, 379, 471, 830, 389, 183, 830, 534, 1245, 297, 195, 1245, 297, 1254, 1245, 1245, 1152, 297, 1245, 1245, 32, 370, 447, 447, 1245, 447, 715, 878, 534, 1128, 866, 74, 164, 902, 866, 866, 171, 1128, 814, 1245, 189, 288, 324, 367, 476, 718, 719, 720, 1099, 447, 919, 389, 297, 124, 223, 1254, 1245, 308, 1245, 308, 535, 538, 1253, 1255, 1245, 367, 591, 534, 195, 637, 1245, 472, 852, 240, 292, 240, 472, 646, 679, 1128, 1245, 1250, 1260, 1243, 1245, 251, 1245, 29, 471, 1245, 195, 1245, 195, 1260, 386, 452, 386, 452, 251, 1245, 29, 471, 1245, 251, 384, 1243, 25, 140, 402, 725, 726, 727, 728, 1263, 1254, 1245, 120, 178, 293, 472, 598, 601, 602, 1263, 270, 1245, 76, 305, 1245, 594, 308, 447, 437, 1243, 447, 919, 389, 128, 1245, 1245, 538, 535, 538, 1254, 1245, 925, 926, 1263, 308, 367, 447, 748, 1254, 1245, 1245, 308, 1099, 201, 538, 657, 657, 1214, 1254, 1245, 1245, 1253, 3, 91, 146, 208, 331, 463, 471, 474, 554, 1254, 1245, 1245, 308, 367, 1254, 1245, 367, 402, 591, 695, 698, 814, 1245, 698, 814, 1245, 698, 1254, 1245, 402, 1254, 1245, 1245, 120, 605, 1252, 1244, 1244, 1254, 890, 1245, 1244, 1245, 367, 402, 591, 592, 1243, 1243, 1245, 1245, 1245, 1245, 1254, 1245, 25, 31, 140, 324, 367, 402, 324, 367, 402, 782, 367, 402, 367, 402, 367, 922, 1114, 1260, 195, 792, 1260, 195, 1260, 1251, 1254, 1245, 1245, 1251, 1245, 925, 25, 140, 612, 399, 1253, 367, 402, 591, 1245, 1245, 1245, 447, 447, 85, 462, 355, 538, 1059, 1059, 1059, 1152, 1152, 480, 1193, 535, 1152, 1213, 979, 297, 820, 1251, 38, 820, 138, 814, 820, 820, 224, 472, 472, 820, 820, 820, 243, 820, 820, 820, 814, 350, 616, 616, 206, 434, 753, 1152, 1128, 814, 535, 538, 524, 643, 1263, 1245, 63, 177, 389, 483, 712, 719, 720, 157, 302, 252, 631, 633, 635, 637, 649, 652, 26, 201, 379, 431, 554, 555, 171, 1245, 484, 1243, 38, 749, 435, 890, 545, 1260, 565, 630, 862, 1245, 173, 814, 534, 681, 682, 1157, 1260, 351, 1251, 782, 782, 782, 782, 534, 782, 1112, 1113, 1114, 399, 157, 534, 157, 157, 156, 1040, 814, 302, 631, 1260, 472, 674, 491, 600, 292, 38, 657, 1251, 292, 308, 3, 787, 788, 782, 27, 535, 868, 869, 874, 38, 243, 376, 450, 490, 880, 881, 882, 883, 880, 308, 243, 302, 125, 216, 455, 470, 756, 757, 1245, 192, 192, 171, 548, 38, 551, 172, 967, 968, 548, 548, 813, 814, 1245, 814, 1245, 548, 548, 548, 548, 243, 548, 399, 171, 548, 548, 308, 548, 292, 120, 322, 534, 1006, 1040, 534, 1022, 1023, 1024, 1260, 535, 659, 201, 201, 201, 201, 201, 495, 1244, 698, 699, 538, 536, 186, 836, 837, 1254, 59, 841, 842, 1263, 447, 534, 177, 155, 405, 155, 405, 384, 470, 273, 1128, 1254, 491, 686, 308, 836, 548, 177, 878, 814, 1128, 866, 301, 866, 866, 1128, 814, 1245, 535, 533, 533, 538, 1152, 142, 1208, 1209, 38, 535, 1152, 535, 535, 535, 177, 535, 535, 512, 1226, 1227, 491, 493, 1231, 1128, 1227, 535, 21, 297, 538, 1235, 314, 1238, 538, 539, 477, 535, 535, 21, 297, 538, 1234, 1234, 538, 535, 1229, 538, 535, 535, 535, 535, 538, 538, 535, 334, 535, 535, 534, 1153, 1153, 1191, 13, 17, 18, 19, 201, 224, 310, 522, 523, 524, 525, 526, 527, 528, 529, 530, 1188, 1153, 535, 535, 171, 177, 407, 535, 535, 38, 1204, 1191, 1204, 1204, 177, 535, 135, 535, 1263, 330, 1167, 38, 535, 538, 1152, 1263, 538, 1152, 1215, 1152, 535, 511, 1153, 1153, 150, 1191, 177, 37, 301, 388, 477, 135, 137, 163, 291, 297, 454, 466, 1200, 1230, 291, 1231, 150, 900, 1152, 430, 1216, 1152, 1205, 1152, 447, 534, 1041, 534, 1174, 534, 1191, 488, 534, 1175, 1260, 439, 441, 439, 441, 1243, 1054, 1054, 1054, 1110, 1059, 1110, 952, 1250, 1149, 573, 994, 266, 534, 535, 1250, 1148, 1148, 533, 533, 535, 534, 1041, 1105, 1115, 1122, 177, 534, 1041, 1090, 1091, 38, 1092, 1093, 1260, 538, 100, 178, 212, 227, 250, 279, 378, 1096, 1093, 38, 1092, 1095, 1260, 1093, 1093, 515, 1109, 1214, 1152, 186, 1073, 1062, 310, 1186, 1189, 514, 860, 5, 1250, 1071, 309, 491, 470, 1068, 261, 1089, 488, 1111, 1260, 1090, 877, 815, 873, 873, 59, 875, 529, 1255, 1255, 308, 1244, 311, 308, 1152, 655, 772, 157, 548, 447, 1254, 1245, 578, 1128, 814, 814, 1128, 702, 1245, 189, 476, 447, 447, 702, 718, 724, 367, 402, 591, 1245, 1245, 1245, 214, 297, 160, 869, 323, 402, 447, 1152, 292, 153, 653, 1245, 534, 534, 157, 534, 679, 206, 534, 772, 422, 641, 642, 772, 402, 25, 140, 371, 372, 402, 595, 603, 604, 724, 920, 394, 157, 548, 157, 548, 1245, 1245, 1245, 1245, 394, 394, 251, 727, 728, 727, 535, 538, 729, 1251, 206, 535, 538, 524, 536, 120, 606, 1260, 160, 1254, 1245, 367, 402, 591, 1245, 1245, 1245, 308, 324, 367, 402, 25, 140, 324, 367, 402, 1128, 289, 1128, 535, 538, 524, 1243, 447, 1255, 472, 745, 160, 657, 389, 931, 488, 664, 664, 657, 253, 331, 297, 1251, 331, 1255, 469, 160, 447, 447, 389, 419, 890, 890, 890, 323, 402, 92, 447, 919, 389, 120, 171, 607, 167, 547, 447, 447, 263, 263, 263, 447, 447, 389, 447, 447, 389, 447, 389, 447, 389, 447, 128, 548, 1128, 292, 1251, 402, 920, 157, 548, 447, 447, 535, 1245, 447, 919, 389, 447, 1254, 1245, 535, 535, 535, 1193, 533, 1128, 814, 224, 820, 1245, 1245, 1245, 224, 420, 421, 617, 1251, 617, 189, 535, 535, 177, 782, 784, 289, 310, 525, 526, 698, 785, 873, 1189, 1251, 1268, 72, 78, 92, 120, 122, 181, 210, 292, 297, 344, 361, 465, 644, 645, 648, 156, 487, 551, 578, 1245, 578, 312, 722, 1243, 1243, 1243, 535, 538, 1255, 186, 379, 1255, 1250, 457, 1243, 657, 3, 171, 750, 890, 48, 565, 434, 731, 113, 991, 1152, 177, 538, 1244, 600, 789, 790, 1251, 535, 538, 1245, 171, 658, 1243, 685, 1243, 1245, 686, 534, 632, 1243, 535, 1245, 491, 493, 675, 599, 38, 157, 1040, 674, 447, 157, 1099, 524, 535, 538, 756, 535, 538, 120, 524, 884, 1251, 578, 434, 872, 873, 171, 889, 51, 374, 885, 886, 883, 886, 125, 216, 395, 470, 942, 1245, 302, 308, 313, 189, 1040, 1128, 534, 535, 538, 548, 472, 548, 472, 548, 1245, 1245, 740, 814, 157, 478, 432, 471, 1007, 1008, 1009, 1260, 308, 1010, 1024, 1025, 538, 1088, 524, 1215, 389, 389, 389, 389, 389, 1244, 538, 834, 1260, 1254, 491, 538, 838, 1254, 538, 844, 163, 311, 454, 843, 1101, 399, 155, 155, 113, 288, 835, 844, 1255, 224, 224, 224, 224, 698, 224, 224, 224, 224, 224, 1196, 443, 1152, 147, 1128, 535, 1152, 228, 465, 465, 535, 1227, 1229, 308, 308, 1225, 1229, 59, 1235, 1152, 1225, 1225, 308, 308, 1233, 1231, 1231, 1152, 535, 1152, 1200, 1152, 1152, 535, 1191, 538, 1128, 1153, 1153, 1153, 1153, 135, 137, 292, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1152, 1152, 1152, 1128, 535, 535, 535, 1191, 535, 538, 59, 1154, 1168, 535, 1263, 1163, 341, 426, 1166, 535, 538, 483, 1159, 38, 535, 1251, 1152, 35, 35, 1152, 535, 1152, 177, 291, 1231, 1152, 535, 150, 1153, 1153, 150, 150, 1152, 1152, 1060, 535, 1191, 538, 1152, 1176, 1260, 1054, 1054, 1054, 1054, 1243, 1243, 1243, 1073, 535, 1073, 535, 999, 533, 1225, 1093, 1095, 1093, 1093, 534, 503, 1154, 535, 1260, 534, 1090, 227, 318, 1097, 1090, 1097, 227, 1096, 1097, 227, 436, 1103, 534, 1260, 534, 315, 59, 190, 1080, 534, 860, 168, 245, 309, 491, 444, 103, 1152, 375, 1012, 308, 535, 529, 877, 457, 180, 383, 390, 397, 435, 458, 849, 171, 849, 535, 122, 210, 288, 292, 773, 1245, 1245, 38, 472, 472, 243, 815, 1254, 1245, 447, 919, 389, 447, 214, 1245, 59, 437, 1245, 535, 157, 534, 662, 663, 855, 1157, 1260, 658, 637, 658, 772, 1245, 658, 120, 1260, 86, 639, 640, 419, 181, 159, 194, 292, 599, 551, 113, 159, 181, 292, 419, 599, 639, 641, 696, 402, 604, 457, 1245, 1260, 394, 726, 1245, 602, 785, 1263, 1245, 323, 402, 447, 919, 389, 447, 160, 447, 447, 389, 179, 310, 422, 794, 795, 179, 310, 802, 803, 447, 447, 389, 535, 535, 535, 926, 289, 698, 873, 927, 1189, 1251, 1268, 367, 1245, 534, 491, 746, 1245, 664, 107, 1260, 534, 664, 1252, 1251, 1251, 1251, 1245, 1245, 1245, 1245, 605, 59, 437, 1245, 1245, 1245, 1245, 478, 1245, 1245, 171, 171, 369, 171, 195, 1254, 1245, 1245, 1254, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 308, 78, 596, 157, 27, 50, 457, 1260, 1245, 1251, 724, 1245, 1245, 1245, 1245, 1059, 535, 224, 820, 224, 224, 224, 820, 551, 472, 622, 623, 702, 772, 491, 493, 814, 534, 814, 1245, 1153, 32, 59, 647, 123, 197, 122, 297, 240, 1243, 646, 179, 348, 768, 775, 776, 1260, 711, 534, 329, 534, 632, 650, 209, 669, 635, 1255, 1255, 1128, 534, 600, 29, 125, 216, 395, 470, 751, 447, 747, 1254, 195, 1243, 733, 495, 308, 535, 1089, 682, 890, 535, 538, 1114, 722, 740, 535, 693, 38, 302, 329, 534, 1001, 634, 636, 638, 652, 1260, 329, 670, 671, 632, 669, 599, 305, 308, 676, 1040, 688, 686, 600, 1251, 1245, 852, 785, 3, 788, 308, 874, 1152, 1152, 538, 534, 880, 457, 538, 44, 1152, 447, 534, 658, 1243, 757, 702, 535, 967, 968, 1245, 1245, 548, 399, 548, 477, 535, 538, 1215, 90, 1012, 535, 538, 1023, 1111, 1152, 1244, 1244, 1244, 1244, 1244, 698, 183, 837, 844, 842, 535, 1245, 113, 177, 548, 844, 297, 823, 1251, 823, 823, 823, 224, 823, 823, 823, 823, 823, 1152, 535, 145, 241, 241, 535, 297, 297, 535, 1061, 1229, 330, 1217, 297, 297, 1229, 1229, 1217, 1217, 535, 535, 177, 535, 1152, 177, 135, 137, 177, 171, 150, 535, 498, 1161, 1191, 360, 477, 59, 1168, 1154, 489, 489, 535, 1152, 288, 1152, 538, 1160, 1130, 1152, 1152, 1152, 1152, 35, 35, 1152, 1152, 150, 535, 535, 535, 1152, 535, 329, 1177, 1243, 1243, 1243, 1243, 1080, 1251, 1080, 1251, 535, 538, 1106, 1107, 1157, 534, 1167, 1092, 534, 1244, 1090, 308, 472, 1098, 1090, 227, 1090, 1248, 1113, 534, 1113, 1260, 1055, 1152, 490, 1171, 900, 444, 302, 1240, 1152, 457, 535, 447, 830, 177, 772, 123, 197, 208, 122, 474, 548, 1128, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1255, 1245, 772, 637, 1152, 535, 538, 491, 78, 854, 858, 854, 535, 535, 535, 120, 1260, 722, 605, 647, 195, 195, 297, 698, 38, 647, 297, 605, 1128, 548, 548, 524, 59, 437, 1245, 1245, 1245, 1245, 1245, 1254, 1245, 1245, 1250, 1250, 1128, 538, 1250, 1250, 538, 1254, 1245, 1245, 447, 1152, 72, 1152, 1255, 1245, 447, 447, 177, 201, 491, 1244, 1244, 814, 1244, 157, 160, 814, 1251, 1251, 1128, 548, 548, 447, 535, 224, 820, 820, 820, 820, 534, 618, 619, 551, 127, 179, 213, 179, 1152, 292, 645, 120, 38, 890, 657, 890, 1248, 35, 156, 201, 723, 727, 302, 631, 607, 154, 203, 534, 399, 472, 658, 38, 1255, 745, 565, 292, 534, 173, 1245, 681, 1251, 399, 600, 156, 1040, 814, 302, 631, 686, 535, 538, 491, 643, 59, 674, 607, 670, 84, 437, 677, 491, 956, 38, 677, 177, 308, 534, 1243, 1251, 871, 891, 892, 1261, 886, 1128, 171, 887, 1243, 177, 447, 911, 362, 758, 211, 703, 548, 535, 548, 548, 1245, 1040, 322, 1040, 1009, 308, 534, 1011, 524, 1024, 1012, 311, 222, 836, 548, 823, 1245, 535, 1218, 1219, 1225, 120, 143, 149, 163, 297, 454, 466, 1221, 1222, 1224, 535, 535, 1229, 1229, 1152, 535, 1153, 177, 1152, 1152, 1152, 534, 535, 538, 535, 1168, 535, 477, 416, 535, 205, 288, 1165, 1152, 1152, 1152, 535, 59, 1059, 1171, 1171, 392, 1049, 1152, 535, 538, 38, 1108, 120, 1120, 1121, 1153, 81, 1244, 535, 1152, 534, 1090, 1098, 534, 535, 1113, 535, 102, 187, 381, 534, 1074, 1075, 1076, 1077, 1078, 1079, 1152, 1172, 1173, 1260, 1059, 535, 1037, 487, 1027, 1028, 1029, 1030, 836, 308, 836, 535, 447, 402, 1018, 535, 202, 660, 663, 310, 900, 814, 546, 814, 361, 660, 660, 643, 38, 157, 157, 534, 596, 785, 1255, 1245, 447, 534, 866, 900, 902, 795, 534, 534, 803, 1245, 535, 534, 535, 402, 1018, 1245, 1245, 534, 534, 534, 491, 515, 976, 369, 976, 976, 171, 1245, 596, 1245, 820, 624, 625, 1263, 54, 101, 126, 145, 150, 172, 176, 191, 297, 352, 620, 618, 1251, 866, 38, 907, 907, 535, 194, 534, 472, 678, 264, 661, 678, 534, 776, 768, 534, 535, 538, 1243, 535, 399, 29, 83, 86, 93, 121, 181, 194, 207, 419, 422, 651, 651, 1242, 1245, 1245, 535, 1040, 746, 157, 113, 722, 177, 1245, 38, 1245, 686, 632, 1243, 535, 636, 312, 1260, 675, 670, 674, 125, 140, 341, 1245, 64, 72, 256, 1040, 814, 1099, 853, 855, 177, 771, 873, 535, 538, 457, 147, 544, 885, 888, 1110, 414, 414, 535, 282, 306, 759, 760, 761, 171, 764, 702, 288, 476, 704, 705, 1007, 92, 853, 136, 1152, 1245, 844, 538, 38, 1152, 37, 301, 308, 535, 491, 493, 1220, 1221, 1223, 171, 1153, 1162, 1191, 288, 510, 205, 535, 1191, 188, 354, 385, 1178, 58, 129, 112, 1050, 38, 1123, 1109, 1106, 534, 1153, 535, 538, 38, 1116, 1117, 1260, 535, 1244, 1191, 535, 534, 403, 534, 535, 538, 538, 38, 1064, 265, 292, 1012, 1028, 35, 1031, 1031, 838, 849, 548, 1245, 437, 854, 534, 890, 534, 859, 599, 1243, 890, 890, 194, 1152, 472, 597, 402, 1018, 1245, 1195, 171, 798, 798, 1195, 1195, 1152, 437, 1191, 1191, 608, 609, 1262, 813, 814, 813, 814, 1244, 548, 535, 538, 120, 527, 534, 575, 626, 698, 973, 1251, 973, 292, 297, 352, 973, 973, 1110, 907, 42, 199, 288, 656, 534, 694, 1152, 206, 178, 328, 408, 308, 665, 666, 667, 535, 1248, 6, 777, 727, 632, 669, 1245, 535, 722, 164, 797, 600, 956, 1243, 495, 1089, 722, 1040, 1001, 670, 632, 669, 643, 534, 676, 674, 675, 385, 385, 72, 311, 72, 686, 852, 535, 538, 1243, 772, 880, 891, 1128, 537, 136, 491, 491, 760, 384, 434, 762, 141, 765, 487, 767, 476, 702, 477, 1245, 535, 293, 470, 722, 548, 1219, 1263, 149, 37, 88, 461, 495, 37, 495, 239, 307, 1228, 308, 535, 1152, 535, 535, 477, 52, 103, 460, 1152, 1179, 1180, 1179, 1179, 535, 168, 168, 658, 1245, 1217, 1113, 538, 1121, 1263, 535, 538, 171, 1128, 535, 535, 1191, 534, 1191, 1075, 1173, 1175, 1082, 265, 1152, 443, 443, 177, 1245, 658, 678, 900, 860, 859, 657, 678, 678, 694, 535, 1152, 437, 535, 314, 392, 358, 799, 799, 535, 535, 535, 1245, 535, 535, 535, 538, 1250, 976, 625, 575, 627, 628, 1251, 1251, 297, 527, 658, 527, 658, 1251, 1251, 208, 695, 535, 437, 125, 470, 308, 667, 308, 666, 534, 535, 538, 607, 399, 722, 814, 38, 38, 534, 1245, 956, 686, 674, 607, 670, 534, 672, 673, 1157, 1260, 677, 675, 676, 311, 311, 534, 202, 856, 855, 171, 886, 30, 217, 943, 179, 179, 973, 384, 418, 766, 534, 156, 1040, 1110, 402, 495, 37, 495, 37, 495, 495, 353, 353, 1223, 143, 149, 1180, 384, 170, 339, 170, 339, 153, 1181, 1181, 1181, 59, 59, 402, 81, 535, 1154, 1117, 315, 3, 120, 292, 297, 332, 1118, 1119, 38, 1094, 368, 1104, 535, 1074, 535, 59, 125, 136, 470, 1032, 1033, 136, 216, 1034, 836, 1018, 535, 664, 535, 860, 661, 772, 772, 1245, 866, 59, 1018, 447, 608, 814, 535, 538, 527, 658, 535, 423, 1245, 63, 288, 373, 402, 668, 668, 535, 6, 399, 1245, 794, 1040, 722, 675, 670, 674, 1152, 535, 538, 858, 858, 676, 677, 853, 534, 646, 141, 293, 534, 938, 940, 944, 1003, 1013, 1020, 1040, 1051, 866, 866, 763, 1260, 1152, 768, 1022, 495, 495, 308, 308, 535, 1221, 35, 103, 186, 288, 444, 658, 658, 1260, 534, 1167, 1153, 1153, 297, 1153, 1119, 1260, 534, 535, 413, 438, 293, 402, 293, 120, 322, 478, 534, 1035, 548, 772, 665, 1018, 814, 534, 628, 24, 120, 297, 1245, 722, 956, 676, 674, 675, 535, 673, 546, 546, 677, 535, 855, 857, 600, 384, 939, 940, 941, 1041, 1042, 538, 538, 535, 1248, 1110, 388, 388, 308, 1180, 384, 316, 402, 402, 447, 472, 281, 1124, 1125, 1260, 81, 1152, 1022, 478, 1007, 534, 1008, 772, 1191, 657, 657, 722, 677, 675, 676, 858, 856, 535, 538, 677, 767, 535, 537, 447, 177, 534, 425, 425, 149, 1260, 1260, 228, 1248, 1249, 1260, 332, 1126, 535, 538, 171, 1128, 1116, 535, 477, 1191, 535, 535, 676, 677, 546, 646, 855, 1110, 156, 941, 414, 414, 5, 769, 770, 1250, 1251, 1263, 534, 120, 1251, 1224, 1125, 315, 157, 332, 1127, 1226, 535, 1035, 535, 322, 1035, 677, 600, 768, 491, 491, 535, 538, 1192, 1249, 38, 81, 535, 1127, 1251, 1220, 1127, 1007, 677, 1248, 179, 179, 770, 1059, 472, 1245, 534, 1224, 1228, 1220, 477, 1110, 534, 866, 866, 535, 1260, 81, 1124, 1223, 1228, 1035, 769, 534, 535, 1223, 535, 1124, 535 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 540, 541, 541, 541, 541, 541, 541, 542, 542, 543, 543, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 545, 545, 546, 546, 547, 547, 548, 548, 548, 549, 550, 551, 551, 551, 552, 552, 553, 553, 554, 554, 554, 554, 554, 554, 554, 554, 554, 555, 555, 555, 555, 555, 555, 556, 557, 557, 558, 558, 559, 559, 559, 559, 560, 560, 560, 560, 560, 560, 561, 562, 563, 563, 564, 564, 564, 564, 565, 565, 566, 566, 566, 566, 566, 566, 567, 567, 567, 567, 568, 568, 568, 569, 569, 569, 569, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 571, 571, 572, 572, 573, 573, 574, 574, 574, 574, 575, 575, 575, 575, 576, 576, 576, 576, 576, 576, 576, 577, 577, 577, 578, 578, 579, 579, 580, 580, 580, 580, 581, 581, 582, 582, 583, 583, 584, 584, 584, 584, 584, 584, 584, 585, 586, 586, 587, 587, 588, 589, 589, 589, 589, 589, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 591, 591, 592, 592, 592, 593, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 595, 595, 596, 596, 597, 597, 598, 598, 598, 598, 599, 600, 600, 601, 601, 602, 602, 602, 602, 603, 603, 604, 604, 604, 604, 605, 605, 606, 606, 607, 607, 607, 607, 608, 609, 609, 610, 611, 611, 612, 612, 612, 612, 613, 613, 614, 614, 615, 615, 616, 616, 617, 617, 617, 618, 618, 619, 619, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 621, 621, 622, 622, 623, 623, 624, 624, 625, 626, 626, 626, 626, 626, 626, 627, 627, 628, 629, 629, 629, 629, 629, 629, 630, 630, 630, 630, 630, 630, 630, 630, 631, 631, 632, 632, 633, 633, 634, 634, 635, 635, 635, 636, 636, 637, 638, 638, 639, 639, 640, 640, 641, 641, 642, 642, 643, 643, 644, 644, 644, 644, 645, 645, 645, 645, 645, 645, 645, 645, 645, 646, 646, 646, 647, 647, 648, 648, 648, 648, 649, 650, 650, 650, 651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 652, 652, 653, 653, 653, 653, 653, 653, 653, 654, 654, 655, 655, 656, 656, 657, 657, 658, 658, 659, 660, 660, 661, 661, 661, 661, 662, 662, 663, 663, 664, 664, 665, 665, 665, 665, 665, 666, 667, 668, 668, 668, 668, 668, 669, 669, 670, 670, 671, 672, 672, 673, 673, 673, 674, 674, 675, 675, 675, 676, 676, 676, 676, 677, 677, 678, 678, 679, 680, 680, 681, 681, 682, 682, 682, 683, 683, 684, 684, 685, 686, 686, 686, 687, 687, 688, 689, 689, 690, 691, 691, 692, 692, 693, 693, 694, 694, 695, 695, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, 697, 697, 698, 698, 698, 698, 699, 699, 700, 700, 701, 701, 702, 702, 703, 703, 704, 704, 705, 705, 706, 706, 707, 708, 708, 709, 709, 710, 710, 711, 711, 712, 712, 712, 712, 713, 714, 714, 715, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 717, 718, 718, 718, 718, 719, 719, 720, 720, 721, 721, 722, 722, 723, 723, 724, 725, 725, 726, 726, 726, 726, 727, 728, 729, 730, 730, 731, 731, 732, 732, 733, 733, 734, 734, 734, 735, 735, 735, 735, 736, 737, 737, 738, 738, 739, 739, 740, 740, 741, 741, 742, 743, 744, 745, 745, 746, 746, 747, 747, 748, 748, 749, 749, 750, 750, 751, 751, 751, 751, 751, 752, 753, 753, 754, 754, 755, 755, 755, 756, 756, 757, 757, 757, 757, 757, 758, 758, 759, 759, 760, 761, 761, 762, 762, 763, 764, 764, 765, 765, 766, 766, 767, 767, 768, 768, 769, 769, 769, 770, 770, 770, 770, 771, 771, 772, 772, 773, 773, 773, 773, 773, 773, 774, 774, 775, 775, 776, 777, 777, 778, 779, 779, 779, 779, 780, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 782, 783, 783, 784, 784, 785, 785, 785, 785, 785, 785, 786, 787, 787, 788, 789, 789, 790, 790, 791, 791, 791, 791, 791, 792, 792, 793, 794, 794, 795, 795, 795, 795, 795, 796, 796, 797, 797, 798, 798, 798, 799, 799, 800, 801, 801, 802, 802, 803, 803, 804, 804, 805, 805, 806, 807, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 810, 810, 810, 810, 810, 811, 811, 811, 811, 811, 811, 811, 811, 812, 812, 812, 813, 813, 814, 814, 815, 815, 816, 816, 817, 818, 818, 818, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, 820, 820, 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, 822, 822, 823, 823, 824, 824, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 825, 826, 826, 827, 827, 828, 829, 829, 830, 830, 830, 830, 830, 831, 831, 832, 832, 832, 832, 832, 833, 833, 834, 834, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 836, 836, 837, 837, 838, 838, 839, 839, 840, 840, 841, 841, 842, 843, 843, 843, 844, 844, 845, 846, 846, 847, 847, 847, 848, 848, 848, 849, 849, 849, 849, 849, 849, 850, 850, 851, 851, 852, 852, 853, 853, 854, 854, 855, 855, 855, 856, 856, 857, 857, 858, 858, 859, 859, 859, 860, 860, 860, 861, 861, 861, 861, 862, 862, 863, 863, 864, 864, 865, 865, 866, 866, 866, 866, 867, 867, 868, 868, 869, 869, 869, 869, 869, 870, 870, 870, 870, 870, 871, 872, 873, 873, 873, 874, 874, 874, 875, 876, 876, 876, 876, 877, 877, 878, 879, 879, 880, 880, 881, 881, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 883, 883, 883, 883, 883, 884, 884, 885, 886, 886, 886, 887, 887, 888, 888, 889, 889, 890, 890, 891, 892, 892, 893, 893, 893, 894, 894, 895, 895, 896, 896, 896, 896, 896, 896, 897, 897, 898, 898, 899, 899, 899, 899, 900, 900, 901, 901, 902, 903, 904, 904, 905, 905, 906, 906, 906, 907, 907, 907, 908, 909, 909, 910, 911, 911, 911, 911, 912, 913, 913, 913, 914, 914, 915, 915, 916, 916, 917, 917, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, 919, 919, 920, 920, 921, 921, 921, 921, 921, 921, 922, 922, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 923, 924, 925, 925, 926, 926, 926, 927, 927, 927, 927, 927, 928, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 929, 930, 930, 930, 931, 931, 931, 931, 931, 931, 931, 932, 932, 933, 933, 933, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935, 936, 936, 937, 938, 938, 938, 939, 939, 940, 940, 940, 940, 940, 941, 941, 942, 942, 942, 942, 943, 943, 943, 944, 945, 945, 946, 947, 947, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 948, 949, 949, 950, 950, 950, 951, 951, 951, 951, 951, 952, 952, 952, 953, 953, 954, 954, 954, 955, 955, 955, 955, 956, 956, 956, 956, 957, 958, 959, 959, 960, 960, 961, 961, 961, 962, 962, 962, 962, 962, 962, 962, 963, 963, 964, 964, 964, 964, 965, 966, 966, 966, 966, 967, 967, 968, 969, 970, 970, 971, 972, 972, 972, 972, 972, 972, 972, 973, 973, 974, 975, 975, 975, 975, 975, 975, 976, 976, 977, 978, 978, 978, 978, 978, 979, 979, 980, 980, 981, 981, 982, 982, 983, 983, 984, 985, 985, 985, 986, 986, 986, 987, 987, 988, 988, 989, 989, 990, 990, 991, 991, 992, 993, 993, 994, 994, 995, 995, 995, 995, 996, 996, 996, 996, 996, 996, 996, 996, 996, 996, 997, 998, 998, 999, 999, 999, 999, 999, 1000, 1000, 1000, 1001, 1001, 1002, 1002, 1002, 1002, 1003, 1004, 1005, 1005, 1006, 1006, 1006, 1006, 1006, 1007, 1007, 1008, 1008, 1009, 1010, 1010, 1010, 1011, 1011, 1011, 1012, 1012, 1013, 1014, 1014, 1015, 1016, 1016, 1017, 1017, 1017, 1017, 1017, 1017, 1017, 1017, 1018, 1018, 1019, 1019, 1019, 1020, 1021, 1022, 1022, 1023, 1023, 1024, 1025, 1025, 1026, 1027, 1027, 1028, 1028, 1028, 1028, 1028, 1029, 1029, 1030, 1030, 1031, 1031, 1032, 1033, 1034, 1034, 1034, 1034, 1034, 1035, 1036, 1037, 1038, 1038, 1038, 1038, 1038, 1038, 1039, 1039, 1039, 1040, 1040, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1043, 1043, 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1045, 1045, 1045, 1046, 1046, 1047, 1048, 1048, 1048, 1049, 1049, 1049, 1050, 1050, 1050, 1051, 1051, 1052, 1052, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1054, 1054, 1055, 1055, 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1059, 1059, 1060, 1061, 1061, 1062, 1062, 1063, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1066, 1066, 1067, 1067, 1068, 1069, 1069, 1069, 1070, 1070, 1071, 1071, 1072, 1072, 1073, 1073, 1074, 1074, 1075, 1075, 1075, 1075, 1075, 1076, 1077, 1078, 1079, 1080, 1080, 1081, 1081, 1082, 1082, 1083, 1083, 1084, 1085, 1085, 1085, 1085, 1086, 1086, 1087, 1087, 1088, 1088, 1089, 1089, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1091, 1091, 1091, 1091, 1091, 1091, 1092, 1092, 1092, 1092, 1093, 1093, 1094, 1094, 1095, 1095, 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1097, 1097, 1098, 1098, 1099, 1099, 1100, 1100, 1100, 1101, 1101, 1102, 1102, 1102, 1103, 1104, 1104, 1105, 1105, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1111, 1112, 1112, 1113, 1113, 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1117, 1118, 1118, 1119, 1119, 1119, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1125, 1125, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1131, 1131, 1131, 1131, 1131, 1132, 1132, 1133, 1133, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1135, 1135, 1136, 1136, 1137, 1137, 1138, 1139, 1140, 1140, 1141, 1141, 1142, 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 1145, 1146, 1146, 1146, 1146, 1147, 1148, 1148, 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1151, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1156, 1156, 1157, 1157, 1157, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1159, 1159, 1160, 1160, 1160, 1160, 1161, 1162, 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1165, 1166, 1166, 1166, 1167, 1167, 1167, 1167, 1168, 1168, 1169, 1169, 1170, 1170, 1171, 1171, 1172, 1172, 1173, 1174, 1174, 1174, 1175, 1176, 1176, 1177, 1177, 1178, 1178, 1178, 1178, 1179, 1179, 1180, 1180, 1180, 1180, 1180, 1181, 1181, 1181, 1181, 1181, 1182, 1182, 1182, 1183, 1183, 1184, 1185, 1185, 1185, 1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1188, 1188, 1189, 1189, 1190, 1190, 1190, 1190, 1190, 1190, 1191, 1191, 1192, 1192, 1193, 1193, 1193, 1194, 1194, 1195, 1195, 1196, 1196, 1196, 1197, 1197, 1198, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1200, 1200, 1200, 1201, 1201, 1202, 1203, 1203, 1203, 1203, 1203, 1204, 1204, 1204, 1205, 1205, 1206, 1207, 1207, 1208, 1209, 1209, 1210, 1210, 1211, 1211, 1212, 1212, 1212, 1212, 1213, 1213, 1214, 1214, 1215, 1215, 1216, 1216, 1217, 1217, 1218, 1218, 1219, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1221, 1221, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1223, 1223, 1223, 1223, 1224, 1224, 1225, 1226, 1226, 1227, 1227, 1228, 1228, 1228, 1228, 1228, 1229, 1229, 1230, 1230, 1230, 1230, 1230, 1231, 1231, 1231, 1231, 1231, 1232, 1232, 1233, 1233, 1234, 1234, 1234, 1235, 1235, 1235, 1236, 1236, 1237, 1237, 1238, 1238, 1239, 1239, 1240, 1240, 1241, 1241, 1241, 1241, 1242, 1242, 1243, 1243, 1244, 1244, 1245, 1246, 1247, 1248, 1248, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1250, 1251, 1252, 1252, 1252, 1253, 1254, 1254, 1254, 1254, 1255, 1255, 1256, 1257, 1258, 1258, 1259, 1259, 1260, 1260, 1260, 1261, 1261, 1261, 1262, 1262, 1262, 1262, 1263, 1263, 1263, 1263, 1263, 1264, 1264, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 2, 2, 2, 2, 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, 0, 1, 0, 1, 0, 1, 0, 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, 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, 5, 7, 1, 3, 4, 4, 4, 3, 2, 5, 3, 6, 4, 6, 6, 9, 5, 7, 6, 6, 5, 5, 5, 5, 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, 4, 3, 2, 2, 3, 4, 4, 4, 5, 1, 3, 2, 2, 0, 2, 0, 1, 1, 1, 3, 3, 2, 0, 1, 3, 3, 1, 5, 3, 1, 2, 1, 3, 2, 3, 1, 1, 1, 1, 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, 4, 3, 3, 2, 1, 0, 3, 0, 1, 0, 1, 3, 2, 1, 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, 6, 2, 4, 2, 2, 1, 0, 2, 2, 1, 0, 2, 0, 3, 1, 1, 2, 2, 1, 4, 4, 5, 2, 5, 7, 5, 2, 3, 0, 1, 2, 1, 2, 2, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 9, 3, 9, 4, 10, 11, 3, 1, 5, 3, 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, 3, 3, 4, 0, 1, 0, 6, 1, 3, 3, 3, 5, 2, 0, 2, 2, 0, 3, 4, 4, 0, 2, 0, 4, 0, 3, 8, 11, 1, 3, 1, 1, 3, 6, 8, 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, 1, 0, 7, 2, 0, 3, 5, 5, 8, 2, 0, 2, 2, 2, 1, 5, 2, 0, 2, 6, 6, 6, 10, 6, 6, 6, 9, 9, 6, 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, 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, 17, 21, 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, 6, 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, 1, 1, 1, 1, 1, 2, 2, 1, 3, 2, 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, 6, 8, 9, 8, 6, 6, 9, 9, 9, 7, 10, 1, 1, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 2, 0, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 4, 4, 3, 4, 4, 1, 1, 1, 0, 8, 8, 11, 1, 1, 2, 4, 5, 1, 3, 2, 2, 2, 2, 2, 1, 3, 1, 3, 1, 2, 2, 4, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 5, 5, 5, 5, 5, 1, 3, 1, 2, 3, 0, 5, 7, 6, 9, 3, 1, 2, 1, 1, 1, 3, 0, 5, 2, 0, 3, 3, 3, 7, 7, 10, 1, 1, 1, 1, 1, 1, 16, 19, 1, 0, 2, 0, 1, 3, 4, 5, 2, 2, 4, 4, 0, 1, 3, 2, 0, 1, 1, 0, 2, 2, 0, 9, 12, 7, 7, 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, 0, 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, 2, 1, 4, 0, 3, 0, 1, 1, 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, 5, 5, 5, 1, 1, 1, 1, 3, 0, 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, 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, 8, 8, 8, 10, 9, 8, 1, 0, 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, 1, 7, 6, 6, 6, 6, 6, 6, 7, 7, 6, 9, 9, 6, 6, 6, 6, 6, 6, 8, 8, 8, 6, 7, 6, 6, 4, 7, 6, 4, 4, 4, 3, 4, 3, 1, 1, 3, 5, 5, 5, 5, 8, 5, 5, 6, 7, 7, 7, 4, 4, 5, 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, 2, 3, 2, 5, 4, 3, 3, 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, 6, 4, 3, 5, 7, 9, 1, 3, 1, 5, 4, 4, 6, 4, 6, 6, 5, 7, 9, 6, 1, 0, 6, 11, 11, 11, 13, 9, 11, 1, 1, 10, 6, 4, 4, 2, 5, 2, 0, 6, 5, 3, 5, 1, 3, 1, 1, 2, 1, 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, 5, 3, 0, 1, 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, 10, 1, 2, 4, 4, 4, 5, 5, 2, 5, 3, 5, 2, 0, 3, 1, 2, 5, 5, 8, 3, 4, 7, 1, 0, 3, 2, 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, 9, 1, 2, 0, 7, 7, 0, 10, 6, 0, 1, 0, 2, 0, 3, 3, 4, 4, 4, 4, 3, 2, 1, 1, 0, 1, 1, 0, 1, 5, 1, 0, 1, 1, 1, 0, 3, 1, 3, 4, 3, 2, 2, 1, 1, 1, 0, 2, 4, 5, 6, 4, 5, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 4, 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, 2, 3, 3, 4, 5, 4, 5, 4, 5, 2, 4, 1, 1, 0, 2, 0, 1, 4, 5, 4, 0, 2, 2, 2, 1, 1, 0, 5, 2, 1, 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, 2, 1, 3, 3, 2, 13, 2, 0, 1, 3, 3, 6, 7, 5, 7, 9, 1, 0, 2, 0, 2, 3, 5, 6, 2, 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, 4, 1, 1, 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, 1, 3, 3, 5, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 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, 3, 4, 4, 6, 3, 3, 4, 3, 4, 4, 5, 4, 5, 1, 1, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 6, 3, 4, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 2, 1, 1, 4, 3, 5, 6, 8, 6, 6, 4, 4, 3, 1, 1, 1, 1, 5, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 1, 6, 4, 4, 6, 4, 4, 4, 4, 4, 6, 5, 5, 5, 4, 6, 4, 4, 4, 4, 5, 7, 7, 9, 5, 4, 6, 5, 7, 7, 8, 4, 7, 4, 6, 6, 4, 5, 4, 5, 3, 11, 8, 9, 2, 3, 3, 3, 4, 0, 4, 1, 3, 3, 1, 1, 1, 1, 2, 0, 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, 0, 1, 3, 3, 3, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 3, 5, 5, 3, 3, 5, 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, 2, 0, 1, 3, 3, 2, 3, 2, 3, 4, 4, 3, 3, 0, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 3, 6, 0, 3, 0, 2, 4, 2, 1, 0, 5, 2, 5, 2, 0, 3, 0, 1, 2, 2, 2, 2, 3, 2, 3, 2, 0, 1, 3, 3, 3, 3, 3, 0, 3, 3, 0, 1, 3, 7, 7, 3, 0, 1, 0, 1, 3, 3, 2, 1, 1, 1, 3, 1, 2, 1, 3, 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, 1, 3, 10, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 956 "gram_minimal.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); (void) yynerrs; /* suppress compiler warning */ } #line 30759 "gram_minimal.c" /* yacc.c:1646 */ break; case 3: #line 961 "gram_minimal.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = list_make1((yyvsp[0].typnam)); } #line 30767 "gram_minimal.c" /* yacc.c:1646 */ break; case 4: #line 965 "gram_minimal.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyvsp[0].node), 0)); } #line 30776 "gram_minimal.c" /* yacc.c:1646 */ break; case 5: #line 970 "gram_minimal.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30788 "gram_minimal.c" /* yacc.c:1646 */ break; case 6: #line 978 "gram_minimal.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30800 "gram_minimal.c" /* yacc.c:1646 */ break; case 7: #line 986 "gram_minimal.y" /* yacc.c:1646 */ { PLAssignStmt *n = (PLAssignStmt *) (yyvsp[0].node); n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } #line 30812 "gram_minimal.c" /* yacc.c:1646 */ break; case 8: #line 1006 "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 30828 "gram_minimal.c" /* yacc.c:1646 */ break; case 9: #line 1018 "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 30839 "gram_minimal.c" /* yacc.c:1646 */ break; case 136: #line 1161 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 30845 "gram_minimal.c" /* yacc.c:1646 */ break; case 137: #line 1168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30851 "gram_minimal.c" /* yacc.c:1646 */ break; case 138: #line 1169 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30857 "gram_minimal.c" /* yacc.c:1646 */ break; case 139: #line 1173 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30863 "gram_minimal.c" /* yacc.c:1646 */ break; case 140: #line 1174 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30869 "gram_minimal.c" /* yacc.c:1646 */ break; case 141: #line 1178 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30875 "gram_minimal.c" /* yacc.c:1646 */ break; case 142: #line 1179 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 30881 "gram_minimal.c" /* yacc.c:1646 */ break; case 143: #line 1183 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_CASCADE; } #line 30887 "gram_minimal.c" /* yacc.c:1646 */ break; case 144: #line 1184 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; } #line 30893 "gram_minimal.c" /* yacc.c:1646 */ break; case 145: #line 1185 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 30899 "gram_minimal.c" /* yacc.c:1646 */ break; case 146: #line 1195 "gram_minimal.y" /* yacc.c:1646 */ { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *) n; } #line 30910 "gram_minimal.c" /* yacc.c:1646 */ break; case 147: #line 1211 "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 30923 "gram_minimal.c" /* yacc.c:1646 */ break; case 151: #line 1233 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30929 "gram_minimal.c" /* yacc.c:1646 */ break; case 152: #line 1234 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30935 "gram_minimal.c" /* yacc.c:1646 */ break; case 153: #line 1238 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30941 "gram_minimal.c" /* yacc.c:1646 */ break; case 154: #line 1239 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30947 "gram_minimal.c" /* yacc.c:1646 */ break; case 155: #line 1244 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 30956 "gram_minimal.c" /* yacc.c:1646 */ break; case 156: #line 1249 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 30964 "gram_minimal.c" /* yacc.c:1646 */ break; case 157: #line 1253 "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 30978 "gram_minimal.c" /* yacc.c:1646 */ break; case 158: #line 1263 "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 30990 "gram_minimal.c" /* yacc.c:1646 */ break; case 159: #line 1271 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("inherit", (Node *) makeBoolean(true), (yylsp[0])); } #line 30998 "gram_minimal.c" /* yacc.c:1646 */ break; case 160: #line 1275 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 31006 "gram_minimal.c" /* yacc.c:1646 */ break; case 161: #line 1279 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validUntil", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 31014 "gram_minimal.c" /* yacc.c:1646 */ break; case 162: #line 1284 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31022 "gram_minimal.c" /* yacc.c:1646 */ break; case 163: #line 1288 "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 *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nosuperuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createrole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreaterole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "replication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "noreplication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createdb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreatedb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "login") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nologin") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *) makeBoolean(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "bypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *) makeBoolean(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nobypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *) makeBoolean(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 *) makeBoolean(false), (yylsp[0])); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", (yyvsp[0].str)), parser_errposition((yylsp[0])))); } #line 31071 "gram_minimal.c" /* yacc.c:1646 */ break; case 164: #line 1335 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 31077 "gram_minimal.c" /* yacc.c:1646 */ break; case 165: #line 1338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("sysid", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 31085 "gram_minimal.c" /* yacc.c:1646 */ break; case 166: #line 1342 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("adminmembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31093 "gram_minimal.c" /* yacc.c:1646 */ break; case 167: #line 1346 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 31101 "gram_minimal.c" /* yacc.c:1646 */ break; case 168: #line 1350 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 31109 "gram_minimal.c" /* yacc.c:1646 */ break; case 169: #line 1354 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 31117 "gram_minimal.c" /* yacc.c:1646 */ break; case 170: #line 1368 "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 31130 "gram_minimal.c" /* yacc.c:1646 */ break; case 171: #line 1387 "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 31143 "gram_minimal.c" /* yacc.c:1646 */ break; case 172: #line 1396 "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 31156 "gram_minimal.c" /* yacc.c:1646 */ break; case 173: #line 1407 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31162 "gram_minimal.c" /* yacc.c:1646 */ break; case 174: #line 1408 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31168 "gram_minimal.c" /* yacc.c:1646 */ break; case 175: #line 1413 "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 31181 "gram_minimal.c" /* yacc.c:1646 */ break; case 176: #line 1422 "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 31194 "gram_minimal.c" /* yacc.c:1646 */ break; case 177: #line 1431 "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 31207 "gram_minimal.c" /* yacc.c:1646 */ break; case 178: #line 1440 "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 31220 "gram_minimal.c" /* yacc.c:1646 */ break; case 179: #line 1462 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31232 "gram_minimal.c" /* yacc.c:1646 */ break; case 180: #line 1470 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31244 "gram_minimal.c" /* yacc.c:1646 */ break; case 181: #line 1478 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31256 "gram_minimal.c" /* yacc.c:1646 */ break; case 182: #line 1486 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 31268 "gram_minimal.c" /* yacc.c:1646 */ break; case 183: #line 1494 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31280 "gram_minimal.c" /* yacc.c:1646 */ break; case 184: #line 1502 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31292 "gram_minimal.c" /* yacc.c:1646 */ break; case 185: #line 1520 "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 31305 "gram_minimal.c" /* yacc.c:1646 */ break; case 186: #line 1539 "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 31319 "gram_minimal.c" /* yacc.c:1646 */ break; case 187: #line 1550 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = +1; } #line 31325 "gram_minimal.c" /* yacc.c:1646 */ break; case 188: #line 1551 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = -1; } #line 31331 "gram_minimal.c" /* yacc.c:1646 */ break; case 189: #line 1563 "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 31346 "gram_minimal.c" /* yacc.c:1646 */ break; case 190: #line 1574 "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 31361 "gram_minimal.c" /* yacc.c:1646 */ break; case 191: #line 1585 "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 31381 "gram_minimal.c" /* yacc.c:1646 */ break; case 192: #line 1601 "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 31401 "gram_minimal.c" /* yacc.c:1646 */ break; case 193: #line 1620 "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 31411 "gram_minimal.c" /* yacc.c:1646 */ break; case 194: #line 1626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31417 "gram_minimal.c" /* yacc.c:1646 */ break; case 201: #line 1654 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minimum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 31428 "gram_minimal.c" /* yacc.c:1646 */ break; case 202: #line 1661 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 31439 "gram_minimal.c" /* yacc.c:1646 */ break; case 203: #line 1668 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 31450 "gram_minimal.c" /* yacc.c:1646 */ break; case 204: #line 1675 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 31461 "gram_minimal.c" /* yacc.c:1646 */ break; case 205: #line 1685 "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 31474 "gram_minimal.c" /* yacc.c:1646 */ break; case 206: #line 1694 "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 31487 "gram_minimal.c" /* yacc.c:1646 */ break; case 208: #line 1707 "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 31500 "gram_minimal.c" /* yacc.c:1646 */ break; case 209: #line 1716 "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 31513 "gram_minimal.c" /* yacc.c:1646 */ break; case 210: #line 1725 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31525 "gram_minimal.c" /* yacc.c:1646 */ break; case 211: #line 1733 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31537 "gram_minimal.c" /* yacc.c:1646 */ break; case 212: #line 1743 "gram_minimal.y" /* yacc.c:1646 */ {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 31543 "gram_minimal.c" /* yacc.c:1646 */ break; case 213: #line 1745 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 31555 "gram_minimal.c" /* yacc.c:1646 */ break; case 214: #line 1754 "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 31571 "gram_minimal.c" /* yacc.c:1646 */ break; case 215: #line 1766 "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 31583 "gram_minimal.c" /* yacc.c:1646 */ break; case 216: #line 1774 "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 31596 "gram_minimal.c" /* yacc.c:1646 */ break; case 217: #line 1783 "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 31612 "gram_minimal.c" /* yacc.c:1646 */ break; case 218: #line 1795 "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 31625 "gram_minimal.c" /* yacc.c:1646 */ break; case 219: #line 1804 "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 31638 "gram_minimal.c" /* yacc.c:1646 */ break; case 220: #line 1813 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 31650 "gram_minimal.c" /* yacc.c:1646 */ break; case 221: #line 1821 "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 31663 "gram_minimal.c" /* yacc.c:1646 */ break; case 222: #line 1831 "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 31676 "gram_minimal.c" /* yacc.c:1646 */ break; case 223: #line 1841 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31682 "gram_minimal.c" /* yacc.c:1646 */ break; case 224: #line 1843 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 31688 "gram_minimal.c" /* yacc.c:1646 */ break; case 225: #line 1846 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 31694 "gram_minimal.c" /* yacc.c:1646 */ break; case 226: #line 1847 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 31700 "gram_minimal.c" /* yacc.c:1646 */ break; case 227: #line 1851 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31706 "gram_minimal.c" /* yacc.c:1646 */ break; case 228: #line 1853 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 31712 "gram_minimal.c" /* yacc.c:1646 */ break; case 229: #line 1856 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "read uncommitted"; } #line 31718 "gram_minimal.c" /* yacc.c:1646 */ break; case 230: #line 1857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "read committed"; } #line 31724 "gram_minimal.c" /* yacc.c:1646 */ break; case 231: #line 1858 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "repeatable read"; } #line 31730 "gram_minimal.c" /* yacc.c:1646 */ break; case 232: #line 1859 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "serializable"; } #line 31736 "gram_minimal.c" /* yacc.c:1646 */ break; case 233: #line 1863 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "true"; } #line 31742 "gram_minimal.c" /* yacc.c:1646 */ break; case 234: #line 1864 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "false"; } #line 31748 "gram_minimal.c" /* yacc.c:1646 */ break; case 235: #line 1865 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "on"; } #line 31754 "gram_minimal.c" /* yacc.c:1646 */ break; case 236: #line 1871 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31760 "gram_minimal.c" /* yacc.c:1646 */ break; case 237: #line 1884 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31768 "gram_minimal.c" /* yacc.c:1646 */ break; case 238: #line 1888 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 31776 "gram_minimal.c" /* yacc.c:1646 */ break; case 239: #line 1892 "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.ival.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 31797 "gram_minimal.c" /* yacc.c:1646 */ break; case 240: #line 1909 "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 31809 "gram_minimal.c" /* yacc.c:1646 */ break; case 241: #line 1916 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].node), (yylsp[0])); } #line 31815 "gram_minimal.c" /* yacc.c:1646 */ break; case 242: #line 1917 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 31821 "gram_minimal.c" /* yacc.c:1646 */ break; case 243: #line 1918 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 31827 "gram_minimal.c" /* yacc.c:1646 */ break; case 244: #line 1922 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31833 "gram_minimal.c" /* yacc.c:1646 */ break; case 245: #line 1923 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31839 "gram_minimal.c" /* yacc.c:1646 */ break; case 246: #line 1924 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31845 "gram_minimal.c" /* yacc.c:1646 */ break; case 247: #line 1928 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31851 "gram_minimal.c" /* yacc.c:1646 */ break; case 248: #line 1929 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31857 "gram_minimal.c" /* yacc.c:1646 */ break; case 249: #line 1933 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 31863 "gram_minimal.c" /* yacc.c:1646 */ break; case 250: #line 1935 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minimum */ (yyval.node) = (Node *) n; } #line 31873 "gram_minimal.c" /* yacc.c:1646 */ break; case 251: #line 1943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 31879 "gram_minimal.c" /* yacc.c:1646 */ break; case 252: #line 1945 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; (yyval.vsetstmt) = n; } #line 31891 "gram_minimal.c" /* yacc.c:1646 */ break; case 253: #line 1953 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; (yyval.vsetstmt) = n; } #line 31903 "gram_minimal.c" /* yacc.c:1646 */ break; case 254: #line 1961 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 31915 "gram_minimal.c" /* yacc.c:1646 */ break; case 255: #line 1972 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); (yyval.vsetstmt) = n; } #line 31927 "gram_minimal.c" /* yacc.c:1646 */ break; case 256: #line 1980 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.vsetstmt) = n; } #line 31938 "gram_minimal.c" /* yacc.c:1646 */ break; case 257: #line 1990 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 31944 "gram_minimal.c" /* yacc.c:1646 */ break; case 258: #line 1991 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 31950 "gram_minimal.c" /* yacc.c:1646 */ break; case 259: #line 1996 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 31956 "gram_minimal.c" /* yacc.c:1646 */ break; case 260: #line 1997 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 31962 "gram_minimal.c" /* yacc.c:1646 */ break; case 261: #line 2004 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 31972 "gram_minimal.c" /* yacc.c:1646 */ break; case 262: #line 2010 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 31982 "gram_minimal.c" /* yacc.c:1646 */ break; case 263: #line 2016 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 31993 "gram_minimal.c" /* yacc.c:1646 */ break; case 264: #line 2023 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 32004 "gram_minimal.c" /* yacc.c:1646 */ break; case 265: #line 2030 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 32015 "gram_minimal.c" /* yacc.c:1646 */ break; case 266: #line 2037 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 32026 "gram_minimal.c" /* yacc.c:1646 */ break; case 267: #line 2044 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 32037 "gram_minimal.c" /* yacc.c:1646 */ break; case 268: #line 2055 "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 32049 "gram_minimal.c" /* yacc.c:1646 */ break; case 269: #line 2065 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32055 "gram_minimal.c" /* yacc.c:1646 */ break; case 270: #line 2066 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32061 "gram_minimal.c" /* yacc.c:1646 */ break; case 271: #line 2070 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32067 "gram_minimal.c" /* yacc.c:1646 */ break; case 272: #line 2071 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32073 "gram_minimal.c" /* yacc.c:1646 */ break; case 273: #line 2080 "gram_minimal.y" /* yacc.c:1646 */ { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *) n; } #line 32083 "gram_minimal.c" /* yacc.c:1646 */ break; case 274: #line 2096 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 32094 "gram_minimal.c" /* yacc.c:1646 */ break; case 275: #line 2103 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 32105 "gram_minimal.c" /* yacc.c:1646 */ break; case 276: #line 2110 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 32116 "gram_minimal.c" /* yacc.c:1646 */ break; case 277: #line 2117 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 32127 "gram_minimal.c" /* yacc.c:1646 */ break; case 278: #line 2124 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 32138 "gram_minimal.c" /* yacc.c:1646 */ break; case 279: #line 2144 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32152 "gram_minimal.c" /* yacc.c:1646 */ break; case 280: #line 2154 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32166 "gram_minimal.c" /* yacc.c:1646 */ break; case 281: #line 2164 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32180 "gram_minimal.c" /* yacc.c:1646 */ break; case 282: #line 2174 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32194 "gram_minimal.c" /* yacc.c:1646 */ break; case 283: #line 2184 "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 32210 "gram_minimal.c" /* yacc.c:1646 */ break; case 284: #line 2196 "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 32226 "gram_minimal.c" /* yacc.c:1646 */ break; case 285: #line 2208 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32240 "gram_minimal.c" /* yacc.c:1646 */ break; case 286: #line 2218 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_INDEX; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32254 "gram_minimal.c" /* yacc.c:1646 */ break; case 287: #line 2228 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->objtype = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32268 "gram_minimal.c" /* yacc.c:1646 */ break; case 288: #line 2238 "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 32284 "gram_minimal.c" /* yacc.c:1646 */ break; case 289: #line 2250 "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 32300 "gram_minimal.c" /* yacc.c:1646 */ break; case 290: #line 2262 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_SEQUENCE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32314 "gram_minimal.c" /* yacc.c:1646 */ break; case 291: #line 2272 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_SEQUENCE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32328 "gram_minimal.c" /* yacc.c:1646 */ break; case 292: #line 2282 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_VIEW; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32342 "gram_minimal.c" /* yacc.c:1646 */ break; case 293: #line 2292 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_VIEW; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32356 "gram_minimal.c" /* yacc.c:1646 */ break; case 294: #line 2302 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_MATVIEW; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32370 "gram_minimal.c" /* yacc.c:1646 */ break; case 295: #line 2312 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_MATVIEW; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32384 "gram_minimal.c" /* yacc.c:1646 */ break; case 296: #line 2322 "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 32400 "gram_minimal.c" /* yacc.c:1646 */ break; case 297: #line 2334 "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 32416 "gram_minimal.c" /* yacc.c:1646 */ break; case 298: #line 2346 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_FOREIGN_TABLE; n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32430 "gram_minimal.c" /* yacc.c:1646 */ break; case 299: #line 2356 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = (yyvsp[0].list); n->objtype = OBJECT_FOREIGN_TABLE; n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32444 "gram_minimal.c" /* yacc.c:1646 */ break; case 300: #line 2368 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32450 "gram_minimal.c" /* yacc.c:1646 */ break; case 301: #line 2369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 32456 "gram_minimal.c" /* yacc.c:1646 */ break; case 302: #line 2375 "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); cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32473 "gram_minimal.c" /* yacc.c:1646 */ break; case 303: #line 2389 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = (yyvsp[-1].range); cmd->bound = NULL; cmd->concurrent = (yyvsp[0].boolean); n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32490 "gram_minimal.c" /* yacc.c:1646 */ break; case 304: #line 2402 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartitionFinalize; cmd->name = (yyvsp[-1].range); cmd->bound = NULL; cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32506 "gram_minimal.c" /* yacc.c:1646 */ break; case 305: #line 2418 "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; cmd->concurrent = false; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 32523 "gram_minimal.c" /* yacc.c:1646 */ break; case 306: #line 2435 "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 32536 "gram_minimal.c" /* yacc.c:1646 */ break; case 307: #line 2445 "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 32549 "gram_minimal.c" /* yacc.c:1646 */ break; case 308: #line 2455 "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 32562 "gram_minimal.c" /* yacc.c:1646 */ break; case 309: #line 2465 "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 32575 "gram_minimal.c" /* yacc.c:1646 */ break; case 310: #line 2475 "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 32588 "gram_minimal.c" /* yacc.c:1646 */ break; case 311: #line 2485 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 32600 "gram_minimal.c" /* yacc.c:1646 */ break; case 312: #line 2494 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 32612 "gram_minimal.c" /* yacc.c:1646 */ break; case 313: #line 2503 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetExpression; n->name = (yyvsp[-6].str); n->def = (yyvsp[-1].node); (yyval.node) = (Node *) n; } #line 32625 "gram_minimal.c" /* yacc.c:1646 */ break; case 314: #line 2513 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-2].str); (yyval.node) = (Node *) n; } #line 32637 "gram_minimal.c" /* yacc.c:1646 */ break; case 315: #line 2522 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32650 "gram_minimal.c" /* yacc.c:1646 */ break; case 316: #line 2532 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = (yyvsp[-3].str); n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32663 "gram_minimal.c" /* yacc.c:1646 */ break; case 317: #line 2542 "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 = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32682 "gram_minimal.c" /* yacc.c:1646 */ break; case 318: #line 2558 "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 32695 "gram_minimal.c" /* yacc.c:1646 */ break; case 319: #line 2568 "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 32708 "gram_minimal.c" /* yacc.c:1646 */ break; case 320: #line 2578 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStorage; n->name = (yyvsp[-2].str); n->def = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 32721 "gram_minimal.c" /* yacc.c:1646 */ break; case 321: #line 2588 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetCompression; n->name = (yyvsp[-2].str); n->def = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 32734 "gram_minimal.c" /* yacc.c:1646 */ break; case 322: #line 2598 "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 32754 "gram_minimal.c" /* yacc.c:1646 */ break; case 323: #line 2615 "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 32767 "gram_minimal.c" /* yacc.c:1646 */ break; case 324: #line 2625 "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 32780 "gram_minimal.c" /* yacc.c:1646 */ break; case 325: #line 2635 "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 32793 "gram_minimal.c" /* yacc.c:1646 */ break; case 326: #line 2645 "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 32807 "gram_minimal.c" /* yacc.c:1646 */ break; case 327: #line 2656 "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 32821 "gram_minimal.c" /* yacc.c:1646 */ break; case 328: #line 2670 "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 32840 "gram_minimal.c" /* yacc.c:1646 */ break; case 329: #line 2686 "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 32852 "gram_minimal.c" /* yacc.c:1646 */ break; case 330: #line 2695 "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 32864 "gram_minimal.c" /* yacc.c:1646 */ break; case 331: #line 2704 "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 32882 "gram_minimal.c" /* yacc.c:1646 */ break; case 332: #line 2719 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32894 "gram_minimal.c" /* yacc.c:1646 */ break; case 333: #line 2728 "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 32908 "gram_minimal.c" /* yacc.c:1646 */ break; case 334: #line 2739 "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 32922 "gram_minimal.c" /* yacc.c:1646 */ break; case 335: #line 2750 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *) n; } #line 32933 "gram_minimal.c" /* yacc.c:1646 */ break; case 336: #line 2758 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32945 "gram_minimal.c" /* yacc.c:1646 */ break; case 337: #line 2767 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *) n; } #line 32957 "gram_minimal.c" /* yacc.c:1646 */ break; case 338: #line 2776 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *) n; } #line 32968 "gram_minimal.c" /* yacc.c:1646 */ break; case 339: #line 2784 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *) n; } #line 32979 "gram_minimal.c" /* yacc.c:1646 */ break; case 340: #line 2792 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 32991 "gram_minimal.c" /* yacc.c:1646 */ break; case 341: #line 2801 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33003 "gram_minimal.c" /* yacc.c:1646 */ break; case 342: #line 2810 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33015 "gram_minimal.c" /* yacc.c:1646 */ break; case 343: #line 2819 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *) n; } #line 33026 "gram_minimal.c" /* yacc.c:1646 */ break; case 344: #line 2827 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *) n; } #line 33037 "gram_minimal.c" /* yacc.c:1646 */ break; case 345: #line 2835 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33049 "gram_minimal.c" /* yacc.c:1646 */ break; case 346: #line 2844 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *) n; } #line 33060 "gram_minimal.c" /* yacc.c:1646 */ break; case 347: #line 2852 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *) n; } #line 33071 "gram_minimal.c" /* yacc.c:1646 */ break; case 348: #line 2860 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33083 "gram_minimal.c" /* yacc.c:1646 */ break; case 349: #line 2869 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33095 "gram_minimal.c" /* yacc.c:1646 */ break; case 350: #line 2878 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33107 "gram_minimal.c" /* yacc.c:1646 */ break; case 351: #line 2887 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33119 "gram_minimal.c" /* yacc.c:1646 */ break; case 352: #line 2896 "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 33131 "gram_minimal.c" /* yacc.c:1646 */ break; case 353: #line 2905 "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 33143 "gram_minimal.c" /* yacc.c:1646 */ break; case 354: #line 2914 "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 33157 "gram_minimal.c" /* yacc.c:1646 */ break; case 355: #line 2925 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *) n; } #line 33168 "gram_minimal.c" /* yacc.c:1646 */ break; case 356: #line 2933 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 33180 "gram_minimal.c" /* yacc.c:1646 */ break; case 357: #line 2942 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetAccessMethod; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33192 "gram_minimal.c" /* yacc.c:1646 */ break; case 358: #line 2951 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33204 "gram_minimal.c" /* yacc.c:1646 */ break; case 359: #line 2960 "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 33216 "gram_minimal.c" /* yacc.c:1646 */ break; case 360: #line 2969 "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 33228 "gram_minimal.c" /* yacc.c:1646 */ break; case 361: #line 2978 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 33240 "gram_minimal.c" /* yacc.c:1646 */ break; case 362: #line 2987 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *) n; } #line 33251 "gram_minimal.c" /* yacc.c:1646 */ break; case 363: #line 2995 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *) n; } #line 33262 "gram_minimal.c" /* yacc.c:1646 */ break; case 364: #line 3003 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *) n; } #line 33273 "gram_minimal.c" /* yacc.c:1646 */ break; case 365: #line 3011 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *) n; } #line 33284 "gram_minimal.c" /* yacc.c:1646 */ break; case 366: #line 3018 "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 33296 "gram_minimal.c" /* yacc.c:1646 */ break; case 367: #line 3028 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33302 "gram_minimal.c" /* yacc.c:1646 */ break; case 368: #line 3029 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33308 "gram_minimal.c" /* yacc.c:1646 */ break; case 369: #line 3034 "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 33321 "gram_minimal.c" /* yacc.c:1646 */ break; case 370: #line 3042 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33327 "gram_minimal.c" /* yacc.c:1646 */ break; case 371: #line 3046 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 33333 "gram_minimal.c" /* yacc.c:1646 */ break; case 372: #line 3047 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33339 "gram_minimal.c" /* yacc.c:1646 */ break; case 373: #line 3052 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 33351 "gram_minimal.c" /* yacc.c:1646 */ break; case 374: #line 3060 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 33363 "gram_minimal.c" /* yacc.c:1646 */ break; case 375: #line 3068 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 33375 "gram_minimal.c" /* yacc.c:1646 */ break; case 376: #line 3076 "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 33387 "gram_minimal.c" /* yacc.c:1646 */ break; case 377: #line 3086 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33393 "gram_minimal.c" /* yacc.c:1646 */ break; case 378: #line 3089 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33399 "gram_minimal.c" /* yacc.c:1646 */ break; case 379: #line 3090 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33405 "gram_minimal.c" /* yacc.c:1646 */ break; case 380: #line 3094 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33411 "gram_minimal.c" /* yacc.c:1646 */ break; case 381: #line 3095 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33417 "gram_minimal.c" /* yacc.c:1646 */ break; case 382: #line 3101 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 33425 "gram_minimal.c" /* yacc.c:1646 */ break; case 383: #line 3105 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 33433 "gram_minimal.c" /* yacc.c:1646 */ break; case 384: #line 3109 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 33442 "gram_minimal.c" /* yacc.c:1646 */ break; case 385: #line 3114 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 33450 "gram_minimal.c" /* yacc.c:1646 */ break; case 386: #line 3121 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33456 "gram_minimal.c" /* yacc.c:1646 */ break; case 387: #line 3123 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 33462 "gram_minimal.c" /* yacc.c:1646 */ break; case 388: #line 3128 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 33470 "gram_minimal.c" /* yacc.c:1646 */ break; case 389: #line 3132 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 33478 "gram_minimal.c" /* yacc.c:1646 */ break; case 390: #line 3136 "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 33493 "gram_minimal.c" /* yacc.c:1646 */ break; case 391: #line 3147 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 33501 "gram_minimal.c" /* yacc.c:1646 */ break; case 392: #line 3153 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 33507 "gram_minimal.c" /* yacc.c:1646 */ break; case 393: #line 3154 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 33513 "gram_minimal.c" /* yacc.c:1646 */ break; case 394: #line 3158 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 33519 "gram_minimal.c" /* yacc.c:1646 */ break; case 395: #line 3159 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 33525 "gram_minimal.c" /* yacc.c:1646 */ break; case 396: #line 3165 "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 33580 "gram_minimal.c" /* yacc.c:1646 */ break; case 397: #line 3218 "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 33595 "gram_minimal.c" /* yacc.c:1646 */ break; case 398: #line 3231 "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 33611 "gram_minimal.c" /* yacc.c:1646 */ break; case 399: #line 3245 "gram_minimal.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 33624 "gram_minimal.c" /* yacc.c:1646 */ break; case 400: #line 3257 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 33632 "gram_minimal.c" /* yacc.c:1646 */ break; case 401: #line 3264 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33640 "gram_minimal.c" /* yacc.c:1646 */ break; case 402: #line 3268 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33648 "gram_minimal.c" /* yacc.c:1646 */ break; case 403: #line 3282 "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->objtype = OBJECT_TYPE; (yyval.node) = (Node *) n; } #line 33662 "gram_minimal.c" /* yacc.c:1646 */ break; case 404: #line 3294 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33668 "gram_minimal.c" /* yacc.c:1646 */ break; case 405: #line 3295 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33674 "gram_minimal.c" /* yacc.c:1646 */ break; case 406: #line 3301 "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 33687 "gram_minimal.c" /* yacc.c:1646 */ break; case 407: #line 3311 "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 33701 "gram_minimal.c" /* yacc.c:1646 */ break; case 408: #line 3322 "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 33715 "gram_minimal.c" /* yacc.c:1646 */ break; case 409: #line 3333 "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 33735 "gram_minimal.c" /* yacc.c:1646 */ break; case 410: #line 3360 "gram_minimal.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33746 "gram_minimal.c" /* yacc.c:1646 */ break; case 411: #line 3367 "gram_minimal.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *) n; } #line 33757 "gram_minimal.c" /* yacc.c:1646 */ break; case 412: #line 3403 "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 33795 "gram_minimal.c" /* yacc.c:1646 */ break; case 413: #line 3437 "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 33819 "gram_minimal.c" /* yacc.c:1646 */ break; case 414: #line 3459 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33825 "gram_minimal.c" /* yacc.c:1646 */ break; case 415: #line 3460 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33831 "gram_minimal.c" /* yacc.c:1646 */ break; case 416: #line 3464 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33837 "gram_minimal.c" /* yacc.c:1646 */ break; case 417: #line 3465 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33843 "gram_minimal.c" /* yacc.c:1646 */ break; case 418: #line 3474 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 33849 "gram_minimal.c" /* yacc.c:1646 */ break; case 419: #line 3475 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 33855 "gram_minimal.c" /* yacc.c:1646 */ break; case 420: #line 3476 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 33861 "gram_minimal.c" /* yacc.c:1646 */ break; case 421: #line 3479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33867 "gram_minimal.c" /* yacc.c:1646 */ break; case 422: #line 3480 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33873 "gram_minimal.c" /* yacc.c:1646 */ break; case 423: #line 3485 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 33879 "gram_minimal.c" /* yacc.c:1646 */ break; case 424: #line 3486 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33885 "gram_minimal.c" /* yacc.c:1646 */ break; case 425: #line 3491 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 33893 "gram_minimal.c" /* yacc.c:1646 */ break; case 426: #line 3495 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("freeze", (Node *) makeBoolean(true), (yylsp[0])); } #line 33901 "gram_minimal.c" /* yacc.c:1646 */ break; case 427: #line 3499 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 33909 "gram_minimal.c" /* yacc.c:1646 */ break; case 428: #line 3503 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("null", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 33917 "gram_minimal.c" /* yacc.c:1646 */ break; case 429: #line 3507 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("csv"), (yylsp[0])); } #line 33925 "gram_minimal.c" /* yacc.c:1646 */ break; case 430: #line 3511 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("header", (Node *) makeBoolean(true), (yylsp[0])); } #line 33933 "gram_minimal.c" /* yacc.c:1646 */ break; case 431: #line 3515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("quote", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 33941 "gram_minimal.c" /* yacc.c:1646 */ break; case 432: #line 3519 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("escape", (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 33949 "gram_minimal.c" /* yacc.c:1646 */ break; case 433: #line 3523 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 33957 "gram_minimal.c" /* yacc.c:1646 */ break; case 434: #line 3527 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 33965 "gram_minimal.c" /* yacc.c:1646 */ break; case 435: #line 3531 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *) (yyvsp[0].list), (yylsp[-3])); } #line 33973 "gram_minimal.c" /* yacc.c:1646 */ break; case 436: #line 3535 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *) makeNode(A_Star), (yylsp[-3])); } #line 33981 "gram_minimal.c" /* yacc.c:1646 */ break; case 437: #line 3539 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 33989 "gram_minimal.c" /* yacc.c:1646 */ break; case 438: #line 3543 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *) makeNode(A_Star), (yylsp[-2])); } #line 33997 "gram_minimal.c" /* yacc.c:1646 */ break; case 439: #line 3547 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 34005 "gram_minimal.c" /* yacc.c:1646 */ break; case 440: #line 3556 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *) makeString("binary"), (yylsp[0])); } #line 34013 "gram_minimal.c" /* yacc.c:1646 */ break; case 441: #line 3559 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 34019 "gram_minimal.c" /* yacc.c:1646 */ break; case 442: #line 3564 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 34027 "gram_minimal.c" /* yacc.c:1646 */ break; case 443: #line 3567 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 34033 "gram_minimal.c" /* yacc.c:1646 */ break; case 446: #line 3578 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 34041 "gram_minimal.c" /* yacc.c:1646 */ break; case 447: #line 3582 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 34049 "gram_minimal.c" /* yacc.c:1646 */ break; case 448: #line 3589 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 34057 "gram_minimal.c" /* yacc.c:1646 */ break; case 449: #line 3595 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 34063 "gram_minimal.c" /* yacc.c:1646 */ break; case 450: #line 3596 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 34069 "gram_minimal.c" /* yacc.c:1646 */ break; case 451: #line 3597 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 34075 "gram_minimal.c" /* yacc.c:1646 */ break; case 452: #line 3598 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString("default"); } #line 34081 "gram_minimal.c" /* yacc.c:1646 */ break; case 453: #line 3599 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 34087 "gram_minimal.c" /* yacc.c:1646 */ break; case 454: #line 3600 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 34093 "gram_minimal.c" /* yacc.c:1646 */ break; case 455: #line 3605 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34101 "gram_minimal.c" /* yacc.c:1646 */ break; case 456: #line 3609 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34109 "gram_minimal.c" /* yacc.c:1646 */ break; case 457: #line 3616 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 34115 "gram_minimal.c" /* yacc.c:1646 */ break; case 458: #line 3630 "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 34137 "gram_minimal.c" /* yacc.c:1646 */ break; case 459: #line 3650 "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 34159 "gram_minimal.c" /* yacc.c:1646 */ break; case 460: #line 3670 "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 34182 "gram_minimal.c" /* yacc.c:1646 */ break; case 461: #line 3691 "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 34205 "gram_minimal.c" /* yacc.c:1646 */ break; case 462: #line 3712 "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 34228 "gram_minimal.c" /* yacc.c:1646 */ break; case 463: #line 3733 "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 34251 "gram_minimal.c" /* yacc.c:1646 */ break; case 464: #line 3764 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34257 "gram_minimal.c" /* yacc.c:1646 */ break; case 465: #line 3765 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34263 "gram_minimal.c" /* yacc.c:1646 */ break; case 466: #line 3766 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34269 "gram_minimal.c" /* yacc.c:1646 */ break; case 467: #line 3767 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 34275 "gram_minimal.c" /* yacc.c:1646 */ break; case 468: #line 3769 "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 34286 "gram_minimal.c" /* yacc.c:1646 */ break; case 469: #line 3776 "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 34297 "gram_minimal.c" /* yacc.c:1646 */ break; case 470: #line 3782 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 34303 "gram_minimal.c" /* yacc.c:1646 */ break; case 471: #line 3783 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 34309 "gram_minimal.c" /* yacc.c:1646 */ break; case 472: #line 3787 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34315 "gram_minimal.c" /* yacc.c:1646 */ break; case 473: #line 3788 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34321 "gram_minimal.c" /* yacc.c:1646 */ break; case 474: #line 3792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 34327 "gram_minimal.c" /* yacc.c:1646 */ break; case 475: #line 3793 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34333 "gram_minimal.c" /* yacc.c:1646 */ break; case 476: #line 3798 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34341 "gram_minimal.c" /* yacc.c:1646 */ break; case 477: #line 3802 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34349 "gram_minimal.c" /* yacc.c:1646 */ break; case 478: #line 3809 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 34357 "gram_minimal.c" /* yacc.c:1646 */ break; case 479: #line 3813 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 34365 "gram_minimal.c" /* yacc.c:1646 */ break; case 480: #line 3819 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34371 "gram_minimal.c" /* yacc.c:1646 */ break; case 481: #line 3820 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34377 "gram_minimal.c" /* yacc.c:1646 */ break; case 482: #line 3821 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34383 "gram_minimal.c" /* yacc.c:1646 */ break; case 483: #line 3825 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34389 "gram_minimal.c" /* yacc.c:1646 */ break; case 484: #line 3826 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34395 "gram_minimal.c" /* yacc.c:1646 */ break; case 485: #line 3830 "gram_minimal.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-5].str); n->typeName = (yyvsp[-4].typnam); n->storage_name = (yyvsp[-3].str); n->compression = (yyvsp[-2].str); 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[-5]); (yyval.node) = (Node *) n; } #line 34421 "gram_minimal.c" /* yacc.c:1646 */ break; case 486: #line 3854 "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 34444 "gram_minimal.c" /* yacc.c:1646 */ break; case 487: #line 3873 "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 34467 "gram_minimal.c" /* yacc.c:1646 */ break; case 488: #line 3894 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34473 "gram_minimal.c" /* yacc.c:1646 */ break; case 489: #line 3895 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("default"); } #line 34479 "gram_minimal.c" /* yacc.c:1646 */ break; case 490: #line 3899 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34485 "gram_minimal.c" /* yacc.c:1646 */ break; case 491: #line 3900 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34491 "gram_minimal.c" /* yacc.c:1646 */ break; case 492: #line 3904 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34497 "gram_minimal.c" /* yacc.c:1646 */ break; case 493: #line 3905 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("default"); } #line 34503 "gram_minimal.c" /* yacc.c:1646 */ break; case 494: #line 3909 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34509 "gram_minimal.c" /* yacc.c:1646 */ break; case 495: #line 3910 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34515 "gram_minimal.c" /* yacc.c:1646 */ break; case 496: #line 3914 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 34521 "gram_minimal.c" /* yacc.c:1646 */ break; case 497: #line 3915 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34527 "gram_minimal.c" /* yacc.c:1646 */ break; case 498: #line 3920 "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 34539 "gram_minimal.c" /* yacc.c:1646 */ break; case 499: #line 3927 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34545 "gram_minimal.c" /* yacc.c:1646 */ break; case 500: #line 3928 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34551 "gram_minimal.c" /* yacc.c:1646 */ break; case 501: #line 3930 "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 34569 "gram_minimal.c" /* yacc.c:1646 */ break; case 502: #line 3962 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34581 "gram_minimal.c" /* yacc.c:1646 */ break; case 503: #line 3970 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 34593 "gram_minimal.c" /* yacc.c:1646 */ break; case 504: #line 3978 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-3]); n->nulls_not_distinct = !(yyvsp[-2].boolean); n->keys = NULL; n->options = (yyvsp[-1].list); n->indexname = NULL; n->indexspace = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34610 "gram_minimal.c" /* yacc.c:1646 */ break; case 505: #line 3991 "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 34626 "gram_minimal.c" /* yacc.c:1646 */ break; case 506: #line 4003 "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 34643 "gram_minimal.c" /* yacc.c:1646 */ break; case 507: #line 4016 "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 34659 "gram_minimal.c" /* yacc.c:1646 */ break; case 508: #line 4028 "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 34673 "gram_minimal.c" /* yacc.c:1646 */ break; case 509: #line 4038 "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 34701 "gram_minimal.c" /* yacc.c:1646 */ break; case 510: #line 4062 "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 = ((yyvsp[0].keyactions))->updateAction->action; n->fk_del_action = ((yyvsp[0].keyactions))->deleteAction->action; n->fk_del_set_cols = ((yyvsp[0].keyactions))->deleteAction->cols; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *) n; } #line 34722 "gram_minimal.c" /* yacc.c:1646 */ break; case 511: #line 4081 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34728 "gram_minimal.c" /* yacc.c:1646 */ break; case 512: #line 4082 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34734 "gram_minimal.c" /* yacc.c:1646 */ break; case 513: #line 4083 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34740 "gram_minimal.c" /* yacc.c:1646 */ break; case 514: #line 4087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 34746 "gram_minimal.c" /* yacc.c:1646 */ break; case 515: #line 4088 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 34752 "gram_minimal.c" /* yacc.c:1646 */ break; case 516: #line 4108 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 34764 "gram_minimal.c" /* yacc.c:1646 */ break; case 517: #line 4116 "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 34776 "gram_minimal.c" /* yacc.c:1646 */ break; case 518: #line 4124 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34788 "gram_minimal.c" /* yacc.c:1646 */ break; case 519: #line 4132 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *) n; } #line 34800 "gram_minimal.c" /* yacc.c:1646 */ break; case 520: #line 4144 "gram_minimal.y" /* yacc.c:1646 */ { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); n->relationOid = InvalidOid; (yyval.node) = (Node *) n; } #line 34813 "gram_minimal.c" /* yacc.c:1646 */ break; case 521: #line 4155 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 34819 "gram_minimal.c" /* yacc.c:1646 */ break; case 522: #line 4156 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 34825 "gram_minimal.c" /* yacc.c:1646 */ break; case 523: #line 4157 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 34831 "gram_minimal.c" /* yacc.c:1646 */ break; case 524: #line 4161 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 34837 "gram_minimal.c" /* yacc.c:1646 */ break; case 525: #line 4162 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMPRESSION; } #line 34843 "gram_minimal.c" /* yacc.c:1646 */ break; case 526: #line 4163 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 34849 "gram_minimal.c" /* yacc.c:1646 */ break; case 527: #line 4164 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 34855 "gram_minimal.c" /* yacc.c:1646 */ break; case 528: #line 4165 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 34861 "gram_minimal.c" /* yacc.c:1646 */ break; case 529: #line 4166 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 34867 "gram_minimal.c" /* yacc.c:1646 */ break; case 530: #line 4167 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 34873 "gram_minimal.c" /* yacc.c:1646 */ break; case 531: #line 4168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 34879 "gram_minimal.c" /* yacc.c:1646 */ break; case 532: #line 4169 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 34885 "gram_minimal.c" /* yacc.c:1646 */ break; case 533: #line 4170 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 34891 "gram_minimal.c" /* yacc.c:1646 */ break; case 534: #line 4180 "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 34903 "gram_minimal.c" /* yacc.c:1646 */ break; case 535: #line 4187 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 34909 "gram_minimal.c" /* yacc.c:1646 */ break; case 536: #line 4192 "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 34927 "gram_minimal.c" /* yacc.c:1646 */ break; case 537: #line 4207 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-8]); n->nulls_not_distinct = !(yyvsp[-7].boolean); 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 34948 "gram_minimal.c" /* yacc.c:1646 */ break; case 538: #line 4224 "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 34968 "gram_minimal.c" /* yacc.c:1646 */ break; case 539: #line 4241 "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 34988 "gram_minimal.c" /* yacc.c:1646 */ break; case 540: #line 4257 "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 35008 "gram_minimal.c" /* yacc.c:1646 */ break; case 541: #line 4275 "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 35030 "gram_minimal.c" /* yacc.c:1646 */ break; case 542: #line 4294 "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 = ((yyvsp[-1].keyactions))->updateAction->action; n->fk_del_action = ((yyvsp[-1].keyactions))->deleteAction->action; n->fk_del_set_cols = ((yyvsp[-1].keyactions))->deleteAction->cols; 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 35054 "gram_minimal.c" /* yacc.c:1646 */ break; case 543: #line 4328 "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 35066 "gram_minimal.c" /* yacc.c:1646 */ break; case 544: #line 4335 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 35072 "gram_minimal.c" /* yacc.c:1646 */ break; case 545: #line 4340 "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 35090 "gram_minimal.c" /* yacc.c:1646 */ break; case 546: #line 4354 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-2]); n->keys = list_make1(makeString("value")); /* no NOT VALID support yet */ processCASbits((yyvsp[0].ival), (yylsp[0]), "NOT NULL", NULL, NULL, NULL, &n->is_no_inherit, yyscanner); n->initially_valid = true; (yyval.node) = (Node *) n; } #line 35108 "gram_minimal.c" /* yacc.c:1646 */ break; case 547: #line 4369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35114 "gram_minimal.c" /* yacc.c:1646 */ break; case 548: #line 4370 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35120 "gram_minimal.c" /* yacc.c:1646 */ break; case 549: #line 4374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35126 "gram_minimal.c" /* yacc.c:1646 */ break; case 550: #line 4375 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35132 "gram_minimal.c" /* yacc.c:1646 */ break; case 551: #line 4379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 35138 "gram_minimal.c" /* yacc.c:1646 */ break; case 552: #line 4380 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 35144 "gram_minimal.c" /* yacc.c:1646 */ break; case 553: #line 4384 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 35152 "gram_minimal.c" /* yacc.c:1646 */ break; case 554: #line 4389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35158 "gram_minimal.c" /* yacc.c:1646 */ break; case 555: #line 4390 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35164 "gram_minimal.c" /* yacc.c:1646 */ break; case 556: #line 4394 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 35172 "gram_minimal.c" /* yacc.c:1646 */ break; case 557: #line 4398 "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 35184 "gram_minimal.c" /* yacc.c:1646 */ break; case 558: #line 4406 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 35192 "gram_minimal.c" /* yacc.c:1646 */ break; case 559: #line 4410 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 35200 "gram_minimal.c" /* yacc.c:1646 */ break; case 560: #line 4416 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 35206 "gram_minimal.c" /* yacc.c:1646 */ break; case 561: #line 4418 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 35212 "gram_minimal.c" /* yacc.c:1646 */ break; case 562: #line 4422 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 35220 "gram_minimal.c" /* yacc.c:1646 */ break; case 563: #line 4427 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 35228 "gram_minimal.c" /* yacc.c:1646 */ break; case 564: #line 4433 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 35234 "gram_minimal.c" /* yacc.c:1646 */ break; case 565: #line 4434 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 35240 "gram_minimal.c" /* yacc.c:1646 */ break; case 566: #line 4439 "gram_minimal.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; (yyval.keyactions) = n; } #line 35254 "gram_minimal.c" /* yacc.c:1646 */ break; case 567: #line 4449 "gram_minimal.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 35268 "gram_minimal.c" /* yacc.c:1646 */ break; case 568: #line 4459 "gram_minimal.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[-1].keyaction); n->deleteAction = (yyvsp[0].keyaction); (yyval.keyactions) = n; } #line 35280 "gram_minimal.c" /* yacc.c:1646 */ break; case 569: #line 4467 "gram_minimal.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = (yyvsp[0].keyaction); n->deleteAction = (yyvsp[-1].keyaction); (yyval.keyactions) = n; } #line 35292 "gram_minimal.c" /* yacc.c:1646 */ break; case 570: #line 4475 "gram_minimal.y" /* yacc.c:1646 */ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; (yyval.keyactions) = n; } #line 35308 "gram_minimal.c" /* yacc.c:1646 */ break; case 571: #line 4489 "gram_minimal.y" /* yacc.c:1646 */ { if (((yyvsp[0].keyaction))->cols) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("a column list with %s is only supported for ON DELETE actions", ((yyvsp[0].keyaction))->action == FKCONSTR_ACTION_SETNULL ? "SET NULL" : "SET DEFAULT"), parser_errposition((yylsp[-2])))); (yyval.keyaction) = (yyvsp[0].keyaction); } #line 35322 "gram_minimal.c" /* yacc.c:1646 */ break; case 572: #line 4501 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.keyaction) = (yyvsp[0].keyaction); } #line 35330 "gram_minimal.c" /* yacc.c:1646 */ break; case 573: #line 4508 "gram_minimal.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_NOACTION; n->cols = NIL; (yyval.keyaction) = n; } #line 35342 "gram_minimal.c" /* yacc.c:1646 */ break; case 574: #line 4516 "gram_minimal.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_RESTRICT; n->cols = NIL; (yyval.keyaction) = n; } #line 35354 "gram_minimal.c" /* yacc.c:1646 */ break; case 575: #line 4524 "gram_minimal.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_CASCADE; n->cols = NIL; (yyval.keyaction) = n; } #line 35366 "gram_minimal.c" /* yacc.c:1646 */ break; case 576: #line 4532 "gram_minimal.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETNULL; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 35378 "gram_minimal.c" /* yacc.c:1646 */ break; case 577: #line 4540 "gram_minimal.y" /* yacc.c:1646 */ { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETDEFAULT; n->cols = (yyvsp[0].list); (yyval.keyaction) = n; } #line 35390 "gram_minimal.c" /* yacc.c:1646 */ break; case 578: #line 4549 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35396 "gram_minimal.c" /* yacc.c:1646 */ break; case 579: #line 4550 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35402 "gram_minimal.c" /* yacc.c:1646 */ break; case 580: #line 4554 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.partspec) = (yyvsp[0].partspec); } #line 35408 "gram_minimal.c" /* yacc.c:1646 */ break; case 581: #line 4555 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.partspec) = NULL; } #line 35414 "gram_minimal.c" /* yacc.c:1646 */ break; case 582: #line 4559 "gram_minimal.y" /* yacc.c:1646 */ { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = parsePartitionStrategy((yyvsp[-3].str)); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 35428 "gram_minimal.c" /* yacc.c:1646 */ break; case 583: #line 4570 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 35434 "gram_minimal.c" /* yacc.c:1646 */ break; case 584: #line 4571 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 35440 "gram_minimal.c" /* yacc.c:1646 */ break; case 585: #line 4575 "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 35455 "gram_minimal.c" /* yacc.c:1646 */ break; case 586: #line 4586 "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 35470 "gram_minimal.c" /* yacc.c:1646 */ break; case 587: #line 4597 "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 35485 "gram_minimal.c" /* yacc.c:1646 */ break; case 588: #line 4610 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35491 "gram_minimal.c" /* yacc.c:1646 */ break; case 589: #line 4611 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35497 "gram_minimal.c" /* yacc.c:1646 */ break; case 590: #line 4616 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35503 "gram_minimal.c" /* yacc.c:1646 */ break; case 591: #line 4617 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35509 "gram_minimal.c" /* yacc.c:1646 */ break; case 592: #line 4618 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35515 "gram_minimal.c" /* yacc.c:1646 */ break; case 593: #line 4621 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DROP; } #line 35521 "gram_minimal.c" /* yacc.c:1646 */ break; case 594: #line 4622 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 35527 "gram_minimal.c" /* yacc.c:1646 */ break; case 595: #line 4623 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 35533 "gram_minimal.c" /* yacc.c:1646 */ break; case 596: #line 4624 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 35539 "gram_minimal.c" /* yacc.c:1646 */ break; case 597: #line 4627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35545 "gram_minimal.c" /* yacc.c:1646 */ break; case 598: #line 4628 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35551 "gram_minimal.c" /* yacc.c:1646 */ break; case 599: #line 4631 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35557 "gram_minimal.c" /* yacc.c:1646 */ break; case 600: #line 4632 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35563 "gram_minimal.c" /* yacc.c:1646 */ break; case 601: #line 4635 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35569 "gram_minimal.c" /* yacc.c:1646 */ break; case 602: #line 4657 "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 35585 "gram_minimal.c" /* yacc.c:1646 */ break; case 603: #line 4670 "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 35601 "gram_minimal.c" /* yacc.c:1646 */ break; case 604: #line 4690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].selem)); } #line 35607 "gram_minimal.c" /* yacc.c:1646 */ break; case 605: #line 4691 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].selem)); } #line 35613 "gram_minimal.c" /* yacc.c:1646 */ break; case 606: #line 4695 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = (yyvsp[0].str); (yyval.selem)->expr = NULL; } #line 35623 "gram_minimal.c" /* yacc.c:1646 */ break; case 607: #line 4701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[0].node); } #line 35633 "gram_minimal.c" /* yacc.c:1646 */ break; case 608: #line 4707 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selem) = makeNode(StatsElem); (yyval.selem)->name = NULL; (yyval.selem)->expr = (yyvsp[-1].node); } #line 35643 "gram_minimal.c" /* yacc.c:1646 */ break; case 609: #line 4724 "gram_minimal.y" /* yacc.c:1646 */ { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = false; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 35656 "gram_minimal.c" /* yacc.c:1646 */ break; case 610: #line 4733 "gram_minimal.y" /* yacc.c:1646 */ { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = (yyvsp[-3].list); n->missing_ok = true; n->stxstattarget = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 35669 "gram_minimal.c" /* yacc.c:1646 */ break; case 611: #line 4755 "gram_minimal.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35687 "gram_minimal.c" /* yacc.c:1646 */ break; case 612: #line 4769 "gram_minimal.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35705 "gram_minimal.c" /* yacc.c:1646 */ break; case 613: #line 4787 "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 35721 "gram_minimal.c" /* yacc.c:1646 */ break; case 614: #line 4801 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35727 "gram_minimal.c" /* yacc.c:1646 */ break; case 615: #line 4802 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35733 "gram_minimal.c" /* yacc.c:1646 */ break; case 616: #line 4803 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35739 "gram_minimal.c" /* yacc.c:1646 */ break; case 617: #line 4816 "gram_minimal.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35757 "gram_minimal.c" /* yacc.c:1646 */ break; case 618: #line 4830 "gram_minimal.y" /* yacc.c:1646 */ { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = (yyvsp[-1].node); ctas->into = (yyvsp[-3].into); ctas->objtype = 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 35775 "gram_minimal.c" /* yacc.c:1646 */ break; case 619: #line 4847 "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 35791 "gram_minimal.c" /* yacc.c:1646 */ break; case 620: #line 4860 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 35797 "gram_minimal.c" /* yacc.c:1646 */ break; case 621: #line 4861 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 35803 "gram_minimal.c" /* yacc.c:1646 */ break; case 622: #line 4874 "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 35816 "gram_minimal.c" /* yacc.c:1646 */ break; case 623: #line 4895 "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 35831 "gram_minimal.c" /* yacc.c:1646 */ break; case 624: #line 4906 "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 35846 "gram_minimal.c" /* yacc.c:1646 */ break; case 625: #line 4920 "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 35859 "gram_minimal.c" /* yacc.c:1646 */ break; case 626: #line 4929 "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 35872 "gram_minimal.c" /* yacc.c:1646 */ break; case 627: #line 4940 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35878 "gram_minimal.c" /* yacc.c:1646 */ break; case 628: #line 4941 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35884 "gram_minimal.c" /* yacc.c:1646 */ break; case 629: #line 4944 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35890 "gram_minimal.c" /* yacc.c:1646 */ break; case 630: #line 4945 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35896 "gram_minimal.c" /* yacc.c:1646 */ break; case 631: #line 4948 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35902 "gram_minimal.c" /* yacc.c:1646 */ break; case 632: #line 4949 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35908 "gram_minimal.c" /* yacc.c:1646 */ break; case 633: #line 4953 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].typnam), (yylsp[-1])); } #line 35916 "gram_minimal.c" /* yacc.c:1646 */ break; case 634: #line 4957 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cache", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 35924 "gram_minimal.c" /* yacc.c:1646 */ break; case 635: #line 4961 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(true), (yylsp[0])); } #line 35932 "gram_minimal.c" /* yacc.c:1646 */ break; case 636: #line 4965 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *) makeBoolean(false), (yylsp[-1])); } #line 35940 "gram_minimal.c" /* yacc.c:1646 */ break; case 637: #line 4969 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("increment", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 35948 "gram_minimal.c" /* yacc.c:1646 */ break; case 638: #line 4973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 35956 "gram_minimal.c" /* yacc.c:1646 */ break; case 639: #line 4977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 35964 "gram_minimal.c" /* yacc.c:1646 */ break; case 640: #line 4981 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 35972 "gram_minimal.c" /* yacc.c:1646 */ break; case 641: #line 4985 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 35980 "gram_minimal.c" /* yacc.c:1646 */ break; case 642: #line 4989 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owned_by", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 35988 "gram_minimal.c" /* yacc.c:1646 */ break; case 643: #line 4993 "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 35997 "gram_minimal.c" /* yacc.c:1646 */ break; case 644: #line 4998 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("start", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 36005 "gram_minimal.c" /* yacc.c:1646 */ break; case 645: #line 5002 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 36013 "gram_minimal.c" /* yacc.c:1646 */ break; case 646: #line 5006 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 36021 "gram_minimal.c" /* yacc.c:1646 */ break; case 649: #line 5016 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 36027 "gram_minimal.c" /* yacc.c:1646 */ break; case 650: #line 5017 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFloat((yyvsp[0].str)); } #line 36033 "gram_minimal.c" /* yacc.c:1646 */ break; case 651: #line 5019 "gram_minimal.y" /* yacc.c:1646 */ { Float *f = makeFloat((yyvsp[0].str)); doNegateFloat(f); (yyval.node) = (Node *) f; } #line 36044 "gram_minimal.c" /* yacc.c:1646 */ break; case 652: #line 5025 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger((yyvsp[0].ival)); } #line 36050 "gram_minimal.c" /* yacc.c:1646 */ break; case 653: #line 5028 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 36056 "gram_minimal.c" /* yacc.c:1646 */ break; case 654: #line 5029 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 36062 "gram_minimal.c" /* yacc.c:1646 */ break; case 655: #line 5042 "gram_minimal.y" /* yacc.c:1646 */ { /* * We now interpret parameterless CREATE LANGUAGE as * CREATE EXTENSION. "OR REPLACE" is silently translated * to "IF NOT EXISTS", which isn't quite the same, but * seems more useful than throwing an error. We just * ignore TRUSTED, as the previous code would have too. */ CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->if_not_exists = (yyvsp[-4].boolean); n->extname = (yyvsp[0].str); n->options = NIL; (yyval.node) = (Node *) n; } #line 36082 "gram_minimal.c" /* yacc.c:1646 */ break; case 656: #line 5059 "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 36098 "gram_minimal.c" /* yacc.c:1646 */ break; case 657: #line 5073 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 36104 "gram_minimal.c" /* yacc.c:1646 */ break; case 658: #line 5074 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 36110 "gram_minimal.c" /* yacc.c:1646 */ break; case 659: #line 5082 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36116 "gram_minimal.c" /* yacc.c:1646 */ break; case 660: #line 5083 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 36122 "gram_minimal.c" /* yacc.c:1646 */ break; case 661: #line 5087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36128 "gram_minimal.c" /* yacc.c:1646 */ break; case 662: #line 5088 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36134 "gram_minimal.c" /* yacc.c:1646 */ break; case 663: #line 5092 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36140 "gram_minimal.c" /* yacc.c:1646 */ break; case 664: #line 5093 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36146 "gram_minimal.c" /* yacc.c:1646 */ break; case 665: #line 5097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36152 "gram_minimal.c" /* yacc.c:1646 */ break; case 666: #line 5098 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36158 "gram_minimal.c" /* yacc.c:1646 */ break; case 669: #line 5114 "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 36172 "gram_minimal.c" /* yacc.c:1646 */ break; case 670: #line 5125 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 36178 "gram_minimal.c" /* yacc.c:1646 */ break; case 671: #line 5126 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 36184 "gram_minimal.c" /* yacc.c:1646 */ break; case 672: #line 5140 "gram_minimal.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 36196 "gram_minimal.c" /* yacc.c:1646 */ break; case 673: #line 5148 "gram_minimal.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 36208 "gram_minimal.c" /* yacc.c:1646 */ break; case 674: #line 5166 "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 36221 "gram_minimal.c" /* yacc.c:1646 */ break; case 675: #line 5175 "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 36234 "gram_minimal.c" /* yacc.c:1646 */ break; case 676: #line 5187 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36240 "gram_minimal.c" /* yacc.c:1646 */ break; case 677: #line 5189 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36246 "gram_minimal.c" /* yacc.c:1646 */ break; case 678: #line 5194 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schema", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36254 "gram_minimal.c" /* yacc.c:1646 */ break; case 679: #line 5198 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36262 "gram_minimal.c" /* yacc.c:1646 */ break; case 680: #line 5202 "gram_minimal.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE EXTENSION ... FROM is no longer supported"), parser_errposition((yylsp[-1])))); } #line 36273 "gram_minimal.c" /* yacc.c:1646 */ break; case 681: #line 5209 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cascade", (Node *) makeBoolean(true), (yylsp[0])); } #line 36281 "gram_minimal.c" /* yacc.c:1646 */ break; case 682: #line 5221 "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 36293 "gram_minimal.c" /* yacc.c:1646 */ break; case 683: #line 5232 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36299 "gram_minimal.c" /* yacc.c:1646 */ break; case 684: #line 5234 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36305 "gram_minimal.c" /* yacc.c:1646 */ break; case 685: #line 5239 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36313 "gram_minimal.c" /* yacc.c:1646 */ break; case 686: #line 5252 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = (yyvsp[-1].objtype); n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *) n; } #line 36327 "gram_minimal.c" /* yacc.c:1646 */ break; case 687: #line 5262 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = (yyvsp[-1].objtype); n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 36341 "gram_minimal.c" /* yacc.c:1646 */ break; case 688: #line 5272 "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 36355 "gram_minimal.c" /* yacc.c:1646 */ break; case 689: #line 5282 "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 36369 "gram_minimal.c" /* yacc.c:1646 */ break; case 690: #line 5292 "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 36383 "gram_minimal.c" /* yacc.c:1646 */ break; case 691: #line 5302 "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 36397 "gram_minimal.c" /* yacc.c:1646 */ break; case 692: #line 5312 "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 36411 "gram_minimal.c" /* yacc.c:1646 */ break; case 693: #line 5322 "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 36425 "gram_minimal.c" /* yacc.c:1646 */ break; case 694: #line 5332 "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 36439 "gram_minimal.c" /* yacc.c:1646 */ break; case 695: #line 5342 "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 36453 "gram_minimal.c" /* yacc.c:1646 */ break; case 696: #line 5352 "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 36467 "gram_minimal.c" /* yacc.c:1646 */ break; case 697: #line 5362 "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 36481 "gram_minimal.c" /* yacc.c:1646 */ break; case 698: #line 5372 "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 36495 "gram_minimal.c" /* yacc.c:1646 */ break; case 699: #line 5391 "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 36508 "gram_minimal.c" /* yacc.c:1646 */ break; case 700: #line 5402 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 36514 "gram_minimal.c" /* yacc.c:1646 */ break; case 701: #line 5403 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 36520 "gram_minimal.c" /* yacc.c:1646 */ break; case 702: #line 5404 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 36526 "gram_minimal.c" /* yacc.c:1646 */ break; case 703: #line 5405 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 36532 "gram_minimal.c" /* yacc.c:1646 */ break; case 704: #line 5409 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36538 "gram_minimal.c" /* yacc.c:1646 */ break; case 705: #line 5410 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36544 "gram_minimal.c" /* yacc.c:1646 */ break; case 706: #line 5414 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36550 "gram_minimal.c" /* yacc.c:1646 */ break; case 707: #line 5415 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36556 "gram_minimal.c" /* yacc.c:1646 */ break; case 708: #line 5426 "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 36569 "gram_minimal.c" /* yacc.c:1646 */ break; case 709: #line 5435 "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 36582 "gram_minimal.c" /* yacc.c:1646 */ break; case 710: #line 5447 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36588 "gram_minimal.c" /* yacc.c:1646 */ break; case 711: #line 5448 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36594 "gram_minimal.c" /* yacc.c:1646 */ break; case 712: #line 5453 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36602 "gram_minimal.c" /* yacc.c:1646 */ break; case 713: #line 5457 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 36610 "gram_minimal.c" /* yacc.c:1646 */ break; case 714: #line 5464 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 36616 "gram_minimal.c" /* yacc.c:1646 */ break; case 715: #line 5469 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36624 "gram_minimal.c" /* yacc.c:1646 */ break; case 716: #line 5473 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 36632 "gram_minimal.c" /* yacc.c:1646 */ break; case 717: #line 5480 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 36640 "gram_minimal.c" /* yacc.c:1646 */ break; case 718: #line 5484 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 36649 "gram_minimal.c" /* yacc.c:1646 */ break; case 719: #line 5489 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 36658 "gram_minimal.c" /* yacc.c:1646 */ break; case 720: #line 5494 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 36666 "gram_minimal.c" /* yacc.c:1646 */ break; case 721: #line 5501 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 36674 "gram_minimal.c" /* yacc.c:1646 */ break; case 722: #line 5507 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36680 "gram_minimal.c" /* yacc.c:1646 */ break; case 723: #line 5512 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 36686 "gram_minimal.c" /* yacc.c:1646 */ break; case 724: #line 5524 "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 36702 "gram_minimal.c" /* yacc.c:1646 */ break; case 725: #line 5537 "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 36718 "gram_minimal.c" /* yacc.c:1646 */ break; case 726: #line 5551 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36724 "gram_minimal.c" /* yacc.c:1646 */ break; case 727: #line 5552 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36730 "gram_minimal.c" /* yacc.c:1646 */ break; case 728: #line 5557 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36736 "gram_minimal.c" /* yacc.c:1646 */ break; case 729: #line 5558 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36742 "gram_minimal.c" /* yacc.c:1646 */ break; case 730: #line 5562 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 36748 "gram_minimal.c" /* yacc.c:1646 */ break; case 731: #line 5563 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 36754 "gram_minimal.c" /* yacc.c:1646 */ break; case 732: #line 5574 "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 36768 "gram_minimal.c" /* yacc.c:1646 */ break; case 733: #line 5584 "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 36781 "gram_minimal.c" /* yacc.c:1646 */ break; case 734: #line 5593 "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 36793 "gram_minimal.c" /* yacc.c:1646 */ break; case 735: #line 5613 "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 36816 "gram_minimal.c" /* yacc.c:1646 */ break; case 736: #line 5634 "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 36839 "gram_minimal.c" /* yacc.c:1646 */ break; case 737: #line 5655 "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 36863 "gram_minimal.c" /* yacc.c:1646 */ break; case 738: #line 5677 "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 36887 "gram_minimal.c" /* yacc.c:1646 */ break; case 739: #line 5710 "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 36903 "gram_minimal.c" /* yacc.c:1646 */ break; case 740: #line 5724 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 36909 "gram_minimal.c" /* yacc.c:1646 */ break; case 741: #line 5725 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 36915 "gram_minimal.c" /* yacc.c:1646 */ break; case 742: #line 5730 "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 36927 "gram_minimal.c" /* yacc.c:1646 */ break; case 743: #line 5738 "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 36938 "gram_minimal.c" /* yacc.c:1646 */ break; case 744: #line 5754 "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 36952 "gram_minimal.c" /* yacc.c:1646 */ break; case 745: #line 5764 "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 36966 "gram_minimal.c" /* yacc.c:1646 */ break; case 746: #line 5776 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 36972 "gram_minimal.c" /* yacc.c:1646 */ break; case 747: #line 5777 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 36978 "gram_minimal.c" /* yacc.c:1646 */ break; case 748: #line 5790 "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 36991 "gram_minimal.c" /* yacc.c:1646 */ break; case 749: #line 5799 "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 37004 "gram_minimal.c" /* yacc.c:1646 */ break; case 750: #line 5817 "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 37017 "gram_minimal.c" /* yacc.c:1646 */ break; case 751: #line 5844 "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 37034 "gram_minimal.c" /* yacc.c:1646 */ break; case 752: #line 5861 "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 37049 "gram_minimal.c" /* yacc.c:1646 */ break; case 753: #line 5874 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37055 "gram_minimal.c" /* yacc.c:1646 */ break; case 754: #line 5875 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37061 "gram_minimal.c" /* yacc.c:1646 */ break; case 755: #line 5879 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37067 "gram_minimal.c" /* yacc.c:1646 */ break; case 756: #line 5880 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37073 "gram_minimal.c" /* yacc.c:1646 */ break; case 757: #line 5884 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37079 "gram_minimal.c" /* yacc.c:1646 */ break; case 758: #line 5885 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 37085 "gram_minimal.c" /* yacc.c:1646 */ break; case 759: #line 5889 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37091 "gram_minimal.c" /* yacc.c:1646 */ break; case 760: #line 5890 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 37097 "gram_minimal.c" /* yacc.c:1646 */ break; case 761: #line 5895 "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 37115 "gram_minimal.c" /* yacc.c:1646 */ break; case 762: #line 5908 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37121 "gram_minimal.c" /* yacc.c:1646 */ break; case 763: #line 5912 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37127 "gram_minimal.c" /* yacc.c:1646 */ break; case 764: #line 5913 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 37133 "gram_minimal.c" /* yacc.c:1646 */ break; case 765: #line 5917 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 37139 "gram_minimal.c" /* yacc.c:1646 */ break; case 766: #line 5918 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "select"; } #line 37145 "gram_minimal.c" /* yacc.c:1646 */ break; case 767: #line 5919 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "insert"; } #line 37151 "gram_minimal.c" /* yacc.c:1646 */ break; case 768: #line 5920 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "update"; } #line 37157 "gram_minimal.c" /* yacc.c:1646 */ break; case 769: #line 5921 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "delete"; } #line 37163 "gram_minimal.c" /* yacc.c:1646 */ break; case 770: #line 5932 "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 37176 "gram_minimal.c" /* yacc.c:1646 */ break; case 771: #line 5943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_INDEX; } #line 37182 "gram_minimal.c" /* yacc.c:1646 */ break; case 772: #line 5944 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_TABLE; } #line 37188 "gram_minimal.c" /* yacc.c:1646 */ break; case 773: #line 5958 "gram_minimal.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->replace = (yyvsp[-15].boolean); n->isconstraint = false; 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->deferrable = false; n->initdeferred = false; n->constrrel = NULL; (yyval.node) = (Node *) n; } #line 37213 "gram_minimal.c" /* yacc.c:1646 */ break; case 774: #line 5982 "gram_minimal.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->replace = (yyvsp[-19].boolean); if (n->replace) /* not supported, see CreateTrigger */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE OR REPLACE CONSTRAINT TRIGGER is not supported"))); n->isconstraint = true; 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; processCASbits((yyvsp[-10].ival), (yylsp[-10]), "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); n->constrrel = (yyvsp[-11].range); (yyval.node) = (Node *) n; } #line 37243 "gram_minimal.c" /* yacc.c:1646 */ break; case 775: #line 6010 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 37249 "gram_minimal.c" /* yacc.c:1646 */ break; case 776: #line 6011 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 37255 "gram_minimal.c" /* yacc.c:1646 */ break; case 777: #line 6012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 37261 "gram_minimal.c" /* yacc.c:1646 */ break; case 778: #line 6017 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37267 "gram_minimal.c" /* yacc.c:1646 */ break; case 779: #line 6019 "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 37290 "gram_minimal.c" /* yacc.c:1646 */ break; case 780: #line 6041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 37296 "gram_minimal.c" /* yacc.c:1646 */ break; case 781: #line 6043 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 37302 "gram_minimal.c" /* yacc.c:1646 */ break; case 782: #line 6045 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 37308 "gram_minimal.c" /* yacc.c:1646 */ break; case 783: #line 6047 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 37314 "gram_minimal.c" /* yacc.c:1646 */ break; case 784: #line 6049 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 37320 "gram_minimal.c" /* yacc.c:1646 */ break; case 785: #line 6053 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37326 "gram_minimal.c" /* yacc.c:1646 */ break; case 786: #line 6054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37332 "gram_minimal.c" /* yacc.c:1646 */ break; case 787: #line 6058 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37338 "gram_minimal.c" /* yacc.c:1646 */ break; case 788: #line 6059 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 37344 "gram_minimal.c" /* yacc.c:1646 */ break; case 789: #line 6064 "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 37357 "gram_minimal.c" /* yacc.c:1646 */ break; case 790: #line 6075 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37363 "gram_minimal.c" /* yacc.c:1646 */ break; case 791: #line 6076 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37369 "gram_minimal.c" /* yacc.c:1646 */ break; case 792: #line 6080 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37375 "gram_minimal.c" /* yacc.c:1646 */ break; case 793: #line 6089 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37381 "gram_minimal.c" /* yacc.c:1646 */ break; case 794: #line 6093 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 37387 "gram_minimal.c" /* yacc.c:1646 */ break; case 795: #line 6098 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = (yyvsp[0].boolean); } #line 37395 "gram_minimal.c" /* yacc.c:1646 */ break; case 796: #line 6102 "gram_minimal.y" /* yacc.c:1646 */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 37407 "gram_minimal.c" /* yacc.c:1646 */ break; case 799: #line 6117 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 37413 "gram_minimal.c" /* yacc.c:1646 */ break; case 800: #line 6118 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 37419 "gram_minimal.c" /* yacc.c:1646 */ break; case 801: #line 6122 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 37425 "gram_minimal.c" /* yacc.c:1646 */ break; case 802: #line 6123 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 37431 "gram_minimal.c" /* yacc.c:1646 */ break; case 805: #line 6132 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 37437 "gram_minimal.c" /* yacc.c:1646 */ break; case 806: #line 6133 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 37443 "gram_minimal.c" /* yacc.c:1646 */ break; case 807: #line 6134 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 37449 "gram_minimal.c" /* yacc.c:1646 */ break; case 808: #line 6139 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(psprintf("%d", (yyvsp[0].ival))); } #line 37457 "gram_minimal.c" /* yacc.c:1646 */ break; case 809: #line 6142 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37463 "gram_minimal.c" /* yacc.c:1646 */ break; case 810: #line 6143 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37469 "gram_minimal.c" /* yacc.c:1646 */ break; case 811: #line 6144 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37475 "gram_minimal.c" /* yacc.c:1646 */ break; case 812: #line 6148 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 37481 "gram_minimal.c" /* yacc.c:1646 */ break; case 813: #line 6149 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = NULL; } #line 37487 "gram_minimal.c" /* yacc.c:1646 */ break; case 814: #line 6154 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37493 "gram_minimal.c" /* yacc.c:1646 */ break; case 815: #line 6156 "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 37521 "gram_minimal.c" /* yacc.c:1646 */ break; case 816: #line 6182 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 37527 "gram_minimal.c" /* yacc.c:1646 */ break; case 817: #line 6183 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_DEFERRABLE; } #line 37533 "gram_minimal.c" /* yacc.c:1646 */ break; case 818: #line 6184 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 37539 "gram_minimal.c" /* yacc.c:1646 */ break; case 819: #line 6185 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 37545 "gram_minimal.c" /* yacc.c:1646 */ break; case 820: #line 6186 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_VALID; } #line 37551 "gram_minimal.c" /* yacc.c:1646 */ break; case 821: #line 6187 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NO_INHERIT; } #line 37557 "gram_minimal.c" /* yacc.c:1646 */ break; case 822: #line 6202 "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 37571 "gram_minimal.c" /* yacc.c:1646 */ break; case 823: #line 6214 "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 37585 "gram_minimal.c" /* yacc.c:1646 */ break; case 824: #line 6227 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37591 "gram_minimal.c" /* yacc.c:1646 */ break; case 825: #line 6229 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 37597 "gram_minimal.c" /* yacc.c:1646 */ break; case 826: #line 6234 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 37603 "gram_minimal.c" /* yacc.c:1646 */ break; case 827: #line 6239 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 37609 "gram_minimal.c" /* yacc.c:1646 */ break; case 828: #line 6241 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 37615 "gram_minimal.c" /* yacc.c:1646 */ break; case 829: #line 6246 "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 37627 "gram_minimal.c" /* yacc.c:1646 */ break; case 830: #line 6256 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 37633 "gram_minimal.c" /* yacc.c:1646 */ break; case 831: #line 6257 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 37639 "gram_minimal.c" /* yacc.c:1646 */ break; case 832: #line 6258 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 37645 "gram_minimal.c" /* yacc.c:1646 */ break; case 833: #line 6259 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_DISABLED; } #line 37651 "gram_minimal.c" /* yacc.c:1646 */ break; case 834: #line 6271 "gram_minimal.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); (yyval.node) = NULL; } #line 37663 "gram_minimal.c" /* yacc.c:1646 */ break; case 835: #line 6290 "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 37679 "gram_minimal.c" /* yacc.c:1646 */ break; case 836: #line 6302 "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 37696 "gram_minimal.c" /* yacc.c:1646 */ break; case 837: #line 6315 "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 37711 "gram_minimal.c" /* yacc.c:1646 */ break; case 838: #line 6326 "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 37726 "gram_minimal.c" /* yacc.c:1646 */ break; case 839: #line 6337 "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 37742 "gram_minimal.c" /* yacc.c:1646 */ break; case 840: #line 6349 "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 37755 "gram_minimal.c" /* yacc.c:1646 */ break; case 841: #line 6358 "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 37767 "gram_minimal.c" /* yacc.c:1646 */ break; case 842: #line 6366 "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 37779 "gram_minimal.c" /* yacc.c:1646 */ break; case 843: #line 6374 "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 37793 "gram_minimal.c" /* yacc.c:1646 */ break; case 844: #line 6384 "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 37807 "gram_minimal.c" /* yacc.c:1646 */ break; case 845: #line 6394 "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 37821 "gram_minimal.c" /* yacc.c:1646 */ break; case 846: #line 6404 "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 37835 "gram_minimal.c" /* yacc.c:1646 */ break; case 847: #line 6414 "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 37849 "gram_minimal.c" /* yacc.c:1646 */ break; case 848: #line 6424 "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 37864 "gram_minimal.c" /* yacc.c:1646 */ break; case 849: #line 6435 "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 37878 "gram_minimal.c" /* yacc.c:1646 */ break; case 850: #line 6445 "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 37893 "gram_minimal.c" /* yacc.c:1646 */ break; case 851: #line 6457 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 37899 "gram_minimal.c" /* yacc.c:1646 */ break; case 852: #line 6460 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37905 "gram_minimal.c" /* yacc.c:1646 */ break; case 853: #line 6461 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 37911 "gram_minimal.c" /* yacc.c:1646 */ break; case 854: #line 6465 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37919 "gram_minimal.c" /* yacc.c:1646 */ break; case 855: #line 6469 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 37927 "gram_minimal.c" /* yacc.c:1646 */ break; case 856: #line 6475 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 37933 "gram_minimal.c" /* yacc.c:1646 */ break; case 857: #line 6476 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 37939 "gram_minimal.c" /* yacc.c:1646 */ break; case 858: #line 6477 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 37945 "gram_minimal.c" /* yacc.c:1646 */ break; case 859: #line 6478 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 37951 "gram_minimal.c" /* yacc.c:1646 */ break; case 860: #line 6479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 37957 "gram_minimal.c" /* yacc.c:1646 */ break; case 861: #line 6480 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 37963 "gram_minimal.c" /* yacc.c:1646 */ break; case 862: #line 6483 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 37969 "gram_minimal.c" /* yacc.c:1646 */ break; case 863: #line 6486 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37975 "gram_minimal.c" /* yacc.c:1646 */ break; case 864: #line 6487 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 37981 "gram_minimal.c" /* yacc.c:1646 */ break; case 865: #line 6496 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37989 "gram_minimal.c" /* yacc.c:1646 */ break; case 866: #line 6502 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 37995 "gram_minimal.c" /* yacc.c:1646 */ break; case 867: #line 6503 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38001 "gram_minimal.c" /* yacc.c:1646 */ break; case 868: #line 6507 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 38007 "gram_minimal.c" /* yacc.c:1646 */ break; case 869: #line 6509 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 38013 "gram_minimal.c" /* yacc.c:1646 */ break; case 870: #line 6520 "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 38029 "gram_minimal.c" /* yacc.c:1646 */ break; case 871: #line 6532 "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 38045 "gram_minimal.c" /* yacc.c:1646 */ break; case 872: #line 6544 "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 38061 "gram_minimal.c" /* yacc.c:1646 */ break; case 873: #line 6556 "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 38077 "gram_minimal.c" /* yacc.c:1646 */ break; case 874: #line 6568 "gram_minimal.y" /* yacc.c:1646 */ { /* * The following problems must be solved before this can be * implemented: * * - There must be no instance of the target value in * any table. * * - The value must not appear in any catalog metadata, * such as stored view expressions or column defaults. * * - The value must not appear in any non-leaf page of a * btree (and similar issues with other index types). * This is problematic because a value could persist * there long after it's gone from user-visible data. * * - Concurrent sessions must not be able to insert the * value while the preceding conditions are being checked. * * - Possibly more... */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("dropping an enum value is not implemented"), parser_errposition((yylsp[-2])))); } #line 38108 "gram_minimal.c" /* yacc.c:1646 */ break; case 875: #line 6596 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38114 "gram_minimal.c" /* yacc.c:1646 */ break; case 876: #line 6597 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38120 "gram_minimal.c" /* yacc.c:1646 */ break; case 877: #line 6615 "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 38136 "gram_minimal.c" /* yacc.c:1646 */ break; case 878: #line 6629 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38142 "gram_minimal.c" /* yacc.c:1646 */ break; case 879: #line 6630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 38148 "gram_minimal.c" /* yacc.c:1646 */ break; case 880: #line 6635 "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 38165 "gram_minimal.c" /* yacc.c:1646 */ break; case 881: #line 6649 "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 38179 "gram_minimal.c" /* yacc.c:1646 */ break; case 882: #line 6659 "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 38192 "gram_minimal.c" /* yacc.c:1646 */ break; case 883: #line 6668 "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 38206 "gram_minimal.c" /* yacc.c:1646 */ break; case 884: #line 6678 "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 38218 "gram_minimal.c" /* yacc.c:1646 */ break; case 885: #line 6687 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38224 "gram_minimal.c" /* yacc.c:1646 */ break; case 886: #line 6688 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38230 "gram_minimal.c" /* yacc.c:1646 */ break; case 887: #line 6691 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38236 "gram_minimal.c" /* yacc.c:1646 */ break; case 888: #line 6692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38242 "gram_minimal.c" /* yacc.c:1646 */ break; case 889: #line 6695 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38248 "gram_minimal.c" /* yacc.c:1646 */ break; case 890: #line 6696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38254 "gram_minimal.c" /* yacc.c:1646 */ break; case 891: #line 6697 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38260 "gram_minimal.c" /* yacc.c:1646 */ break; case 892: #line 6701 "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 38278 "gram_minimal.c" /* yacc.c:1646 */ break; case 893: #line 6714 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38284 "gram_minimal.c" /* yacc.c:1646 */ break; case 894: #line 6720 "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 38296 "gram_minimal.c" /* yacc.c:1646 */ break; case 895: #line 6731 "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 38310 "gram_minimal.c" /* yacc.c:1646 */ break; case 896: #line 6741 "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 38324 "gram_minimal.c" /* yacc.c:1646 */ break; case 897: #line 6753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38330 "gram_minimal.c" /* yacc.c:1646 */ break; case 898: #line 6754 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 38336 "gram_minimal.c" /* yacc.c:1646 */ break; case 899: #line 6759 "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 38349 "gram_minimal.c" /* yacc.c:1646 */ break; case 900: #line 6768 "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 38362 "gram_minimal.c" /* yacc.c:1646 */ break; case 901: #line 6781 "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 38377 "gram_minimal.c" /* yacc.c:1646 */ break; case 902: #line 6792 "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 38392 "gram_minimal.c" /* yacc.c:1646 */ break; case 903: #line 6806 "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 38407 "gram_minimal.c" /* yacc.c:1646 */ break; case 904: #line 6817 "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 38422 "gram_minimal.c" /* yacc.c:1646 */ break; case 905: #line 6840 "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 38434 "gram_minimal.c" /* yacc.c:1646 */ break; case 906: #line 6851 "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 38446 "gram_minimal.c" /* yacc.c:1646 */ break; case 907: #line 6870 "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 38461 "gram_minimal.c" /* yacc.c:1646 */ break; case 908: #line 6881 "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 38476 "gram_minimal.c" /* yacc.c:1646 */ break; case 909: #line 6892 "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 38491 "gram_minimal.c" /* yacc.c:1646 */ break; case 910: #line 6903 "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 38506 "gram_minimal.c" /* yacc.c:1646 */ break; case 911: #line 6914 "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 38521 "gram_minimal.c" /* yacc.c:1646 */ break; case 912: #line 6925 "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 38536 "gram_minimal.c" /* yacc.c:1646 */ break; case 913: #line 6936 "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 38551 "gram_minimal.c" /* yacc.c:1646 */ break; case 914: #line 6947 "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 38566 "gram_minimal.c" /* yacc.c:1646 */ break; case 915: #line 6958 "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 38581 "gram_minimal.c" /* yacc.c:1646 */ break; case 916: #line 6969 "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 38596 "gram_minimal.c" /* yacc.c:1646 */ break; case 917: #line 6980 "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 38611 "gram_minimal.c" /* yacc.c:1646 */ break; case 918: #line 6991 "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 38626 "gram_minimal.c" /* yacc.c:1646 */ break; case 919: #line 7005 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 38632 "gram_minimal.c" /* yacc.c:1646 */ break; case 920: #line 7006 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 38638 "gram_minimal.c" /* yacc.c:1646 */ break; case 921: #line 7007 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 38644 "gram_minimal.c" /* yacc.c:1646 */ break; case 922: #line 7008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 38650 "gram_minimal.c" /* yacc.c:1646 */ break; case 923: #line 7009 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 38656 "gram_minimal.c" /* yacc.c:1646 */ break; case 924: #line 7010 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 38662 "gram_minimal.c" /* yacc.c:1646 */ break; case 925: #line 7011 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 38668 "gram_minimal.c" /* yacc.c:1646 */ break; case 926: #line 7012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 38674 "gram_minimal.c" /* yacc.c:1646 */ break; case 927: #line 7013 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 38680 "gram_minimal.c" /* yacc.c:1646 */ break; case 928: #line 7014 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 38686 "gram_minimal.c" /* yacc.c:1646 */ break; case 929: #line 7015 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 38692 "gram_minimal.c" /* yacc.c:1646 */ break; case 930: #line 7016 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 38698 "gram_minimal.c" /* yacc.c:1646 */ break; case 931: #line 7017 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 38704 "gram_minimal.c" /* yacc.c:1646 */ break; case 932: #line 7027 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = (yyvsp[0].objtype); } #line 38710 "gram_minimal.c" /* yacc.c:1646 */ break; case 933: #line 7028 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 38716 "gram_minimal.c" /* yacc.c:1646 */ break; case 934: #line 7029 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 38722 "gram_minimal.c" /* yacc.c:1646 */ break; case 935: #line 7030 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 38728 "gram_minimal.c" /* yacc.c:1646 */ break; case 936: #line 7031 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 38734 "gram_minimal.c" /* yacc.c:1646 */ break; case 937: #line 7035 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 38740 "gram_minimal.c" /* yacc.c:1646 */ break; case 938: #line 7036 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 38746 "gram_minimal.c" /* yacc.c:1646 */ break; case 939: #line 7037 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 38752 "gram_minimal.c" /* yacc.c:1646 */ break; case 940: #line 7038 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 38758 "gram_minimal.c" /* yacc.c:1646 */ break; case 941: #line 7039 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 38764 "gram_minimal.c" /* yacc.c:1646 */ break; case 942: #line 7040 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 38770 "gram_minimal.c" /* yacc.c:1646 */ break; case 943: #line 7041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 38776 "gram_minimal.c" /* yacc.c:1646 */ break; case 944: #line 7042 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 38782 "gram_minimal.c" /* yacc.c:1646 */ break; case 945: #line 7047 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_POLICY; } #line 38788 "gram_minimal.c" /* yacc.c:1646 */ break; case 946: #line 7048 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_RULE; } #line 38794 "gram_minimal.c" /* yacc.c:1646 */ break; case 947: #line 7049 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TRIGGER; } #line 38800 "gram_minimal.c" /* yacc.c:1646 */ break; case 948: #line 7053 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 38806 "gram_minimal.c" /* yacc.c:1646 */ break; case 949: #line 7054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 38812 "gram_minimal.c" /* yacc.c:1646 */ break; case 950: #line 7057 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 38818 "gram_minimal.c" /* yacc.c:1646 */ break; case 951: #line 7058 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 38824 "gram_minimal.c" /* yacc.c:1646 */ break; case 952: #line 7062 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 38830 "gram_minimal.c" /* yacc.c:1646 */ break; case 953: #line 7064 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 38836 "gram_minimal.c" /* yacc.c:1646 */ break; case 954: #line 7068 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 38842 "gram_minimal.c" /* yacc.c:1646 */ break; case 955: #line 7069 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 38848 "gram_minimal.c" /* yacc.c:1646 */ break; case 956: #line 7081 "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 38861 "gram_minimal.c" /* yacc.c:1646 */ break; case 957: #line 7092 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38867 "gram_minimal.c" /* yacc.c:1646 */ break; case 958: #line 7093 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38873 "gram_minimal.c" /* yacc.c:1646 */ break; case 959: #line 7094 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38879 "gram_minimal.c" /* yacc.c:1646 */ break; case 960: #line 7105 "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 38892 "gram_minimal.c" /* yacc.c:1646 */ break; case 961: #line 7114 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 38905 "gram_minimal.c" /* yacc.c:1646 */ break; case 962: #line 7123 "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 38918 "gram_minimal.c" /* yacc.c:1646 */ break; case 963: #line 7132 "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 38931 "gram_minimal.c" /* yacc.c:1646 */ break; case 964: #line 7141 "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 38944 "gram_minimal.c" /* yacc.c:1646 */ break; case 965: #line 7150 "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 38957 "gram_minimal.c" /* yacc.c:1646 */ break; case 966: #line 7159 "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 38970 "gram_minimal.c" /* yacc.c:1646 */ break; case 967: #line 7168 "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 38983 "gram_minimal.c" /* yacc.c:1646 */ break; case 968: #line 7177 "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 38996 "gram_minimal.c" /* yacc.c:1646 */ break; case 969: #line 7186 "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 39014 "gram_minimal.c" /* yacc.c:1646 */ break; case 970: #line 7200 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-5].objtype); n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39027 "gram_minimal.c" /* yacc.c:1646 */ break; case 971: #line 7209 "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 39040 "gram_minimal.c" /* yacc.c:1646 */ break; case 972: #line 7218 "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 39053 "gram_minimal.c" /* yacc.c:1646 */ break; case 973: #line 7227 "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 39066 "gram_minimal.c" /* yacc.c:1646 */ break; case 974: #line 7236 "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 39079 "gram_minimal.c" /* yacc.c:1646 */ break; case 975: #line 7245 "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 39092 "gram_minimal.c" /* yacc.c:1646 */ break; case 976: #line 7254 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39105 "gram_minimal.c" /* yacc.c:1646 */ break; case 977: #line 7263 "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 39118 "gram_minimal.c" /* yacc.c:1646 */ break; case 978: #line 7274 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39124 "gram_minimal.c" /* yacc.c:1646 */ break; case 979: #line 7275 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39130 "gram_minimal.c" /* yacc.c:1646 */ break; case 980: #line 7291 "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 39144 "gram_minimal.c" /* yacc.c:1646 */ break; case 981: #line 7302 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_COLUMN; n->object = (Node *) (yyvsp[-2].list); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39158 "gram_minimal.c" /* yacc.c:1646 */ break; case 982: #line 7313 "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 39172 "gram_minimal.c" /* yacc.c:1646 */ break; case 983: #line 7324 "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 39186 "gram_minimal.c" /* yacc.c:1646 */ break; case 984: #line 7335 "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 39200 "gram_minimal.c" /* yacc.c:1646 */ break; case 985: #line 7346 "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 39214 "gram_minimal.c" /* yacc.c:1646 */ break; case 986: #line 7357 "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 39228 "gram_minimal.c" /* yacc.c:1646 */ break; case 987: #line 7368 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].node); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39242 "gram_minimal.c" /* yacc.c:1646 */ break; case 988: #line 7379 "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 39256 "gram_minimal.c" /* yacc.c:1646 */ break; case 989: #line 7390 "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 39270 "gram_minimal.c" /* yacc.c:1646 */ break; case 990: #line 7401 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39276 "gram_minimal.c" /* yacc.c:1646 */ break; case 991: #line 7402 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39282 "gram_minimal.c" /* yacc.c:1646 */ break; case 992: #line 7405 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39288 "gram_minimal.c" /* yacc.c:1646 */ break; case 993: #line 7406 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39294 "gram_minimal.c" /* yacc.c:1646 */ break; case 994: #line 7417 "gram_minimal.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *) n; } #line 39305 "gram_minimal.c" /* yacc.c:1646 */ break; case 995: #line 7424 "gram_minimal.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *) n; } #line 39316 "gram_minimal.c" /* yacc.c:1646 */ break; case 996: #line 7433 "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 39329 "gram_minimal.c" /* yacc.c:1646 */ break; case 997: #line 7442 "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 39342 "gram_minimal.c" /* yacc.c:1646 */ break; case 998: #line 7451 "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 39355 "gram_minimal.c" /* yacc.c:1646 */ break; case 999: #line 7460 "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 39368 "gram_minimal.c" /* yacc.c:1646 */ break; case 1000: #line 7469 "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 39381 "gram_minimal.c" /* yacc.c:1646 */ break; case 1001: #line 7478 "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 39394 "gram_minimal.c" /* yacc.c:1646 */ break; case 1002: #line 7487 "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 39407 "gram_minimal.c" /* yacc.c:1646 */ break; case 1003: #line 7496 "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 39420 "gram_minimal.c" /* yacc.c:1646 */ break; case 1004: #line 7505 "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 39433 "gram_minimal.c" /* yacc.c:1646 */ break; case 1005: #line 7514 "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 39446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1006: #line 7523 "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 39459 "gram_minimal.c" /* yacc.c:1646 */ break; case 1007: #line 7532 "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 39472 "gram_minimal.c" /* yacc.c:1646 */ break; case 1008: #line 7541 "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 39485 "gram_minimal.c" /* yacc.c:1646 */ break; case 1009: #line 7550 "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 39498 "gram_minimal.c" /* yacc.c:1646 */ break; case 1010: #line 7559 "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 39511 "gram_minimal.c" /* yacc.c:1646 */ break; case 1011: #line 7568 "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 39524 "gram_minimal.c" /* yacc.c:1646 */ break; case 1016: #line 7595 "gram_minimal.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = true; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grant_option = (yyvsp[-1].boolean); n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 39542 "gram_minimal.c" /* yacc.c:1646 */ break; case 1017: #line 7613 "gram_minimal.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = false; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 39561 "gram_minimal.c" /* yacc.c:1646 */ break; case 1018: #line 7629 "gram_minimal.y" /* yacc.c:1646 */ { GrantStmt *n = makeNode(GrantStmt); n->is_grant = false; n->grant_option = true; n->privileges = (yyvsp[-6].list); n->targtype = ((yyvsp[-4].privtarget))->targtype; n->objtype = ((yyvsp[-4].privtarget))->objtype; n->objects = ((yyvsp[-4].privtarget))->objs; n->grantees = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 39580 "gram_minimal.c" /* yacc.c:1646 */ break; case 1019: #line 7656 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39586 "gram_minimal.c" /* yacc.c:1646 */ break; case 1020: #line 7658 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39592 "gram_minimal.c" /* yacc.c:1646 */ break; case 1021: #line 7660 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39598 "gram_minimal.c" /* yacc.c:1646 */ break; case 1022: #line 7662 "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 39610 "gram_minimal.c" /* yacc.c:1646 */ break; case 1023: #line 7670 "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 39622 "gram_minimal.c" /* yacc.c:1646 */ break; case 1024: #line 7679 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 39628 "gram_minimal.c" /* yacc.c:1646 */ break; case 1025: #line 7680 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 39634 "gram_minimal.c" /* yacc.c:1646 */ break; case 1026: #line 7684 "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 39646 "gram_minimal.c" /* yacc.c:1646 */ break; case 1027: #line 7692 "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 39658 "gram_minimal.c" /* yacc.c:1646 */ break; case 1028: #line 7700 "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 39670 "gram_minimal.c" /* yacc.c:1646 */ break; case 1029: #line 7708 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup("alter system"); n->cols = NIL; (yyval.accesspriv) = n; } #line 39681 "gram_minimal.c" /* yacc.c:1646 */ break; case 1030: #line 7715 "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 39693 "gram_minimal.c" /* yacc.c:1646 */ break; case 1031: #line 7726 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 39701 "gram_minimal.c" /* yacc.c:1646 */ break; case 1032: #line 7730 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 39709 "gram_minimal.c" /* yacc.c:1646 */ break; case 1033: #line 7737 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39717 "gram_minimal.c" /* yacc.c:1646 */ break; case 1034: #line 7741 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 39725 "gram_minimal.c" /* yacc.c:1646 */ break; case 1035: #line 7752 "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 39738 "gram_minimal.c" /* yacc.c:1646 */ break; case 1036: #line 7761 "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 39751 "gram_minimal.c" /* yacc.c:1646 */ break; case 1037: #line 7770 "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 39764 "gram_minimal.c" /* yacc.c:1646 */ break; case 1038: #line 7779 "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 39777 "gram_minimal.c" /* yacc.c:1646 */ break; case 1039: #line 7788 "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 39790 "gram_minimal.c" /* yacc.c:1646 */ break; case 1040: #line 7797 "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 39803 "gram_minimal.c" /* yacc.c:1646 */ break; case 1041: #line 7806 "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 39816 "gram_minimal.c" /* yacc.c:1646 */ break; case 1042: #line 7815 "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 39829 "gram_minimal.c" /* yacc.c:1646 */ break; case 1043: #line 7824 "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 39842 "gram_minimal.c" /* yacc.c:1646 */ break; case 1044: #line 7833 "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 39855 "gram_minimal.c" /* yacc.c:1646 */ break; case 1045: #line 7842 "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 39868 "gram_minimal.c" /* yacc.c:1646 */ break; case 1046: #line 7851 "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 39881 "gram_minimal.c" /* yacc.c:1646 */ break; case 1047: #line 7860 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PARAMETER_ACL; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 39893 "gram_minimal.c" /* yacc.c:1646 */ break; case 1048: #line 7868 "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 39906 "gram_minimal.c" /* yacc.c:1646 */ break; case 1049: #line 7877 "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 39919 "gram_minimal.c" /* yacc.c:1646 */ break; case 1050: #line 7886 "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 39932 "gram_minimal.c" /* yacc.c:1646 */ break; case 1051: #line 7895 "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 39945 "gram_minimal.c" /* yacc.c:1646 */ break; case 1052: #line 7904 "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 39958 "gram_minimal.c" /* yacc.c:1646 */ break; case 1053: #line 7913 "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 39971 "gram_minimal.c" /* yacc.c:1646 */ break; case 1054: #line 7922 "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 39984 "gram_minimal.c" /* yacc.c:1646 */ break; case 1055: #line 7931 "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 39997 "gram_minimal.c" /* yacc.c:1646 */ break; case 1056: #line 7943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 40003 "gram_minimal.c" /* yacc.c:1646 */ break; case 1057: #line 7944 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 40009 "gram_minimal.c" /* yacc.c:1646 */ break; case 1058: #line 7948 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40015 "gram_minimal.c" /* yacc.c:1646 */ break; case 1059: #line 7949 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40021 "gram_minimal.c" /* yacc.c:1646 */ break; case 1060: #line 7954 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40027 "gram_minimal.c" /* yacc.c:1646 */ break; case 1061: #line 7955 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40033 "gram_minimal.c" /* yacc.c:1646 */ break; case 1062: #line 7966 "gram_minimal.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = true; n->granted_roles = (yyvsp[-3].list); n->grantee_roles = (yyvsp[-1].list); n->opt = NIL; n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40048 "gram_minimal.c" /* yacc.c:1646 */ break; case 1063: #line 7977 "gram_minimal.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = true; n->granted_roles = (yyvsp[-5].list); n->grantee_roles = (yyvsp[-3].list); n->opt = (yyvsp[-1].list); n->grantor = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 40063 "gram_minimal.c" /* yacc.c:1646 */ break; case 1064: #line 7991 "gram_minimal.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); n->is_grant = false; n->opt = NIL; n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40079 "gram_minimal.c" /* yacc.c:1646 */ break; case 1065: #line 8003 "gram_minimal.y" /* yacc.c:1646 */ { GrantRoleStmt *n = makeNode(GrantRoleStmt); DefElem *opt; opt = makeDefElem(pstrdup((yyvsp[-7].str)), (Node *) makeBoolean(false), (yylsp[-7])); n->is_grant = false; n->opt = list_make1(opt); n->granted_roles = (yyvsp[-4].list); n->grantee_roles = (yyvsp[-2].list); n->grantor = (yyvsp[-1].rolespec); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 40098 "gram_minimal.c" /* yacc.c:1646 */ break; case 1066: #line 8020 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 40104 "gram_minimal.c" /* yacc.c:1646 */ break; case 1067: #line 8021 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 40110 "gram_minimal.c" /* yacc.c:1646 */ break; case 1068: #line 8026 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem(pstrdup((yyvsp[-1].str)), (yyvsp[0].node), (yylsp[-1])); } #line 40118 "gram_minimal.c" /* yacc.c:1646 */ break; case 1069: #line 8032 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(true); } #line 40124 "gram_minimal.c" /* yacc.c:1646 */ break; case 1070: #line 8033 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(true); } #line 40130 "gram_minimal.c" /* yacc.c:1646 */ break; case 1071: #line 8034 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeBoolean(false); } #line 40136 "gram_minimal.c" /* yacc.c:1646 */ break; case 1072: #line 8037 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 40142 "gram_minimal.c" /* yacc.c:1646 */ break; case 1073: #line 8038 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 40148 "gram_minimal.c" /* yacc.c:1646 */ break; case 1074: #line 8049 "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 40160 "gram_minimal.c" /* yacc.c:1646 */ break; case 1075: #line 8059 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 40166 "gram_minimal.c" /* yacc.c:1646 */ break; case 1076: #line 8060 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40172 "gram_minimal.c" /* yacc.c:1646 */ break; case 1077: #line 8065 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schemas", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1078: #line 8069 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40188 "gram_minimal.c" /* yacc.c:1646 */ break; case 1079: #line 8073 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *) (yyvsp[0].list), (yylsp[-2])); } #line 40196 "gram_minimal.c" /* yacc.c:1646 */ break; case 1080: #line 8085 "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 40213 "gram_minimal.c" /* yacc.c:1646 */ break; case 1081: #line 8099 "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 40231 "gram_minimal.c" /* yacc.c:1646 */ break; case 1082: #line 8114 "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 40249 "gram_minimal.c" /* yacc.c:1646 */ break; case 1083: #line 8130 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TABLE; } #line 40255 "gram_minimal.c" /* yacc.c:1646 */ break; case 1084: #line 8131 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 40261 "gram_minimal.c" /* yacc.c:1646 */ break; case 1085: #line 8132 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 40267 "gram_minimal.c" /* yacc.c:1646 */ break; case 1086: #line 8133 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SEQUENCE; } #line 40273 "gram_minimal.c" /* yacc.c:1646 */ break; case 1087: #line 8134 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TYPE; } #line 40279 "gram_minimal.c" /* yacc.c:1646 */ break; case 1088: #line 8135 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SCHEMA; } #line 40285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1089: #line 8150 "gram_minimal.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-14].boolean); n->concurrent = (yyvsp[-12].boolean); n->idxname = (yyvsp[-11].str); n->relation = (yyvsp[-9].range); n->accessMethod = (yyvsp[-8].str); n->indexParams = (yyvsp[-6].list); n->indexIncludingParams = (yyvsp[-4].list); n->nulls_not_distinct = !(yyvsp[-3].boolean); 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->oldNumber = InvalidRelFileNumber; n->oldCreateSubid = InvalidSubTransactionId; n->oldFirstRelfilelocatorSubid = InvalidSubTransactionId; 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 40319 "gram_minimal.c" /* yacc.c:1646 */ break; case 1090: #line 8182 "gram_minimal.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-17].boolean); n->concurrent = (yyvsp[-15].boolean); n->idxname = (yyvsp[-11].str); n->relation = (yyvsp[-9].range); n->accessMethod = (yyvsp[-8].str); n->indexParams = (yyvsp[-6].list); n->indexIncludingParams = (yyvsp[-4].list); n->nulls_not_distinct = !(yyvsp[-3].boolean); 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->oldNumber = InvalidRelFileNumber; n->oldCreateSubid = InvalidSubTransactionId; n->oldFirstRelfilelocatorSubid = InvalidSubTransactionId; 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 40353 "gram_minimal.c" /* yacc.c:1646 */ break; case 1091: #line 8214 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40359 "gram_minimal.c" /* yacc.c:1646 */ break; case 1092: #line 8215 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40365 "gram_minimal.c" /* yacc.c:1646 */ break; case 1093: #line 8219 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 40371 "gram_minimal.c" /* yacc.c:1646 */ break; case 1094: #line 8220 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 40377 "gram_minimal.c" /* yacc.c:1646 */ break; case 1095: #line 8223 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 40383 "gram_minimal.c" /* yacc.c:1646 */ break; case 1096: #line 8224 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 40389 "gram_minimal.c" /* yacc.c:1646 */ break; case 1097: #line 8230 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-3].list); (yyval.ielem)->opclass = (yyvsp[-2].list); (yyval.ielem)->opclassopts = NIL; (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 40405 "gram_minimal.c" /* yacc.c:1646 */ break; case 1098: #line 8242 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ielem) = makeNode(IndexElem); (yyval.ielem)->name = NULL; (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; (yyval.ielem)->collation = (yyvsp[-4].list); (yyval.ielem)->opclass = (yyvsp[-3].list); (yyval.ielem)->opclassopts = (yyvsp[-2].list); (yyval.ielem)->ordering = (yyvsp[-1].ival); (yyval.ielem)->nulls_ordering = (yyvsp[0].ival); } #line 40421 "gram_minimal.c" /* yacc.c:1646 */ break; case 1099: #line 8261 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->name = (yyvsp[-1].str); } #line 40430 "gram_minimal.c" /* yacc.c:1646 */ break; case 1100: #line 8266 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-1].node); } #line 40439 "gram_minimal.c" /* yacc.c:1646 */ break; case 1101: #line 8271 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ielem) = (yyvsp[0].ielem); (yyval.ielem)->expr = (yyvsp[-2].node); } #line 40448 "gram_minimal.c" /* yacc.c:1646 */ break; case 1102: #line 8277 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40454 "gram_minimal.c" /* yacc.c:1646 */ break; case 1103: #line 8278 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40460 "gram_minimal.c" /* yacc.c:1646 */ break; case 1104: #line 8281 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 40466 "gram_minimal.c" /* yacc.c:1646 */ break; case 1105: #line 8282 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 40472 "gram_minimal.c" /* yacc.c:1646 */ break; case 1106: #line 8285 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40478 "gram_minimal.c" /* yacc.c:1646 */ break; case 1107: #line 8286 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40484 "gram_minimal.c" /* yacc.c:1646 */ break; case 1108: #line 8290 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_ASC; } #line 40490 "gram_minimal.c" /* yacc.c:1646 */ break; case 1109: #line 8291 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DESC; } #line 40496 "gram_minimal.c" /* yacc.c:1646 */ break; case 1110: #line 8292 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DEFAULT; } #line 40502 "gram_minimal.c" /* yacc.c:1646 */ break; case 1111: #line 8295 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 40508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1112: #line 8296 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_LAST; } #line 40514 "gram_minimal.c" /* yacc.c:1646 */ break; case 1113: #line 8297 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 40520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1114: #line 8315 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-7].boolean); n->funcname = (yyvsp[-5].list); n->parameters = (yyvsp[-4].list); n->returnType = (yyvsp[-2].typnam); n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40537 "gram_minimal.c" /* yacc.c:1646 */ break; case 1115: #line 8329 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-10].boolean); n->funcname = (yyvsp[-8].list); n->parameters = mergeTableFuncParameters((yyvsp[-7].list), (yyvsp[-3].list)); n->returnType = TableFuncTypeName((yyvsp[-3].list)); n->returnType->location = (yylsp[-5]); n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40555 "gram_minimal.c" /* yacc.c:1646 */ break; case 1116: #line 8344 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-5].boolean); n->funcname = (yyvsp[-3].list); n->parameters = (yyvsp[-2].list); n->returnType = NULL; n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40572 "gram_minimal.c" /* yacc.c:1646 */ break; case 1117: #line 8358 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = true; n->replace = (yyvsp[-5].boolean); n->funcname = (yyvsp[-3].list); n->parameters = (yyvsp[-2].list); n->returnType = NULL; n->options = (yyvsp[-1].list); n->sql_body = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 40589 "gram_minimal.c" /* yacc.c:1646 */ break; case 1118: #line 8373 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40595 "gram_minimal.c" /* yacc.c:1646 */ break; case 1119: #line 8374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40601 "gram_minimal.c" /* yacc.c:1646 */ break; case 1120: #line 8377 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40607 "gram_minimal.c" /* yacc.c:1646 */ break; case 1121: #line 8378 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40613 "gram_minimal.c" /* yacc.c:1646 */ break; case 1122: #line 8382 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 40619 "gram_minimal.c" /* yacc.c:1646 */ break; case 1123: #line 8383 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 40625 "gram_minimal.c" /* yacc.c:1646 */ break; case 1124: #line 8387 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 40631 "gram_minimal.c" /* yacc.c:1646 */ break; case 1125: #line 8389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 40637 "gram_minimal.c" /* yacc.c:1646 */ break; case 1126: #line 8394 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); n->objfuncargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 40650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1127: #line 8408 "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 40662 "gram_minimal.c" /* yacc.c:1646 */ break; case 1128: #line 8416 "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 40674 "gram_minimal.c" /* yacc.c:1646 */ break; case 1129: #line 8424 "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 40687 "gram_minimal.c" /* yacc.c:1646 */ break; case 1130: #line 8439 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40693 "gram_minimal.c" /* yacc.c:1646 */ break; case 1131: #line 8440 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40699 "gram_minimal.c" /* yacc.c:1646 */ break; case 1132: #line 8444 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 40705 "gram_minimal.c" /* yacc.c:1646 */ break; case 1133: #line 8446 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 40711 "gram_minimal.c" /* yacc.c:1646 */ break; case 1134: #line 8461 "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 40725 "gram_minimal.c" /* yacc.c:1646 */ break; case 1135: #line 8471 "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 40739 "gram_minimal.c" /* yacc.c:1646 */ break; case 1136: #line 8481 "gram_minimal.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = (yyvsp[-1].str); n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; (yyval.fun_param) = n; } #line 40753 "gram_minimal.c" /* yacc.c:1646 */ break; case 1137: #line 8491 "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 40767 "gram_minimal.c" /* yacc.c:1646 */ break; case 1138: #line 8501 "gram_minimal.y" /* yacc.c:1646 */ { FunctionParameter *n = makeNode(FunctionParameter); n->name = NULL; n->argType = (yyvsp[0].typnam); n->mode = FUNC_PARAM_DEFAULT; n->defexpr = NULL; (yyval.fun_param) = n; } #line 40781 "gram_minimal.c" /* yacc.c:1646 */ break; case 1139: #line 8513 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 40787 "gram_minimal.c" /* yacc.c:1646 */ break; case 1140: #line 8514 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 40793 "gram_minimal.c" /* yacc.c:1646 */ break; case 1141: #line 8515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 40799 "gram_minimal.c" /* yacc.c:1646 */ break; case 1142: #line 8516 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 40805 "gram_minimal.c" /* yacc.c:1646 */ break; case 1143: #line 8517 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 40811 "gram_minimal.c" /* yacc.c:1646 */ break; case 1145: #line 8528 "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 40823 "gram_minimal.c" /* yacc.c:1646 */ break; case 1146: #line 8542 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 40829 "gram_minimal.c" /* yacc.c:1646 */ break; case 1147: #line 8544 "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 40839 "gram_minimal.c" /* yacc.c:1646 */ break; case 1148: #line 8550 "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 40850 "gram_minimal.c" /* yacc.c:1646 */ break; case 1149: #line 8560 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 40858 "gram_minimal.c" /* yacc.c:1646 */ break; case 1150: #line 8564 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 40867 "gram_minimal.c" /* yacc.c:1646 */ break; case 1151: #line 8569 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 40876 "gram_minimal.c" /* yacc.c:1646 */ break; case 1152: #line 8577 "gram_minimal.y" /* yacc.c:1646 */ { if (!((yyvsp[0].fun_param)->mode == FUNC_PARAM_DEFAULT || (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 40891 "gram_minimal.c" /* yacc.c:1646 */ break; case 1153: #line 8619 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 40899 "gram_minimal.c" /* yacc.c:1646 */ break; case 1154: #line 8623 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 40907 "gram_minimal.c" /* yacc.c:1646 */ break; case 1155: #line 8627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 40915 "gram_minimal.c" /* yacc.c:1646 */ break; case 1156: #line 8631 "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 40924 "gram_minimal.c" /* yacc.c:1646 */ break; case 1157: #line 8638 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 40930 "gram_minimal.c" /* yacc.c:1646 */ break; case 1158: #line 8639 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 40936 "gram_minimal.c" /* yacc.c:1646 */ break; case 1159: #line 8644 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractAggrArgTypes((yyvsp[0].list)); n->objfuncargs = (List *) linitial((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 40949 "gram_minimal.c" /* yacc.c:1646 */ break; case 1160: #line 8655 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 40955 "gram_minimal.c" /* yacc.c:1646 */ break; case 1161: #line 8657 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 40961 "gram_minimal.c" /* yacc.c:1646 */ break; case 1163: #line 8662 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40967 "gram_minimal.c" /* yacc.c:1646 */ break; case 1164: #line 8667 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 40973 "gram_minimal.c" /* yacc.c:1646 */ break; case 1165: #line 8668 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 40979 "gram_minimal.c" /* yacc.c:1646 */ break; case 1166: #line 8676 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(false), (yylsp[-3])); } #line 40987 "gram_minimal.c" /* yacc.c:1646 */ break; case 1167: #line 8680 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[-4])); } #line 40995 "gram_minimal.c" /* yacc.c:1646 */ break; case 1168: #line 8684 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *) makeBoolean(true), (yylsp[0])); } #line 41003 "gram_minimal.c" /* yacc.c:1646 */ break; case 1169: #line 8688 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("immutable"), (yylsp[0])); } #line 41011 "gram_minimal.c" /* yacc.c:1646 */ break; case 1170: #line 8692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("stable"), (yylsp[0])); } #line 41019 "gram_minimal.c" /* yacc.c:1646 */ break; case 1171: #line 8696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *) makeString("volatile"), (yylsp[0])); } #line 41027 "gram_minimal.c" /* yacc.c:1646 */ break; case 1172: #line 8700 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-2])); } #line 41035 "gram_minimal.c" /* yacc.c:1646 */ break; case 1173: #line 8704 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-2])); } #line 41043 "gram_minimal.c" /* yacc.c:1646 */ break; case 1174: #line 8708 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(true), (yylsp[-1])); } #line 41051 "gram_minimal.c" /* yacc.c:1646 */ break; case 1175: #line 8712 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *) makeBoolean(false), (yylsp[-1])); } #line 41059 "gram_minimal.c" /* yacc.c:1646 */ break; case 1176: #line 8716 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(true), (yylsp[0])); } #line 41067 "gram_minimal.c" /* yacc.c:1646 */ break; case 1177: #line 8720 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *) makeBoolean(false), (yylsp[-1])); } #line 41075 "gram_minimal.c" /* yacc.c:1646 */ break; case 1178: #line 8724 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cost", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 41083 "gram_minimal.c" /* yacc.c:1646 */ break; case 1179: #line 8728 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rows", (Node *) (yyvsp[0].node), (yylsp[-1])); } #line 41091 "gram_minimal.c" /* yacc.c:1646 */ break; case 1180: #line 8732 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("support", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41099 "gram_minimal.c" /* yacc.c:1646 */ break; case 1181: #line 8736 "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 41108 "gram_minimal.c" /* yacc.c:1646 */ break; case 1182: #line 8741 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("parallel", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41116 "gram_minimal.c" /* yacc.c:1646 */ break; case 1183: #line 8748 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41124 "gram_minimal.c" /* yacc.c:1646 */ break; case 1184: #line 8752 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41132 "gram_minimal.c" /* yacc.c:1646 */ break; case 1185: #line 8756 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transform", (Node *) (yyvsp[0].list), (yylsp[-1])); } #line 41140 "gram_minimal.c" /* yacc.c:1646 */ break; case 1186: #line 8760 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("window", (Node *) makeBoolean(true), (yylsp[0])); } #line 41148 "gram_minimal.c" /* yacc.c:1646 */ break; case 1187: #line 8764 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 41156 "gram_minimal.c" /* yacc.c:1646 */ break; case 1188: #line 8769 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1189: #line 8771 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 41170 "gram_minimal.c" /* yacc.c:1646 */ break; case 1190: #line 8777 "gram_minimal.y" /* yacc.c:1646 */ { ReturnStmt *r = makeNode(ReturnStmt); r->returnval = (Node *) (yyvsp[0].node); (yyval.node) = (Node *) r; } #line 41181 "gram_minimal.c" /* yacc.c:1646 */ break; case 1191: #line 8787 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41189 "gram_minimal.c" /* yacc.c:1646 */ break; case 1192: #line 8791 "gram_minimal.y" /* yacc.c:1646 */ { /* * A compound statement is stored as a single-item list * containing the list of statements as its member. That * way, the parse analysis code can tell apart an empty * body from no body at all. */ (yyval.node) = (Node *) list_make1((yyvsp[-1].list)); } #line 41203 "gram_minimal.c" /* yacc.c:1646 */ break; case 1193: #line 8801 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41211 "gram_minimal.c" /* yacc.c:1646 */ break; case 1194: #line 8808 "gram_minimal.y" /* yacc.c:1646 */ { /* As in stmtmulti, discard empty statements */ if ((yyvsp[-1].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[-1].node)); else (yyval.list) = (yyvsp[-2].list); } #line 41223 "gram_minimal.c" /* yacc.c:1646 */ break; case 1195: #line 8816 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41231 "gram_minimal.c" /* yacc.c:1646 */ break; case 1198: #line 8827 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 41237 "gram_minimal.c" /* yacc.c:1646 */ break; case 1199: #line 8828 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 41243 "gram_minimal.c" /* yacc.c:1646 */ break; case 1200: #line 8832 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41249 "gram_minimal.c" /* yacc.c:1646 */ break; case 1201: #line 8833 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41255 "gram_minimal.c" /* yacc.c:1646 */ break; case 1202: #line 8837 "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 41269 "gram_minimal.c" /* yacc.c:1646 */ break; case 1203: #line 8850 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 41277 "gram_minimal.c" /* yacc.c:1646 */ break; case 1204: #line 8854 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 41285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1205: #line 8869 "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 41298 "gram_minimal.c" /* yacc.c:1646 */ break; case 1206: #line 8878 "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 41311 "gram_minimal.c" /* yacc.c:1646 */ break; case 1207: #line 8887 "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 41324 "gram_minimal.c" /* yacc.c:1646 */ break; case 1208: #line 8899 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41330 "gram_minimal.c" /* yacc.c:1646 */ break; case 1209: #line 8900 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41336 "gram_minimal.c" /* yacc.c:1646 */ break; case 1212: #line 8924 "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 41351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1213: #line 8935 "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 41366 "gram_minimal.c" /* yacc.c:1646 */ break; case 1214: #line 8946 "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 41381 "gram_minimal.c" /* yacc.c:1646 */ break; case 1215: #line 8957 "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 41396 "gram_minimal.c" /* yacc.c:1646 */ break; case 1216: #line 8968 "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 41411 "gram_minimal.c" /* yacc.c:1646 */ break; case 1217: #line 8979 "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 41426 "gram_minimal.c" /* yacc.c:1646 */ break; case 1218: #line 8993 "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 41441 "gram_minimal.c" /* yacc.c:1646 */ break; case 1219: #line 9004 "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 41456 "gram_minimal.c" /* yacc.c:1646 */ break; case 1220: #line 9018 "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 41471 "gram_minimal.c" /* yacc.c:1646 */ break; case 1221: #line 9029 "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 41486 "gram_minimal.c" /* yacc.c:1646 */ break; case 1222: #line 9043 "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 41498 "gram_minimal.c" /* yacc.c:1646 */ break; case 1223: #line 9051 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 41504 "gram_minimal.c" /* yacc.c:1646 */ break; case 1224: #line 9053 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 41510 "gram_minimal.c" /* yacc.c:1646 */ break; case 1225: #line 9055 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 41516 "gram_minimal.c" /* yacc.c:1646 */ break; case 1226: #line 9060 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 41522 "gram_minimal.c" /* yacc.c:1646 */ break; case 1227: #line 9062 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 41528 "gram_minimal.c" /* yacc.c:1646 */ break; case 1228: #line 9066 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 41534 "gram_minimal.c" /* yacc.c:1646 */ break; case 1229: #line 9068 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 41540 "gram_minimal.c" /* yacc.c:1646 */ break; case 1230: #line 9073 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 41552 "gram_minimal.c" /* yacc.c:1646 */ break; case 1231: #line 9092 "gram_minimal.y" /* yacc.c:1646 */ { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 41563 "gram_minimal.c" /* yacc.c:1646 */ break; case 1232: #line 9101 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41569 "gram_minimal.c" /* yacc.c:1646 */ break; case 1233: #line 9102 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41575 "gram_minimal.c" /* yacc.c:1646 */ break; case 1234: #line 9107 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *) makeString((yyvsp[0].str)), (yylsp[0])); } #line 41583 "gram_minimal.c" /* yacc.c:1646 */ break; case 1235: #line 9111 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *) makeString((yyvsp[0].str)), (yylsp[-1])); } #line 41591 "gram_minimal.c" /* yacc.c:1646 */ break; case 1236: #line 9124 "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 41606 "gram_minimal.c" /* yacc.c:1646 */ break; case 1237: #line 9136 "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 41621 "gram_minimal.c" /* yacc.c:1646 */ break; case 1238: #line 9148 "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 41636 "gram_minimal.c" /* yacc.c:1646 */ break; case 1239: #line 9160 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_IMPLICIT; } #line 41642 "gram_minimal.c" /* yacc.c:1646 */ break; case 1240: #line 9161 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_ASSIGNMENT; } #line 41648 "gram_minimal.c" /* yacc.c:1646 */ break; case 1241: #line 9162 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_EXPLICIT; } #line 41654 "gram_minimal.c" /* yacc.c:1646 */ break; case 1242: #line 9167 "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 41669 "gram_minimal.c" /* yacc.c:1646 */ break; case 1243: #line 9179 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 41675 "gram_minimal.c" /* yacc.c:1646 */ break; case 1244: #line 9180 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 41681 "gram_minimal.c" /* yacc.c:1646 */ break; case 1245: #line 9191 "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 41696 "gram_minimal.c" /* yacc.c:1646 */ break; case 1246: #line 9204 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 41704 "gram_minimal.c" /* yacc.c:1646 */ break; case 1247: #line 9208 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 41712 "gram_minimal.c" /* yacc.c:1646 */ break; case 1248: #line 9212 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 41720 "gram_minimal.c" /* yacc.c:1646 */ break; case 1249: #line 9216 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 41728 "gram_minimal.c" /* yacc.c:1646 */ break; case 1250: #line 9223 "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 41742 "gram_minimal.c" /* yacc.c:1646 */ break; case 1251: #line 9245 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->relation = (yyvsp[0].range); n->name = NULL; n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41759 "gram_minimal.c" /* yacc.c:1646 */ break; case 1252: #line 9258 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = REINDEX_OBJECT_SCHEMA; n->relation = NULL; n->name = (yyvsp[0].str); n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1253: #line 9271 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->relation = NULL; n->name = (yyvsp[0].str); n->params = (yyvsp[-3].list); if ((yyvsp[-1].boolean)) n->params = lappend(n->params, makeDefElem("concurrently", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 41793 "gram_minimal.c" /* yacc.c:1646 */ break; case 1254: #line 9285 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 41799 "gram_minimal.c" /* yacc.c:1646 */ break; case 1255: #line 9286 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 41805 "gram_minimal.c" /* yacc.c:1646 */ break; case 1256: #line 9289 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 41811 "gram_minimal.c" /* yacc.c:1646 */ break; case 1257: #line 9290 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 41817 "gram_minimal.c" /* yacc.c:1646 */ break; case 1258: #line 9293 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 41823 "gram_minimal.c" /* yacc.c:1646 */ break; case 1259: #line 9294 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 41829 "gram_minimal.c" /* yacc.c:1646 */ break; case 1260: #line 9305 "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 41843 "gram_minimal.c" /* yacc.c:1646 */ break; case 1261: #line 9315 "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 41857 "gram_minimal.c" /* yacc.c:1646 */ break; case 1262: #line 9333 "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 41871 "gram_minimal.c" /* yacc.c:1646 */ break; case 1263: #line 9343 "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 41885 "gram_minimal.c" /* yacc.c:1646 */ break; case 1264: #line 9353 "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 41899 "gram_minimal.c" /* yacc.c:1646 */ break; case 1265: #line 9363 "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 41913 "gram_minimal.c" /* yacc.c:1646 */ break; case 1266: #line 9373 "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 41927 "gram_minimal.c" /* yacc.c:1646 */ break; case 1267: #line 9383 "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 41941 "gram_minimal.c" /* yacc.c:1646 */ break; case 1268: #line 9393 "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 41955 "gram_minimal.c" /* yacc.c:1646 */ break; case 1269: #line 9403 "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 41969 "gram_minimal.c" /* yacc.c:1646 */ break; case 1270: #line 9413 "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 41983 "gram_minimal.c" /* yacc.c:1646 */ break; case 1271: #line 9423 "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 41997 "gram_minimal.c" /* yacc.c:1646 */ break; case 1272: #line 9433 "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 42011 "gram_minimal.c" /* yacc.c:1646 */ break; case 1273: #line 9443 "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 42025 "gram_minimal.c" /* yacc.c:1646 */ break; case 1274: #line 9453 "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 42040 "gram_minimal.c" /* yacc.c:1646 */ break; case 1275: #line 9464 "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 42055 "gram_minimal.c" /* yacc.c:1646 */ break; case 1276: #line 9475 "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 42069 "gram_minimal.c" /* yacc.c:1646 */ break; case 1277: #line 9485 "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 42083 "gram_minimal.c" /* yacc.c:1646 */ break; case 1278: #line 9495 "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 42097 "gram_minimal.c" /* yacc.c:1646 */ break; case 1279: #line 9505 "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 42111 "gram_minimal.c" /* yacc.c:1646 */ break; case 1280: #line 9515 "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 42125 "gram_minimal.c" /* yacc.c:1646 */ break; case 1281: #line 9525 "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 42139 "gram_minimal.c" /* yacc.c:1646 */ break; case 1282: #line 9535 "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 42154 "gram_minimal.c" /* yacc.c:1646 */ break; case 1283: #line 9546 "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 42169 "gram_minimal.c" /* yacc.c:1646 */ break; case 1284: #line 9557 "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 42184 "gram_minimal.c" /* yacc.c:1646 */ break; case 1285: #line 9568 "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 42199 "gram_minimal.c" /* yacc.c:1646 */ break; case 1286: #line 9579 "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 42214 "gram_minimal.c" /* yacc.c:1646 */ break; case 1287: #line 9590 "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 42229 "gram_minimal.c" /* yacc.c:1646 */ break; case 1288: #line 9601 "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 42244 "gram_minimal.c" /* yacc.c:1646 */ break; case 1289: #line 9612 "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 42259 "gram_minimal.c" /* yacc.c:1646 */ break; case 1290: #line 9623 "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 42274 "gram_minimal.c" /* yacc.c:1646 */ break; case 1291: #line 9634 "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 42289 "gram_minimal.c" /* yacc.c:1646 */ break; case 1292: #line 9645 "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 42304 "gram_minimal.c" /* yacc.c:1646 */ break; case 1293: #line 9656 "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 42319 "gram_minimal.c" /* yacc.c:1646 */ break; case 1294: #line 9667 "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 42335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1295: #line 9679 "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 42351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1296: #line 9691 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_VIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 42367 "gram_minimal.c" /* yacc.c:1646 */ break; case 1297: #line 9703 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLUMN; n->relationType = OBJECT_VIEW; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 42383 "gram_minimal.c" /* yacc.c:1646 */ break; case 1298: #line 9715 "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 42399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1299: #line 9727 "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 42415 "gram_minimal.c" /* yacc.c:1646 */ break; case 1300: #line 9739 "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 42430 "gram_minimal.c" /* yacc.c:1646 */ break; case 1301: #line 9750 "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 42445 "gram_minimal.c" /* yacc.c:1646 */ break; case 1302: #line 9761 "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 42461 "gram_minimal.c" /* yacc.c:1646 */ break; case 1303: #line 9773 "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 42477 "gram_minimal.c" /* yacc.c:1646 */ break; case 1304: #line 9785 "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 42492 "gram_minimal.c" /* yacc.c:1646 */ break; case 1305: #line 9796 "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 42507 "gram_minimal.c" /* yacc.c:1646 */ break; case 1306: #line 9807 "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 42520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1307: #line 9816 "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 42534 "gram_minimal.c" /* yacc.c:1646 */ break; case 1308: #line 9826 "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 42548 "gram_minimal.c" /* yacc.c:1646 */ break; case 1309: #line 9836 "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 42562 "gram_minimal.c" /* yacc.c:1646 */ break; case 1310: #line 9846 "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 42576 "gram_minimal.c" /* yacc.c:1646 */ break; case 1311: #line 9856 "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 42590 "gram_minimal.c" /* yacc.c:1646 */ break; case 1312: #line 9866 "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 42604 "gram_minimal.c" /* yacc.c:1646 */ break; case 1313: #line 9876 "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 42618 "gram_minimal.c" /* yacc.c:1646 */ break; case 1314: #line 9886 "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 42632 "gram_minimal.c" /* yacc.c:1646 */ break; case 1315: #line 9896 "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 42646 "gram_minimal.c" /* yacc.c:1646 */ break; case 1316: #line 9906 "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 42663 "gram_minimal.c" /* yacc.c:1646 */ break; case 1319: #line 9924 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } #line 42669 "gram_minimal.c" /* yacc.c:1646 */ break; case 1320: #line 9925 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 42675 "gram_minimal.c" /* yacc.c:1646 */ break; case 1321: #line 9936 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1322: #line 9946 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42703 "gram_minimal.c" /* yacc.c:1646 */ break; case 1323: #line 9956 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-5].objwithargs); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42717 "gram_minimal.c" /* yacc.c:1646 */ break; case 1324: #line 9966 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_TRIGGER; n->relation = (yyvsp[-5].range); n->object = (Node *) list_make1(makeString((yyvsp[-7].str))); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42732 "gram_minimal.c" /* yacc.c:1646 */ break; case 1325: #line 9977 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-5].range); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42746 "gram_minimal.c" /* yacc.c:1646 */ break; case 1326: #line 9987 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_INDEX; n->relation = (yyvsp[-5].range); n->extname = makeString((yyvsp[0].str)); n->remove = (yyvsp[-4].boolean); (yyval.node) = (Node *) n; } #line 42760 "gram_minimal.c" /* yacc.c:1646 */ break; case 1327: #line 9998 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42766 "gram_minimal.c" /* yacc.c:1646 */ break; case 1328: #line 9999 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42772 "gram_minimal.c" /* yacc.c:1646 */ break; case 1329: #line 10010 "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 42786 "gram_minimal.c" /* yacc.c:1646 */ break; case 1330: #line 10020 "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 42800 "gram_minimal.c" /* yacc.c:1646 */ break; case 1331: #line 10030 "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 42814 "gram_minimal.c" /* yacc.c:1646 */ break; case 1332: #line 10040 "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 42828 "gram_minimal.c" /* yacc.c:1646 */ break; case 1333: #line 10050 "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 42842 "gram_minimal.c" /* yacc.c:1646 */ break; case 1334: #line 10060 "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 42856 "gram_minimal.c" /* yacc.c:1646 */ break; case 1335: #line 10070 "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 42870 "gram_minimal.c" /* yacc.c:1646 */ break; case 1336: #line 10080 "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 42884 "gram_minimal.c" /* yacc.c:1646 */ break; case 1337: #line 10090 "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 42898 "gram_minimal.c" /* yacc.c:1646 */ break; case 1338: #line 10100 "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 42912 "gram_minimal.c" /* yacc.c:1646 */ break; case 1339: #line 10110 "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 42926 "gram_minimal.c" /* yacc.c:1646 */ break; case 1340: #line 10120 "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 42940 "gram_minimal.c" /* yacc.c:1646 */ break; case 1341: #line 10130 "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 42954 "gram_minimal.c" /* yacc.c:1646 */ break; case 1342: #line 10140 "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 42968 "gram_minimal.c" /* yacc.c:1646 */ break; case 1343: #line 10150 "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 42982 "gram_minimal.c" /* yacc.c:1646 */ break; case 1344: #line 10160 "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 42996 "gram_minimal.c" /* yacc.c:1646 */ break; case 1345: #line 10170 "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 43010 "gram_minimal.c" /* yacc.c:1646 */ break; case 1346: #line 10180 "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 43024 "gram_minimal.c" /* yacc.c:1646 */ break; case 1347: #line 10190 "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 43038 "gram_minimal.c" /* yacc.c:1646 */ break; case 1348: #line 10200 "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 43052 "gram_minimal.c" /* yacc.c:1646 */ break; case 1349: #line 10210 "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 43066 "gram_minimal.c" /* yacc.c:1646 */ break; case 1350: #line 10220 "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 43080 "gram_minimal.c" /* yacc.c:1646 */ break; case 1351: #line 10230 "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 43094 "gram_minimal.c" /* yacc.c:1646 */ break; case 1352: #line 10240 "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 43108 "gram_minimal.c" /* yacc.c:1646 */ break; case 1353: #line 10250 "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 43122 "gram_minimal.c" /* yacc.c:1646 */ break; case 1354: #line 10260 "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 43136 "gram_minimal.c" /* yacc.c:1646 */ break; case 1355: #line 10270 "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 43150 "gram_minimal.c" /* yacc.c:1646 */ break; case 1356: #line 10289 "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 43162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1357: #line 10298 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 43168 "gram_minimal.c" /* yacc.c:1646 */ break; case 1358: #line 10299 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 43174 "gram_minimal.c" /* yacc.c:1646 */ break; case 1359: #line 10303 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 43180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1360: #line 10305 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 43186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1361: #line 10307 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 43192 "gram_minimal.c" /* yacc.c:1646 */ break; case 1362: #line 10312 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].typnam); } #line 43198 "gram_minimal.c" /* yacc.c:1646 */ break; case 1363: #line 10313 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString(pstrdup((yyvsp[0].keyword))); } #line 43204 "gram_minimal.c" /* yacc.c:1646 */ break; case 1364: #line 10314 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 43210 "gram_minimal.c" /* yacc.c:1646 */ break; case 1365: #line 10315 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 43216 "gram_minimal.c" /* yacc.c:1646 */ break; case 1366: #line 10316 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 43222 "gram_minimal.c" /* yacc.c:1646 */ break; case 1367: #line 10329 "gram_minimal.y" /* yacc.c:1646 */ { AlterTypeStmt *n = makeNode(AlterTypeStmt); n->typeName = (yyvsp[-4].list); n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 43234 "gram_minimal.c" /* yacc.c:1646 */ break; case 1368: #line 10345 "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 43247 "gram_minimal.c" /* yacc.c:1646 */ break; case 1369: #line 10354 "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 43260 "gram_minimal.c" /* yacc.c:1646 */ break; case 1370: #line 10363 "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 43273 "gram_minimal.c" /* yacc.c:1646 */ break; case 1371: #line 10372 "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 43286 "gram_minimal.c" /* yacc.c:1646 */ break; case 1372: #line 10381 "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 43299 "gram_minimal.c" /* yacc.c:1646 */ break; case 1373: #line 10390 "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 43312 "gram_minimal.c" /* yacc.c:1646 */ break; case 1374: #line 10399 "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 43325 "gram_minimal.c" /* yacc.c:1646 */ break; case 1375: #line 10408 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].node); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *) n; } #line 43338 "gram_minimal.c" /* yacc.c:1646 */ break; case 1376: #line 10417 "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 43351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1377: #line 10426 "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 43364 "gram_minimal.c" /* yacc.c:1646 */ break; case 1378: #line 10435 "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 43377 "gram_minimal.c" /* yacc.c:1646 */ break; case 1379: #line 10444 "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 43390 "gram_minimal.c" /* yacc.c:1646 */ break; case 1380: #line 10453 "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 43403 "gram_minimal.c" /* yacc.c:1646 */ break; case 1381: #line 10462 "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 43416 "gram_minimal.c" /* yacc.c:1646 */ break; case 1382: #line 10471 "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 43429 "gram_minimal.c" /* yacc.c:1646 */ break; case 1383: #line 10480 "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 43442 "gram_minimal.c" /* yacc.c:1646 */ break; case 1384: #line 10489 "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 43455 "gram_minimal.c" /* yacc.c:1646 */ break; case 1385: #line 10498 "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 43468 "gram_minimal.c" /* yacc.c:1646 */ break; case 1386: #line 10507 "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 43481 "gram_minimal.c" /* yacc.c:1646 */ break; case 1387: #line 10516 "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 43494 "gram_minimal.c" /* yacc.c:1646 */ break; case 1388: #line 10525 "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 43507 "gram_minimal.c" /* yacc.c:1646 */ break; case 1389: #line 10534 "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 43520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1390: #line 10543 "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 43533 "gram_minimal.c" /* yacc.c:1646 */ break; case 1391: #line 10552 "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 43546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1392: #line 10580 "gram_minimal.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43558 "gram_minimal.c" /* yacc.c:1646 */ break; case 1393: #line 10588 "gram_minimal.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-4].str); n->options = (yyvsp[0].list); n->for_all_tables = true; (yyval.node) = (Node *) n; } #line 43571 "gram_minimal.c" /* yacc.c:1646 */ break; case 1394: #line 10597 "gram_minimal.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-3].str); n->options = (yyvsp[0].list); n->pubobjects = (List *) (yyvsp[-1].list); preprocess_pubobj_list(n->pubobjects, yyscanner); (yyval.node) = (Node *) n; } #line 43585 "gram_minimal.c" /* yacc.c:1646 */ break; case 1395: #line 10623 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLE; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = (yyvsp[-2].range); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } #line 43598 "gram_minimal.c" /* yacc.c:1646 */ break; case 1396: #line 10632 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; (yyval.publicationobjectspec)->name = (yyvsp[0].str); (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43609 "gram_minimal.c" /* yacc.c:1646 */ break; case 1397: #line 10639 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43619 "gram_minimal.c" /* yacc.c:1646 */ break; case 1398: #line 10645 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; /* * If either a row filter or column list is specified, create * a PublicationTable object. */ if ((yyvsp[-1].list) || (yyvsp[0].node)) { /* * The OptWhereClause must be stored here but it is * valid only for tables. For non-table objects, an * error will be thrown later via * preprocess_pubobj_list(). */ (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = makeRangeVar(NULL, (yyvsp[-2].str), (yylsp[-2])); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } else { (yyval.publicationobjectspec)->name = (yyvsp[-2].str); } (yyval.publicationobjectspec)->location = (yylsp[-2]); } #line 43650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1399: #line 10672 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = makeRangeVarFromQualifiedName((yyvsp[-3].str), (yyvsp[-2].list), (yylsp[-3]), yyscanner); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); (yyval.publicationobjectspec)->location = (yylsp[-3]); } #line 43664 "gram_minimal.c" /* yacc.c:1646 */ break; case 1400: #line 10683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->pubtable = makeNode(PublicationTable); (yyval.publicationobjectspec)->pubtable->relation = (yyvsp[-2].range); (yyval.publicationobjectspec)->pubtable->columns = (yyvsp[-1].list); (yyval.publicationobjectspec)->pubtable->whereClause = (yyvsp[0].node); } #line 43677 "gram_minimal.c" /* yacc.c:1646 */ break; case 1401: #line 10692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.publicationobjectspec) = makeNode(PublicationObjSpec); (yyval.publicationobjectspec)->pubobjtype = PUBLICATIONOBJ_CONTINUATION; (yyval.publicationobjectspec)->location = (yylsp[0]); } #line 43687 "gram_minimal.c" /* yacc.c:1646 */ break; case 1402: #line 10700 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].publicationobjectspec)); } #line 43693 "gram_minimal.c" /* yacc.c:1646 */ break; case 1403: #line 10702 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].publicationobjectspec)); } #line 43699 "gram_minimal.c" /* yacc.c:1646 */ break; case 1404: #line 10724 "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 43711 "gram_minimal.c" /* yacc.c:1646 */ break; case 1405: #line 10732 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_AddObjects; (yyval.node) = (Node *) n; } #line 43725 "gram_minimal.c" /* yacc.c:1646 */ break; case 1406: #line 10742 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_SetObjects; (yyval.node) = (Node *) n; } #line 43739 "gram_minimal.c" /* yacc.c:1646 */ break; case 1407: #line 10752 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->pubobjects = (yyvsp[0].list); preprocess_pubobj_list(n->pubobjects, yyscanner); n->action = AP_DropObjects; (yyval.node) = (Node *) n; } #line 43753 "gram_minimal.c" /* yacc.c:1646 */ break; case 1408: #line 10771 "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 43767 "gram_minimal.c" /* yacc.c:1646 */ break; case 1409: #line 10790 "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 43781 "gram_minimal.c" /* yacc.c:1646 */ break; case 1410: #line 10800 "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 43795 "gram_minimal.c" /* yacc.c:1646 */ break; case 1411: #line 10810 "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 43809 "gram_minimal.c" /* yacc.c:1646 */ break; case 1412: #line 10820 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ADD_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43824 "gram_minimal.c" /* yacc.c:1646 */ break; case 1413: #line 10831 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_DROP_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43839 "gram_minimal.c" /* yacc.c:1646 */ break; case 1414: #line 10842 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SET_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43854 "gram_minimal.c" /* yacc.c:1646 */ break; case 1415: #line 10853 "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 *) makeBoolean(true), (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 43869 "gram_minimal.c" /* yacc.c:1646 */ break; case 1416: #line 10864 "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 *) makeBoolean(false), (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 43884 "gram_minimal.c" /* yacc.c:1646 */ break; case 1417: #line 10875 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_SKIP; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 43898 "gram_minimal.c" /* yacc.c:1646 */ break; case 1418: #line 10893 "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 43911 "gram_minimal.c" /* yacc.c:1646 */ break; case 1419: #line 10902 "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 43924 "gram_minimal.c" /* yacc.c:1646 */ break; case 1420: #line 10921 "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 43941 "gram_minimal.c" /* yacc.c:1646 */ break; case 1421: #line 10936 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 43947 "gram_minimal.c" /* yacc.c:1646 */ break; case 1422: #line 10937 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 43953 "gram_minimal.c" /* yacc.c:1646 */ break; case 1423: #line 10938 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 43959 "gram_minimal.c" /* yacc.c:1646 */ break; case 1424: #line 10944 "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 43969 "gram_minimal.c" /* yacc.c:1646 */ break; case 1425: #line 10950 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 43979 "gram_minimal.c" /* yacc.c:1646 */ break; case 1431: #line 10966 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43985 "gram_minimal.c" /* yacc.c:1646 */ break; case 1432: #line 10967 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 43991 "gram_minimal.c" /* yacc.c:1646 */ break; case 1433: #line 10970 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_SELECT; } #line 43997 "gram_minimal.c" /* yacc.c:1646 */ break; case 1434: #line 10971 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_UPDATE; } #line 44003 "gram_minimal.c" /* yacc.c:1646 */ break; case 1435: #line 10972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_DELETE; } #line 44009 "gram_minimal.c" /* yacc.c:1646 */ break; case 1436: #line 10973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_INSERT; } #line 44015 "gram_minimal.c" /* yacc.c:1646 */ break; case 1437: #line 10977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44021 "gram_minimal.c" /* yacc.c:1646 */ break; case 1438: #line 10978 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44027 "gram_minimal.c" /* yacc.c:1646 */ break; case 1439: #line 10979 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44033 "gram_minimal.c" /* yacc.c:1646 */ break; case 1440: #line 10992 "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 44045 "gram_minimal.c" /* yacc.c:1646 */ break; case 1441: #line 11002 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44051 "gram_minimal.c" /* yacc.c:1646 */ break; case 1442: #line 11003 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 44057 "gram_minimal.c" /* yacc.c:1646 */ break; case 1443: #line 11007 "gram_minimal.y" /* yacc.c:1646 */ { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44068 "gram_minimal.c" /* yacc.c:1646 */ break; case 1444: #line 11017 "gram_minimal.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44079 "gram_minimal.c" /* yacc.c:1646 */ break; case 1445: #line 11024 "gram_minimal.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *) n; } #line 44090 "gram_minimal.c" /* yacc.c:1646 */ break; case 1446: #line 11044 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44104 "gram_minimal.c" /* yacc.c:1646 */ break; case 1447: #line 11054 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 44117 "gram_minimal.c" /* yacc.c:1646 */ break; case 1448: #line 11063 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44131 "gram_minimal.c" /* yacc.c:1646 */ break; case 1449: #line 11073 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44145 "gram_minimal.c" /* yacc.c:1646 */ break; case 1450: #line 11083 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44158 "gram_minimal.c" /* yacc.c:1646 */ break; case 1451: #line 11092 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44171 "gram_minimal.c" /* yacc.c:1646 */ break; case 1452: #line 11101 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44184 "gram_minimal.c" /* yacc.c:1646 */ break; case 1453: #line 11110 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44197 "gram_minimal.c" /* yacc.c:1646 */ break; case 1454: #line 11119 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44210 "gram_minimal.c" /* yacc.c:1646 */ break; case 1455: #line 11128 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44223 "gram_minimal.c" /* yacc.c:1646 */ break; case 1456: #line 11137 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44236 "gram_minimal.c" /* yacc.c:1646 */ break; case 1457: #line 11146 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 44249 "gram_minimal.c" /* yacc.c:1646 */ break; case 1458: #line 11158 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); n->location = -1; (yyval.node) = (Node *) n; } #line 44262 "gram_minimal.c" /* yacc.c:1646 */ break; case 1459: #line 11167 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); n->location = -1; (yyval.node) = (Node *) n; } #line 44276 "gram_minimal.c" /* yacc.c:1646 */ break; case 1463: #line 11185 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 44283 "gram_minimal.c" /* yacc.c:1646 */ break; case 1464: #line 11188 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 44290 "gram_minimal.c" /* yacc.c:1646 */ break; case 1465: #line 11191 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 44297 "gram_minimal.c" /* yacc.c:1646 */ break; case 1466: #line 11194 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 44304 "gram_minimal.c" /* yacc.c:1646 */ break; case 1467: #line 11197 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 44311 "gram_minimal.c" /* yacc.c:1646 */ break; case 1468: #line 11204 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 44317 "gram_minimal.c" /* yacc.c:1646 */ break; case 1469: #line 11206 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 44323 "gram_minimal.c" /* yacc.c:1646 */ break; case 1470: #line 11208 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 44329 "gram_minimal.c" /* yacc.c:1646 */ break; case 1472: #line 11214 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1473: #line 11218 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44341 "gram_minimal.c" /* yacc.c:1646 */ break; case 1474: #line 11219 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44347 "gram_minimal.c" /* yacc.c:1646 */ break; case 1475: #line 11220 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44353 "gram_minimal.c" /* yacc.c:1646 */ break; case 1476: #line 11234 "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 44370 "gram_minimal.c" /* yacc.c:1646 */ break; case 1477: #line 11248 "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 44387 "gram_minimal.c" /* yacc.c:1646 */ break; case 1478: #line 11262 "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 44409 "gram_minimal.c" /* yacc.c:1646 */ break; case 1479: #line 11281 "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 44431 "gram_minimal.c" /* yacc.c:1646 */ break; case 1480: #line 11301 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 44437 "gram_minimal.c" /* yacc.c:1646 */ break; case 1481: #line 11302 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 44443 "gram_minimal.c" /* yacc.c:1646 */ break; case 1482: #line 11303 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 44449 "gram_minimal.c" /* yacc.c:1646 */ break; case 1483: #line 11304 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = NO_CHECK_OPTION; } #line 44455 "gram_minimal.c" /* yacc.c:1646 */ break; case 1484: #line 11315 "gram_minimal.y" /* yacc.c:1646 */ { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 44466 "gram_minimal.c" /* yacc.c:1646 */ break; case 1485: #line 11332 "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 44478 "gram_minimal.c" /* yacc.c:1646 */ break; case 1486: #line 11342 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44484 "gram_minimal.c" /* yacc.c:1646 */ break; case 1487: #line 11343 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44490 "gram_minimal.c" /* yacc.c:1646 */ break; case 1488: #line 11347 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 44496 "gram_minimal.c" /* yacc.c:1646 */ break; case 1489: #line 11348 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 44502 "gram_minimal.c" /* yacc.c:1646 */ break; case 1490: #line 11353 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (yyvsp[0].node), (yylsp[-2])); } #line 44510 "gram_minimal.c" /* yacc.c:1646 */ break; case 1491: #line 11357 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) makeString((yyvsp[0].str)), (yylsp[-2])); } #line 44518 "gram_minimal.c" /* yacc.c:1646 */ break; case 1492: #line 11361 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 44526 "gram_minimal.c" /* yacc.c:1646 */ break; case 1493: #line 11378 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44532 "gram_minimal.c" /* yacc.c:1646 */ break; case 1494: #line 11379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("connection_limit"); } #line 44538 "gram_minimal.c" /* yacc.c:1646 */ break; case 1495: #line 11380 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44544 "gram_minimal.c" /* yacc.c:1646 */ break; case 1496: #line 11381 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44550 "gram_minimal.c" /* yacc.c:1646 */ break; case 1497: #line 11382 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44556 "gram_minimal.c" /* yacc.c:1646 */ break; case 1498: #line 11383 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44562 "gram_minimal.c" /* yacc.c:1646 */ break; case 1499: #line 11384 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 44568 "gram_minimal.c" /* yacc.c:1646 */ break; case 1502: #line 11404 "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 44580 "gram_minimal.c" /* yacc.c:1646 */ break; case 1503: #line 11412 "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 44592 "gram_minimal.c" /* yacc.c:1646 */ break; case 1504: #line 11420 "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 44605 "gram_minimal.c" /* yacc.c:1646 */ break; case 1505: #line 11429 "gram_minimal.y" /* yacc.c:1646 */ { AlterDatabaseRefreshCollStmt *n = makeNode(AlterDatabaseRefreshCollStmt); n->dbname = (yyvsp[-3].str); (yyval.node) = (Node *) n; } #line 44616 "gram_minimal.c" /* yacc.c:1646 */ break; case 1506: #line 11439 "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 44628 "gram_minimal.c" /* yacc.c:1646 */ break; case 1507: #line 11457 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; n->options = NULL; (yyval.node) = (Node *) n; } #line 44641 "gram_minimal.c" /* yacc.c:1646 */ break; case 1508: #line 11466 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; n->options = NULL; (yyval.node) = (Node *) n; } #line 44654 "gram_minimal.c" /* yacc.c:1646 */ break; case 1509: #line 11475 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = false; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44667 "gram_minimal.c" /* yacc.c:1646 */ break; case 1510: #line 11484 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[-4].str); n->missing_ok = true; n->options = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44680 "gram_minimal.c" /* yacc.c:1646 */ break; case 1511: #line 11496 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((Node *) (yyvsp[0].defelt)); } #line 44688 "gram_minimal.c" /* yacc.c:1646 */ break; case 1512: #line 11500 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (Node *) (yyvsp[0].defelt)); } #line 44696 "gram_minimal.c" /* yacc.c:1646 */ break; case 1513: #line 11511 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force", NULL, (yylsp[0])); } #line 44704 "gram_minimal.c" /* yacc.c:1646 */ break; case 1514: #line 11523 "gram_minimal.y" /* yacc.c:1646 */ { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 44715 "gram_minimal.c" /* yacc.c:1646 */ break; case 1515: #line 11541 "gram_minimal.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 44726 "gram_minimal.c" /* yacc.c:1646 */ break; case 1516: #line 11548 "gram_minimal.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *) n; } #line 44737 "gram_minimal.c" /* yacc.c:1646 */ break; case 1517: #line 11565 "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 44751 "gram_minimal.c" /* yacc.c:1646 */ break; case 1518: #line 11579 "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 44764 "gram_minimal.c" /* yacc.c:1646 */ break; case 1519: #line 11589 "gram_minimal.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 44776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1520: #line 11598 "gram_minimal.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 44788 "gram_minimal.c" /* yacc.c:1646 */ break; case 1521: #line 11607 "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 44801 "gram_minimal.c" /* yacc.c:1646 */ break; case 1522: #line 11617 "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 44816 "gram_minimal.c" /* yacc.c:1646 */ break; case 1523: #line 11629 "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 44831 "gram_minimal.c" /* yacc.c:1646 */ break; case 1524: #line 11641 "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 44844 "gram_minimal.c" /* yacc.c:1646 */ break; case 1527: #line 11664 "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 44856 "gram_minimal.c" /* yacc.c:1646 */ break; case 1528: #line 11675 "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 44872 "gram_minimal.c" /* yacc.c:1646 */ break; case 1529: #line 11687 "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 44888 "gram_minimal.c" /* yacc.c:1646 */ break; case 1530: #line 11699 "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 44904 "gram_minimal.c" /* yacc.c:1646 */ break; case 1531: #line 11711 "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 44920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1532: #line 11723 "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 44934 "gram_minimal.c" /* yacc.c:1646 */ break; case 1533: #line 11733 "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 44948 "gram_minimal.c" /* yacc.c:1646 */ break; case 1536: #line 11762 "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 44963 "gram_minimal.c" /* yacc.c:1646 */ break; case 1537: #line 11785 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = (yyvsp[-3].list); (yyval.node) = (Node *) n; } #line 44976 "gram_minimal.c" /* yacc.c:1646 */ break; case 1538: #line 11794 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 44989 "gram_minimal.c" /* yacc.c:1646 */ break; case 1539: #line 11804 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->params = NIL; if ((yyvsp[-2].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[-2]))); (yyval.node) = (Node *) n; } #line 45004 "gram_minimal.c" /* yacc.c:1646 */ break; case 1540: #line 11816 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->params = NIL; if ((yyvsp[0].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[0]))); (yyval.node) = (Node *) n; } #line 45019 "gram_minimal.c" /* yacc.c:1646 */ break; case 1541: #line 11828 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[0].range); n->indexname = (yyvsp[-2].str); n->params = NIL; if ((yyvsp[-3].boolean)) n->params = lappend(n->params, makeDefElem("verbose", NULL, (yylsp[-3]))); (yyval.node) = (Node *) n; } #line 45034 "gram_minimal.c" /* yacc.c:1646 */ break; case 1542: #line 11841 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45040 "gram_minimal.c" /* yacc.c:1646 */ break; case 1543: #line 11842 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 45046 "gram_minimal.c" /* yacc.c:1646 */ break; case 1544: #line 11855 "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 45071 "gram_minimal.c" /* yacc.c:1646 */ break; case 1545: #line 11876 "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 45084 "gram_minimal.c" /* yacc.c:1646 */ break; case 1546: #line 11887 "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 45100 "gram_minimal.c" /* yacc.c:1646 */ break; case 1547: #line 11899 "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 45113 "gram_minimal.c" /* yacc.c:1646 */ break; case 1548: #line 11911 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 45121 "gram_minimal.c" /* yacc.c:1646 */ break; case 1549: #line 11915 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 45129 "gram_minimal.c" /* yacc.c:1646 */ break; case 1552: #line 11927 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 45137 "gram_minimal.c" /* yacc.c:1646 */ break; case 1553: #line 11933 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45143 "gram_minimal.c" /* yacc.c:1646 */ break; case 1554: #line 11934 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 45149 "gram_minimal.c" /* yacc.c:1646 */ break; case 1555: #line 11935 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "format"; } #line 45155 "gram_minimal.c" /* yacc.c:1646 */ break; case 1556: #line 11939 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 45161 "gram_minimal.c" /* yacc.c:1646 */ break; case 1557: #line 11940 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].node); } #line 45167 "gram_minimal.c" /* yacc.c:1646 */ break; case 1558: #line 11941 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45173 "gram_minimal.c" /* yacc.c:1646 */ break; case 1559: #line 11945 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45179 "gram_minimal.c" /* yacc.c:1646 */ break; case 1560: #line 11946 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45185 "gram_minimal.c" /* yacc.c:1646 */ break; case 1561: #line 11950 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45191 "gram_minimal.c" /* yacc.c:1646 */ break; case 1562: #line 11951 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45197 "gram_minimal.c" /* yacc.c:1646 */ break; case 1563: #line 11954 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45203 "gram_minimal.c" /* yacc.c:1646 */ break; case 1564: #line 11955 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45209 "gram_minimal.c" /* yacc.c:1646 */ break; case 1565: #line 11958 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45215 "gram_minimal.c" /* yacc.c:1646 */ break; case 1566: #line 11959 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45221 "gram_minimal.c" /* yacc.c:1646 */ break; case 1567: #line 11963 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45227 "gram_minimal.c" /* yacc.c:1646 */ break; case 1568: #line 11964 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45233 "gram_minimal.c" /* yacc.c:1646 */ break; case 1569: #line 11969 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 45241 "gram_minimal.c" /* yacc.c:1646 */ break; case 1570: #line 11976 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45247 "gram_minimal.c" /* yacc.c:1646 */ break; case 1571: #line 11978 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45253 "gram_minimal.c" /* yacc.c:1646 */ break; case 1572: #line 11982 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45259 "gram_minimal.c" /* yacc.c:1646 */ break; case 1573: #line 11983 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45265 "gram_minimal.c" /* yacc.c:1646 */ break; case 1574: #line 11997 "gram_minimal.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 45277 "gram_minimal.c" /* yacc.c:1646 */ break; case 1575: #line 12005 "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 45292 "gram_minimal.c" /* yacc.c:1646 */ break; case 1576: #line 12016 "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 45304 "gram_minimal.c" /* yacc.c:1646 */ break; case 1577: #line 12024 "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 45316 "gram_minimal.c" /* yacc.c:1646 */ break; case 1588: #line 12054 "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 45329 "gram_minimal.c" /* yacc.c:1646 */ break; case 1589: #line 12064 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1590: #line 12065 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45341 "gram_minimal.c" /* yacc.c:1646 */ break; case 1596: #line 12084 "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 45353 "gram_minimal.c" /* yacc.c:1646 */ break; case 1597: #line 12093 "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->objtype = 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 45374 "gram_minimal.c" /* yacc.c:1646 */ break; case 1598: #line 12111 "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->objtype = 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 45395 "gram_minimal.c" /* yacc.c:1646 */ break; case 1599: #line 12129 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45401 "gram_minimal.c" /* yacc.c:1646 */ break; case 1600: #line 12130 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45407 "gram_minimal.c" /* yacc.c:1646 */ break; case 1601: #line 12141 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45420 "gram_minimal.c" /* yacc.c:1646 */ break; case 1602: #line 12150 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); n->isall = false; n->location = (yylsp[0]); (yyval.node) = (Node *) n; } #line 45433 "gram_minimal.c" /* yacc.c:1646 */ break; case 1603: #line 12159 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 45446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1604: #line 12168 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; n->isall = true; n->location = -1; (yyval.node) = (Node *) n; } #line 45459 "gram_minimal.c" /* yacc.c:1646 */ break; case 1605: #line 12188 "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 45471 "gram_minimal.c" /* yacc.c:1646 */ break; case 1606: #line 12198 "gram_minimal.y" /* yacc.c:1646 */ { InsertStmt *insert = makeNode(InsertStmt); insert->relation = (yyvsp[0].range); (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 45487 "gram_minimal.c" /* yacc.c:1646 */ break; case 1607: #line 12219 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 45495 "gram_minimal.c" /* yacc.c:1646 */ break; case 1608: #line 12223 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 45504 "gram_minimal.c" /* yacc.c:1646 */ break; case 1609: #line 12231 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 45514 "gram_minimal.c" /* yacc.c:1646 */ break; case 1610: #line 12237 "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 45525 "gram_minimal.c" /* yacc.c:1646 */ break; case 1611: #line 12244 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 45535 "gram_minimal.c" /* yacc.c:1646 */ break; case 1612: #line 12250 "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 45546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1613: #line 12257 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 45556 "gram_minimal.c" /* yacc.c:1646 */ break; case 1614: #line 12265 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 45562 "gram_minimal.c" /* yacc.c:1646 */ break; case 1615: #line 12266 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 45568 "gram_minimal.c" /* yacc.c:1646 */ break; case 1616: #line 12271 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 45574 "gram_minimal.c" /* yacc.c:1646 */ break; case 1617: #line 12273 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 45580 "gram_minimal.c" /* yacc.c:1646 */ break; case 1618: #line 12278 "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 45592 "gram_minimal.c" /* yacc.c:1646 */ break; case 1619: #line 12289 "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 45605 "gram_minimal.c" /* yacc.c:1646 */ break; case 1620: #line 12299 "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 45618 "gram_minimal.c" /* yacc.c:1646 */ break; case 1621: #line 12308 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.onconflict) = NULL; } #line 45626 "gram_minimal.c" /* yacc.c:1646 */ break; case 1622: #line 12315 "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 45638 "gram_minimal.c" /* yacc.c:1646 */ break; case 1623: #line 12324 "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 45650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1624: #line 12332 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.infer) = NULL; } #line 45658 "gram_minimal.c" /* yacc.c:1646 */ break; case 1625: #line 12338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45664 "gram_minimal.c" /* yacc.c:1646 */ break; case 1626: #line 12339 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45670 "gram_minimal.c" /* yacc.c:1646 */ break; case 1627: #line 12352 "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 45685 "gram_minimal.c" /* yacc.c:1646 */ break; case 1628: #line 12365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45691 "gram_minimal.c" /* yacc.c:1646 */ break; case 1629: #line 12366 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45697 "gram_minimal.c" /* yacc.c:1646 */ break; case 1630: #line 12378 "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 45710 "gram_minimal.c" /* yacc.c:1646 */ break; case 1631: #line 12388 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival); } #line 45716 "gram_minimal.c" /* yacc.c:1646 */ break; case 1632: #line 12389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 45722 "gram_minimal.c" /* yacc.c:1646 */ break; case 1633: #line 12392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessShareLock; } #line 45728 "gram_minimal.c" /* yacc.c:1646 */ break; case 1634: #line 12393 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RowShareLock; } #line 45734 "gram_minimal.c" /* yacc.c:1646 */ break; case 1635: #line 12394 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RowExclusiveLock; } #line 45740 "gram_minimal.c" /* yacc.c:1646 */ break; case 1636: #line 12395 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareUpdateExclusiveLock; } #line 45746 "gram_minimal.c" /* yacc.c:1646 */ break; case 1637: #line 12396 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareLock; } #line 45752 "gram_minimal.c" /* yacc.c:1646 */ break; case 1638: #line 12397 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareRowExclusiveLock; } #line 45758 "gram_minimal.c" /* yacc.c:1646 */ break; case 1639: #line 12398 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ExclusiveLock; } #line 45764 "gram_minimal.c" /* yacc.c:1646 */ break; case 1640: #line 12399 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 45770 "gram_minimal.c" /* yacc.c:1646 */ break; case 1641: #line 12402 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 45776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1642: #line 12403 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 45782 "gram_minimal.c" /* yacc.c:1646 */ break; case 1643: #line 12407 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitError; } #line 45788 "gram_minimal.c" /* yacc.c:1646 */ break; case 1644: #line 12408 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitSkip; } #line 45794 "gram_minimal.c" /* yacc.c:1646 */ break; case 1645: #line 12409 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitBlock; } #line 45800 "gram_minimal.c" /* yacc.c:1646 */ break; case 1646: #line 12425 "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 45816 "gram_minimal.c" /* yacc.c:1646 */ break; case 1647: #line 12438 "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 45833 "gram_minimal.c" /* yacc.c:1646 */ break; case 1648: #line 12452 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45839 "gram_minimal.c" /* yacc.c:1646 */ break; case 1649: #line 12453 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 45845 "gram_minimal.c" /* yacc.c:1646 */ break; case 1650: #line 12458 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 45854 "gram_minimal.c" /* yacc.c:1646 */ break; case 1651: #line 12463 "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 45879 "gram_minimal.c" /* yacc.c:1646 */ break; case 1652: #line 12487 "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 45891 "gram_minimal.c" /* yacc.c:1646 */ break; case 1653: #line 12497 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 45897 "gram_minimal.c" /* yacc.c:1646 */ break; case 1654: #line 12498 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 45903 "gram_minimal.c" /* yacc.c:1646 */ break; case 1655: #line 12515 "gram_minimal.y" /* yacc.c:1646 */ { MergeStmt *m = makeNode(MergeStmt); m->withClause = (yyvsp[-9].with); m->relation = (yyvsp[-6].range); m->sourceRelation = (yyvsp[-4].node); m->joinCondition = (yyvsp[-2].node); m->mergeWhenClauses = (yyvsp[-1].list); m->returningList = (yyvsp[0].list); (yyval.node) = (Node *) m; } #line 45920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1656: #line 12530 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45926 "gram_minimal.c" /* yacc.c:1646 */ break; case 1657: #line 12531 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list),(yyvsp[0].node)); } #line 45932 "gram_minimal.c" /* yacc.c:1646 */ break; case 1658: #line 12542 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 45943 "gram_minimal.c" /* yacc.c:1646 */ break; case 1659: #line 12549 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 45954 "gram_minimal.c" /* yacc.c:1646 */ break; case 1660: #line 12556 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[0].mergewhen)->matchKind = (yyvsp[-3].mergematch); (yyvsp[0].mergewhen)->condition = (yyvsp[-2].node); (yyval.node) = (Node *) (yyvsp[0].mergewhen); } #line 45965 "gram_minimal.c" /* yacc.c:1646 */ break; case 1661: #line 12563 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 45979 "gram_minimal.c" /* yacc.c:1646 */ break; case 1662: #line 12573 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *m = makeNode(MergeWhenClause); m->matchKind = (yyvsp[-4].mergematch); m->commandType = CMD_NOTHING; m->condition = (yyvsp[-3].node); (yyval.node) = (Node *) m; } #line 45993 "gram_minimal.c" /* yacc.c:1646 */ break; case 1663: #line 12585 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_MATCHED; } #line 45999 "gram_minimal.c" /* yacc.c:1646 */ break; case 1664: #line 12586 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_SOURCE; } #line 46005 "gram_minimal.c" /* yacc.c:1646 */ break; case 1665: #line 12590 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 46011 "gram_minimal.c" /* yacc.c:1646 */ break; case 1666: #line 12591 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.mergematch) = MERGE_WHEN_NOT_MATCHED_BY_TARGET; } #line 46017 "gram_minimal.c" /* yacc.c:1646 */ break; case 1667: #line 12595 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46023 "gram_minimal.c" /* yacc.c:1646 */ break; case 1668: #line 12596 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46029 "gram_minimal.c" /* yacc.c:1646 */ break; case 1669: #line 12601 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_UPDATE; n->override = OVERRIDING_NOT_SET; n->targetList = (yyvsp[0].list); n->values = NIL; (yyval.mergewhen) = n; } #line 46043 "gram_minimal.c" /* yacc.c:1646 */ break; case 1670: #line 12614 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_DELETE; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 46057 "gram_minimal.c" /* yacc.c:1646 */ break; case 1671: #line 12627 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46070 "gram_minimal.c" /* yacc.c:1646 */ break; case 1672: #line 12636 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = (yyvsp[-2].ival); n->targetList = NIL; n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46083 "gram_minimal.c" /* yacc.c:1646 */ break; case 1673: #line 12645 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = (yyvsp[-2].list); n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46096 "gram_minimal.c" /* yacc.c:1646 */ break; case 1674: #line 12654 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = (yyvsp[-2].ival); n->targetList = (yyvsp[-5].list); n->values = (yyvsp[0].list); (yyval.mergewhen) = n; } #line 46109 "gram_minimal.c" /* yacc.c:1646 */ break; case 1675: #line 12663 "gram_minimal.y" /* yacc.c:1646 */ { MergeWhenClause *n = makeNode(MergeWhenClause); n->commandType = CMD_INSERT; n->override = OVERRIDING_NOT_SET; n->targetList = NIL; n->values = NIL; (yyval.mergewhen) = n; } #line 46122 "gram_minimal.c" /* yacc.c:1646 */ break; case 1676: #line 12675 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 46130 "gram_minimal.c" /* yacc.c:1646 */ break; case 1677: #line 12687 "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 46144 "gram_minimal.c" /* yacc.c:1646 */ break; case 1678: #line 12698 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46150 "gram_minimal.c" /* yacc.c:1646 */ break; case 1679: #line 12701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46156 "gram_minimal.c" /* yacc.c:1646 */ break; case 1680: #line 12702 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 46162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1681: #line 12703 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 46168 "gram_minimal.c" /* yacc.c:1646 */ break; case 1682: #line 12704 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 46174 "gram_minimal.c" /* yacc.c:1646 */ break; case 1683: #line 12705 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_ASENSITIVE; } #line 46180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1684: #line 12706 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 46186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1685: #line 12709 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46192 "gram_minimal.c" /* yacc.c:1646 */ break; case 1686: #line 12710 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CURSOR_OPT_HOLD; } #line 46198 "gram_minimal.c" /* yacc.c:1646 */ break; case 1687: #line 12711 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46204 "gram_minimal.c" /* yacc.c:1646 */ break; case 1690: #line 12764 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 46210 "gram_minimal.c" /* yacc.c:1646 */ break; case 1691: #line 12765 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 46216 "gram_minimal.c" /* yacc.c:1646 */ break; case 1692: #line 12780 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46222 "gram_minimal.c" /* yacc.c:1646 */ break; case 1693: #line 12782 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 46233 "gram_minimal.c" /* yacc.c:1646 */ break; case 1694: #line 12789 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46245 "gram_minimal.c" /* yacc.c:1646 */ break; case 1695: #line 12797 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), NULL, yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46257 "gram_minimal.c" /* yacc.c:1646 */ break; case 1696: #line 12805 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 46269 "gram_minimal.c" /* yacc.c:1646 */ break; case 1697: #line 12813 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, (yyvsp[-2].with), yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 46281 "gram_minimal.c" /* yacc.c:1646 */ break; case 1698: #line 12821 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), (yyvsp[0].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46293 "gram_minimal.c" /* yacc.c:1646 */ break; case 1699: #line 12829 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), (yyvsp[-1].selectlimit), (yyvsp[-4].with), yyscanner); (yyval.node) = (yyvsp[-3].node); } #line 46305 "gram_minimal.c" /* yacc.c:1646 */ break; case 1700: #line 12839 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46311 "gram_minimal.c" /* yacc.c:1646 */ break; case 1701: #line 12840 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46317 "gram_minimal.c" /* yacc.c:1646 */ break; case 1702: #line 12875 "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].groupclause))->list; n->groupDistinct = ((yyvsp[-2].groupclause))->distinct; n->havingClause = (yyvsp[-1].node); n->windowClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1703: #line 12891 "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].groupclause))->list; n->groupDistinct = ((yyvsp[-2].groupclause))->distinct; n->havingClause = (yyvsp[-1].node); n->windowClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 46354 "gram_minimal.c" /* yacc.c:1646 */ break; case 1704: #line 12905 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46360 "gram_minimal.c" /* yacc.c:1646 */ break; case 1705: #line 12907 "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 46383 "gram_minimal.c" /* yacc.c:1646 */ break; case 1706: #line 12926 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46391 "gram_minimal.c" /* yacc.c:1646 */ break; case 1707: #line 12930 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1708: #line 12934 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].setquantifier) == SET_QUANTIFIER_ALL, (yyvsp[-3].node), (yyvsp[0].node)); } #line 46407 "gram_minimal.c" /* yacc.c:1646 */ break; case 1709: #line 12949 "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 46418 "gram_minimal.c" /* yacc.c:1646 */ break; case 1710: #line 12956 "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 46429 "gram_minimal.c" /* yacc.c:1646 */ break; case 1711: #line 12963 "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 46440 "gram_minimal.c" /* yacc.c:1646 */ break; case 1712: #line 12972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 46446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1713: #line 12973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 46452 "gram_minimal.c" /* yacc.c:1646 */ break; case 1714: #line 12977 "gram_minimal.y" /* yacc.c:1646 */ { CommonTableExpr *n = makeNode(CommonTableExpr); n->ctename = (yyvsp[-8].str); n->aliascolnames = (yyvsp[-7].list); n->ctematerialized = (yyvsp[-5].ival); n->ctequery = (yyvsp[-3].node); n->search_clause = castNode(CTESearchClause, (yyvsp[-1].node)); n->cycle_clause = castNode(CTECycleClause, (yyvsp[0].node)); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 46469 "gram_minimal.c" /* yacc.c:1646 */ break; case 1715: #line 12992 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeAlways; } #line 46475 "gram_minimal.c" /* yacc.c:1646 */ break; case 1716: #line 12993 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeNever; } #line 46481 "gram_minimal.c" /* yacc.c:1646 */ break; case 1717: #line 12994 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeDefault; } #line 46487 "gram_minimal.c" /* yacc.c:1646 */ break; case 1718: #line 12999 "gram_minimal.y" /* yacc.c:1646 */ { CTESearchClause *n = makeNode(CTESearchClause); n->search_col_list = (yyvsp[-2].list); n->search_breadth_first = false; n->search_seq_column = (yyvsp[0].str); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 46501 "gram_minimal.c" /* yacc.c:1646 */ break; case 1719: #line 13009 "gram_minimal.y" /* yacc.c:1646 */ { CTESearchClause *n = makeNode(CTESearchClause); n->search_col_list = (yyvsp[-2].list); n->search_breadth_first = true; n->search_seq_column = (yyvsp[0].str); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 46515 "gram_minimal.c" /* yacc.c:1646 */ break; case 1720: #line 13019 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46523 "gram_minimal.c" /* yacc.c:1646 */ break; case 1721: #line 13026 "gram_minimal.y" /* yacc.c:1646 */ { CTECycleClause *n = makeNode(CTECycleClause); n->cycle_col_list = (yyvsp[-8].list); n->cycle_mark_column = (yyvsp[-6].str); n->cycle_mark_value = (yyvsp[-4].node); n->cycle_mark_default = (yyvsp[-2].node); n->cycle_path_column = (yyvsp[0].str); n->location = (yylsp[-9]); (yyval.node) = (Node *) n; } #line 46539 "gram_minimal.c" /* yacc.c:1646 */ break; case 1722: #line 13038 "gram_minimal.y" /* yacc.c:1646 */ { CTECycleClause *n = makeNode(CTECycleClause); n->cycle_col_list = (yyvsp[-4].list); n->cycle_mark_column = (yyvsp[-2].str); n->cycle_mark_value = makeBoolAConst(true, -1); n->cycle_mark_default = makeBoolAConst(false, -1); n->cycle_path_column = (yyvsp[0].str); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 46555 "gram_minimal.c" /* yacc.c:1646 */ break; case 1723: #line 13050 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 46563 "gram_minimal.c" /* yacc.c:1646 */ break; case 1724: #line 13056 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = (yyvsp[0].with); } #line 46569 "gram_minimal.c" /* yacc.c:1646 */ break; case 1725: #line 13057 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = NULL; } #line 46575 "gram_minimal.c" /* yacc.c:1646 */ break; case 1726: #line 13062 "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 46590 "gram_minimal.c" /* yacc.c:1646 */ break; case 1727: #line 13073 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.into) = NULL; } #line 46596 "gram_minimal.c" /* yacc.c:1646 */ break; case 1728: #line 13082 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46605 "gram_minimal.c" /* yacc.c:1646 */ break; case 1729: #line 13087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46614 "gram_minimal.c" /* yacc.c:1646 */ break; case 1730: #line 13092 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46623 "gram_minimal.c" /* yacc.c:1646 */ break; case 1731: #line 13097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 46632 "gram_minimal.c" /* yacc.c:1646 */ break; case 1732: #line 13102 "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 46644 "gram_minimal.c" /* yacc.c:1646 */ break; case 1733: #line 13110 "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 46656 "gram_minimal.c" /* yacc.c:1646 */ break; case 1734: #line 13118 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 46665 "gram_minimal.c" /* yacc.c:1646 */ break; case 1735: #line 13123 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 46674 "gram_minimal.c" /* yacc.c:1646 */ break; case 1736: #line 13128 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 46683 "gram_minimal.c" /* yacc.c:1646 */ break; case 1739: #line 13139 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_ALL; } #line 46689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1740: #line 13140 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_DISTINCT; } #line 46695 "gram_minimal.c" /* yacc.c:1646 */ break; case 1741: #line 13141 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.setquantifier) = SET_QUANTIFIER_DEFAULT; } #line 46701 "gram_minimal.c" /* yacc.c:1646 */ break; case 1742: #line 13148 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(NIL); } #line 46707 "gram_minimal.c" /* yacc.c:1646 */ break; case 1743: #line 13149 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 46713 "gram_minimal.c" /* yacc.c:1646 */ break; case 1746: #line 13158 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46719 "gram_minimal.c" /* yacc.c:1646 */ break; case 1747: #line 13159 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 46725 "gram_minimal.c" /* yacc.c:1646 */ break; case 1748: #line 13163 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46731 "gram_minimal.c" /* yacc.c:1646 */ break; case 1749: #line 13164 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 46737 "gram_minimal.c" /* yacc.c:1646 */ break; case 1750: #line 13168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 46743 "gram_minimal.c" /* yacc.c:1646 */ break; case 1751: #line 13172 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 46749 "gram_minimal.c" /* yacc.c:1646 */ break; case 1752: #line 13173 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 46755 "gram_minimal.c" /* yacc.c:1646 */ break; case 1753: #line 13177 "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 46768 "gram_minimal.c" /* yacc.c:1646 */ break; case 1754: #line 13186 "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 46781 "gram_minimal.c" /* yacc.c:1646 */ break; case 1755: #line 13199 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[-1].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[0].node); } #line 46790 "gram_minimal.c" /* yacc.c:1646 */ break; case 1756: #line 13204 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); ((yyval.selectlimit))->limitOffset = (yyvsp[-1].node); } #line 46799 "gram_minimal.c" /* yacc.c:1646 */ break; case 1757: #line 13209 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 46807 "gram_minimal.c" /* yacc.c:1646 */ break; case 1758: #line 13213 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = (yyvsp[0].node); n->limitCount = NULL; n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 46820 "gram_minimal.c" /* yacc.c:1646 */ break; case 1759: #line 13224 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selectlimit) = (yyvsp[0].selectlimit); } #line 46826 "gram_minimal.c" /* yacc.c:1646 */ break; case 1760: #line 13225 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.selectlimit) = NULL; } #line 46832 "gram_minimal.c" /* yacc.c:1646 */ break; case 1761: #line 13230 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[0].node); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 46845 "gram_minimal.c" /* yacc.c:1646 */ break; case 1762: #line 13239 "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 46858 "gram_minimal.c" /* yacc.c:1646 */ break; case 1763: #line 13255 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-2].node); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 46871 "gram_minimal.c" /* yacc.c:1646 */ break; case 1764: #line 13264 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = (yyvsp[-3].node); n->limitOption = LIMIT_OPTION_WITH_TIES; (yyval.selectlimit) = n; } #line 46884 "gram_minimal.c" /* yacc.c:1646 */ break; case 1765: #line 13273 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_COUNT; (yyval.selectlimit) = n; } #line 46897 "gram_minimal.c" /* yacc.c:1646 */ break; case 1766: #line 13282 "gram_minimal.y" /* yacc.c:1646 */ { SelectLimit *n = (SelectLimit *) palloc(sizeof(SelectLimit)); n->limitOffset = NULL; n->limitCount = makeIntConst(1, -1); n->limitOption = LIMIT_OPTION_WITH_TIES; (yyval.selectlimit) = n; } #line 46910 "gram_minimal.c" /* yacc.c:1646 */ break; case 1767: #line 13294 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46916 "gram_minimal.c" /* yacc.c:1646 */ break; case 1768: #line 13297 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 46922 "gram_minimal.c" /* yacc.c:1646 */ break; case 1769: #line 13301 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46928 "gram_minimal.c" /* yacc.c:1646 */ break; case 1770: #line 13303 "gram_minimal.y" /* yacc.c:1646 */ { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 46937 "gram_minimal.c" /* yacc.c:1646 */ break; case 1771: #line 13310 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46943 "gram_minimal.c" /* yacc.c:1646 */ break; case 1772: #line 13330 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 46949 "gram_minimal.c" /* yacc.c:1646 */ break; case 1773: #line 13332 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 46955 "gram_minimal.c" /* yacc.c:1646 */ break; case 1774: #line 13334 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 46961 "gram_minimal.c" /* yacc.c:1646 */ break; case 1775: #line 13338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 46967 "gram_minimal.c" /* yacc.c:1646 */ break; case 1776: #line 13339 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 46973 "gram_minimal.c" /* yacc.c:1646 */ break; case 1777: #line 13343 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46979 "gram_minimal.c" /* yacc.c:1646 */ break; case 1778: #line 13344 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46985 "gram_minimal.c" /* yacc.c:1646 */ break; case 1779: #line 13347 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46991 "gram_minimal.c" /* yacc.c:1646 */ break; case 1780: #line 13348 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 46997 "gram_minimal.c" /* yacc.c:1646 */ break; case 1781: #line 13374 "gram_minimal.y" /* yacc.c:1646 */ { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = (yyvsp[-1].setquantifier) == SET_QUANTIFIER_DISTINCT; n->list = (yyvsp[0].list); (yyval.groupclause) = n; } #line 47009 "gram_minimal.c" /* yacc.c:1646 */ break; case 1782: #line 13382 "gram_minimal.y" /* yacc.c:1646 */ { GroupClause *n = (GroupClause *) palloc(sizeof(GroupClause)); n->distinct = false; n->list = NIL; (yyval.groupclause) = n; } #line 47021 "gram_minimal.c" /* yacc.c:1646 */ break; case 1783: #line 13392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47027 "gram_minimal.c" /* yacc.c:1646 */ break; case 1784: #line 13393 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 47033 "gram_minimal.c" /* yacc.c:1646 */ break; case 1785: #line 13397 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47039 "gram_minimal.c" /* yacc.c:1646 */ break; case 1786: #line 13398 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47045 "gram_minimal.c" /* yacc.c:1646 */ break; case 1787: #line 13399 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47051 "gram_minimal.c" /* yacc.c:1646 */ break; case 1788: #line 13400 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47057 "gram_minimal.c" /* yacc.c:1646 */ break; case 1789: #line 13401 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47063 "gram_minimal.c" /* yacc.c:1646 */ break; case 1790: #line 13406 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 47071 "gram_minimal.c" /* yacc.c:1646 */ break; case 1791: #line 13419 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 47079 "gram_minimal.c" /* yacc.c:1646 */ break; case 1792: #line 13426 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 47087 "gram_minimal.c" /* yacc.c:1646 */ break; case 1793: #line 13433 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 47095 "gram_minimal.c" /* yacc.c:1646 */ break; case 1794: #line 13439 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47101 "gram_minimal.c" /* yacc.c:1646 */ break; case 1795: #line 13440 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47107 "gram_minimal.c" /* yacc.c:1646 */ break; case 1796: #line 13444 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47113 "gram_minimal.c" /* yacc.c:1646 */ break; case 1797: #line 13445 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47119 "gram_minimal.c" /* yacc.c:1646 */ break; case 1798: #line 13449 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47125 "gram_minimal.c" /* yacc.c:1646 */ break; case 1799: #line 13450 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47131 "gram_minimal.c" /* yacc.c:1646 */ break; case 1800: #line 13454 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47137 "gram_minimal.c" /* yacc.c:1646 */ break; case 1801: #line 13455 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 47143 "gram_minimal.c" /* yacc.c:1646 */ break; case 1802: #line 13460 "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 47156 "gram_minimal.c" /* yacc.c:1646 */ break; case 1803: #line 13471 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORUPDATE; } #line 47162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1804: #line 13472 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 47168 "gram_minimal.c" /* yacc.c:1646 */ break; case 1805: #line 13473 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORSHARE; } #line 47174 "gram_minimal.c" /* yacc.c:1646 */ break; case 1806: #line 13474 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORKEYSHARE; } #line 47180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1807: #line 13478 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1808: #line 13479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47192 "gram_minimal.c" /* yacc.c:1646 */ break; case 1809: #line 13490 "gram_minimal.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 47203 "gram_minimal.c" /* yacc.c:1646 */ break; case 1810: #line 13497 "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 47214 "gram_minimal.c" /* yacc.c:1646 */ break; case 1811: #line 13515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47220 "gram_minimal.c" /* yacc.c:1646 */ break; case 1812: #line 13516 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47226 "gram_minimal.c" /* yacc.c:1646 */ break; case 1813: #line 13520 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47232 "gram_minimal.c" /* yacc.c:1646 */ break; case 1814: #line 13521 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47238 "gram_minimal.c" /* yacc.c:1646 */ break; case 1815: #line 13528 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 47247 "gram_minimal.c" /* yacc.c:1646 */ break; case 1816: #line 13533 "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 47260 "gram_minimal.c" /* yacc.c:1646 */ break; case 1817: #line 13542 "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 47272 "gram_minimal.c" /* yacc.c:1646 */ break; case 1818: #line 13550 "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 47285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1819: #line 13559 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47296 "gram_minimal.c" /* yacc.c:1646 */ break; case 1820: #line 13566 "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 47308 "gram_minimal.c" /* yacc.c:1646 */ break; case 1821: #line 13574 "gram_minimal.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = false; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47321 "gram_minimal.c" /* yacc.c:1646 */ break; case 1822: #line 13583 "gram_minimal.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 47334 "gram_minimal.c" /* yacc.c:1646 */ break; case 1823: #line 13592 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 47342 "gram_minimal.c" /* yacc.c:1646 */ break; case 1824: #line 13596 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 47351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1825: #line 13601 "gram_minimal.y" /* yacc.c:1646 */ { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); (yyval.node) = (Node *) jt; } #line 47362 "gram_minimal.c" /* yacc.c:1646 */ break; case 1826: #line 13608 "gram_minimal.y" /* yacc.c:1646 */ { JsonTable *jt = castNode(JsonTable, (yyvsp[-1].node)); jt->alias = (yyvsp[0].alias); jt->lateral = true; (yyval.node) = (Node *) jt; } #line 47374 "gram_minimal.c" /* yacc.c:1646 */ break; case 1827: #line 13637 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 47382 "gram_minimal.c" /* yacc.c:1646 */ break; case 1828: #line 13641 "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->join_using_alias = NULL; n->quals = NULL; (yyval.jexpr) = n; } #line 47400 "gram_minimal.c" /* yacc.c:1646 */ break; case 1829: #line 13655 "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)) { /* USING clause */ n->usingClause = linitial_node(List, castNode(List, (yyvsp[0].node))); n->join_using_alias = lsecond_node(Alias, castNode(List, (yyvsp[0].node))); } else { /* ON clause */ n->quals = (yyvsp[0].node); } (yyval.jexpr) = n; } #line 47425 "gram_minimal.c" /* yacc.c:1646 */ break; case 1830: #line 13676 "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)) { /* USING clause */ n->usingClause = linitial_node(List, castNode(List, (yyvsp[0].node))); n->join_using_alias = lsecond_node(Alias, castNode(List, (yyvsp[0].node))); } else { /* ON clause */ n->quals = (yyvsp[0].node); } (yyval.jexpr) = n; } #line 47451 "gram_minimal.c" /* yacc.c:1646 */ break; case 1831: #line 13698 "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->join_using_alias = NULL; n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 47468 "gram_minimal.c" /* yacc.c:1646 */ break; case 1832: #line 13711 "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->join_using_alias = NULL; n->quals = NULL; /* fill later */ (yyval.jexpr) = n; } #line 47486 "gram_minimal.c" /* yacc.c:1646 */ break; case 1833: #line 13728 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 47496 "gram_minimal.c" /* yacc.c:1646 */ break; case 1834: #line 13734 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 47505 "gram_minimal.c" /* yacc.c:1646 */ break; case 1835: #line 13739 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 47515 "gram_minimal.c" /* yacc.c:1646 */ break; case 1836: #line 13745 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 47524 "gram_minimal.c" /* yacc.c:1646 */ break; case 1837: #line 13751 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = (yyvsp[0].alias); } #line 47530 "gram_minimal.c" /* yacc.c:1646 */ break; case 1838: #line 13752 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 47536 "gram_minimal.c" /* yacc.c:1646 */ break; case 1839: #line 13763 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); /* the column name list will be inserted later */ } #line 47546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1840: #line 13768 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 47552 "gram_minimal.c" /* yacc.c:1646 */ break; case 1841: #line 13777 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 47560 "gram_minimal.c" /* yacc.c:1646 */ break; case 1842: #line 13781 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 47568 "gram_minimal.c" /* yacc.c:1646 */ break; case 1843: #line 13785 "gram_minimal.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 47579 "gram_minimal.c" /* yacc.c:1646 */ break; case 1844: #line 13792 "gram_minimal.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 47590 "gram_minimal.c" /* yacc.c:1646 */ break; case 1845: #line 13799 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NIL); } #line 47598 "gram_minimal.c" /* yacc.c:1646 */ break; case 1846: #line 13804 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_FULL; } #line 47604 "gram_minimal.c" /* yacc.c:1646 */ break; case 1847: #line 13805 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_LEFT; } #line 47610 "gram_minimal.c" /* yacc.c:1646 */ break; case 1848: #line 13806 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_RIGHT; } #line 47616 "gram_minimal.c" /* yacc.c:1646 */ break; case 1849: #line 13807 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_INNER; } #line 47622 "gram_minimal.c" /* yacc.c:1646 */ break; case 1852: #line 13828 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) list_make2((yyvsp[-2].list), (yyvsp[0].alias)); } #line 47630 "gram_minimal.c" /* yacc.c:1646 */ break; case 1853: #line 13832 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47638 "gram_minimal.c" /* yacc.c:1646 */ break; case 1854: #line 13840 "gram_minimal.y" /* yacc.c:1646 */ { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 47649 "gram_minimal.c" /* yacc.c:1646 */ break; case 1855: #line 13847 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 47657 "gram_minimal.c" /* yacc.c:1646 */ break; case 1856: #line 13854 "gram_minimal.y" /* yacc.c:1646 */ { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 47668 "gram_minimal.c" /* yacc.c:1646 */ break; case 1857: #line 13861 "gram_minimal.y" /* yacc.c:1646 */ { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 47679 "gram_minimal.c" /* yacc.c:1646 */ break; case 1858: #line 13868 "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 47690 "gram_minimal.c" /* yacc.c:1646 */ break; case 1859: #line 13878 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 47696 "gram_minimal.c" /* yacc.c:1646 */ break; case 1860: #line 13879 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 47702 "gram_minimal.c" /* yacc.c:1646 */ break; case 1861: #line 13893 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 47710 "gram_minimal.c" /* yacc.c:1646 */ break; case 1862: #line 13897 "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 47722 "gram_minimal.c" /* yacc.c:1646 */ break; case 1863: #line 13905 "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 47734 "gram_minimal.c" /* yacc.c:1646 */ break; case 1864: #line 13919 "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 47749 "gram_minimal.c" /* yacc.c:1646 */ break; case 1865: #line 13932 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 47755 "gram_minimal.c" /* yacc.c:1646 */ break; case 1866: #line 13933 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47761 "gram_minimal.c" /* yacc.c:1646 */ break; case 1867: #line 13949 "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 47776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1868: #line 13960 "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 47791 "gram_minimal.c" /* yacc.c:1646 */ break; case 1869: #line 13973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 47797 "gram_minimal.c" /* yacc.c:1646 */ break; case 1870: #line 13977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 47803 "gram_minimal.c" /* yacc.c:1646 */ break; case 1871: #line 13978 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 47809 "gram_minimal.c" /* yacc.c:1646 */ break; case 1872: #line 13981 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 47815 "gram_minimal.c" /* yacc.c:1646 */ break; case 1873: #line 13982 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47821 "gram_minimal.c" /* yacc.c:1646 */ break; case 1874: #line 13985 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 47827 "gram_minimal.c" /* yacc.c:1646 */ break; case 1875: #line 13986 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 47833 "gram_minimal.c" /* yacc.c:1646 */ break; case 1876: #line 13991 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47839 "gram_minimal.c" /* yacc.c:1646 */ break; case 1877: #line 13992 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47845 "gram_minimal.c" /* yacc.c:1646 */ break; case 1878: #line 13997 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 47851 "gram_minimal.c" /* yacc.c:1646 */ break; case 1879: #line 13999 "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 47864 "gram_minimal.c" /* yacc.c:1646 */ break; case 1880: #line 14007 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 47870 "gram_minimal.c" /* yacc.c:1646 */ break; case 1881: #line 14012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 47876 "gram_minimal.c" /* yacc.c:1646 */ break; case 1882: #line 14013 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 47882 "gram_minimal.c" /* yacc.c:1646 */ break; case 1883: #line 14018 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47890 "gram_minimal.c" /* yacc.c:1646 */ break; case 1884: #line 14022 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47898 "gram_minimal.c" /* yacc.c:1646 */ break; case 1885: #line 14028 "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 47921 "gram_minimal.c" /* yacc.c:1646 */ break; case 1886: #line 14053 "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 47936 "gram_minimal.c" /* yacc.c:1646 */ break; case 1887: #line 14065 "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 47951 "gram_minimal.c" /* yacc.c:1646 */ break; case 1888: #line 14077 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 47957 "gram_minimal.c" /* yacc.c:1646 */ break; case 1889: #line 14078 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 47963 "gram_minimal.c" /* yacc.c:1646 */ break; case 1890: #line 14083 "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 47981 "gram_minimal.c" /* yacc.c:1646 */ break; case 1891: #line 14097 "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 = boolVal(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 48042 "gram_minimal.c" /* yacc.c:1646 */ break; case 1892: #line 14154 "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 48057 "gram_minimal.c" /* yacc.c:1646 */ break; case 1893: #line 14168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 48063 "gram_minimal.c" /* yacc.c:1646 */ break; case 1894: #line 14170 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 48069 "gram_minimal.c" /* yacc.c:1646 */ break; case 1895: #line 14175 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 48075 "gram_minimal.c" /* yacc.c:1646 */ break; case 1896: #line 14177 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 48081 "gram_minimal.c" /* yacc.c:1646 */ break; case 1897: #line 14179 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeBoolean(true), (yylsp[-1])); } #line 48087 "gram_minimal.c" /* yacc.c:1646 */ break; case 1898: #line 14181 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeBoolean(false), (yylsp[0])); } #line 48093 "gram_minimal.c" /* yacc.c:1646 */ break; case 1899: #line 14183 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("path", (yyvsp[0].node), (yylsp[-1])); } #line 48099 "gram_minimal.c" /* yacc.c:1646 */ break; case 1900: #line 14188 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 48105 "gram_minimal.c" /* yacc.c:1646 */ break; case 1901: #line 14190 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 48111 "gram_minimal.c" /* yacc.c:1646 */ break; case 1902: #line 14195 "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 48123 "gram_minimal.c" /* yacc.c:1646 */ break; case 1903: #line 14203 "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 48135 "gram_minimal.c" /* yacc.c:1646 */ break; case 1904: #line 14219 "gram_minimal.y" /* yacc.c:1646 */ { JsonTable *n = makeNode(JsonTable); char *pathstring; n->context_item = (JsonValueExpr *) (yyvsp[-10].node); if (!IsA((yyvsp[-8].node), A_Const) || castNode(A_Const, (yyvsp[-8].node))->val.node.type != T_String) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("only string constants are supported in JSON_TABLE path specification"), parser_errposition((yylsp[-8])))); pathstring = castNode(A_Const, (yyvsp[-8].node))->val.sval.sval; n->pathspec = makeJsonTablePathSpec(pathstring, (yyvsp[-7].str), (yylsp[-8]), (yylsp[-7])); n->passing = (yyvsp[-6].list); n->columns = (yyvsp[-3].list); n->on_error = (JsonBehavior *) (yyvsp[-1].node); n->location = (yylsp[-12]); (yyval.node) = (Node *) n; } #line 48159 "gram_minimal.c" /* yacc.c:1646 */ break; case 1905: #line 14241 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 48165 "gram_minimal.c" /* yacc.c:1646 */ break; case 1906: #line 14242 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 48171 "gram_minimal.c" /* yacc.c:1646 */ break; case 1907: #line 14247 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 48177 "gram_minimal.c" /* yacc.c:1646 */ break; case 1908: #line 14249 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 48183 "gram_minimal.c" /* yacc.c:1646 */ break; case 1909: #line 14254 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FOR_ORDINALITY; n->name = (yyvsp[-2].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 48196 "gram_minimal.c" /* yacc.c:1646 */ break; case 1910: #line 14267 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_REGULAR; n->name = (yyvsp[-5].str); n->typeName = (yyvsp[-4].typnam); n->format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); n->pathspec = (JsonTablePathSpec *) (yyvsp[-3].node); n->wrapper = (yyvsp[-2].ival); n->quotes = (yyvsp[-1].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[0].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[0].list)); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 48216 "gram_minimal.c" /* yacc.c:1646 */ break; case 1911: #line 14287 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_FORMATTED; n->name = (yyvsp[-6].str); n->typeName = (yyvsp[-5].typnam); n->format = (JsonFormat *) (yyvsp[-4].node); n->pathspec = (JsonTablePathSpec *) (yyvsp[-3].node); n->wrapper = (yyvsp[-2].ival); n->quotes = (yyvsp[-1].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[0].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[0].list)); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 48236 "gram_minimal.c" /* yacc.c:1646 */ break; case 1912: #line 14305 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_EXISTS; n->name = (yyvsp[-4].str); n->typeName = (yyvsp[-3].typnam); n->format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); n->wrapper = JSW_NONE; n->quotes = JS_QUOTES_UNSPEC; n->pathspec = (JsonTablePathSpec *) (yyvsp[-1].node); n->on_empty = NULL; n->on_error = (JsonBehavior *) (yyvsp[0].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 48256 "gram_minimal.c" /* yacc.c:1646 */ break; case 1913: #line 14322 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_NESTED; n->pathspec = (JsonTablePathSpec *) makeJsonTablePathSpec((yyvsp[-4].str), NULL, (yylsp[-4]), -1); n->columns = (yyvsp[-1].list); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 48271 "gram_minimal.c" /* yacc.c:1646 */ break; case 1914: #line 14334 "gram_minimal.y" /* yacc.c:1646 */ { JsonTableColumn *n = makeNode(JsonTableColumn); n->coltype = JTC_NESTED; n->pathspec = (JsonTablePathSpec *) makeJsonTablePathSpec((yyvsp[-6].str), (yyvsp[-4].str), (yylsp[-6]), (yylsp[-4])); n->columns = (yyvsp[-1].list); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 48286 "gram_minimal.c" /* yacc.c:1646 */ break; case 1917: #line 14353 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonTablePathSpec((yyvsp[0].str), NULL, (yylsp[0]), -1); } #line 48292 "gram_minimal.c" /* yacc.c:1646 */ break; case 1918: #line 14355 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 48298 "gram_minimal.c" /* yacc.c:1646 */ break; case 1919: #line 14369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 48307 "gram_minimal.c" /* yacc.c:1646 */ break; case 1920: #line 14374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 48317 "gram_minimal.c" /* yacc.c:1646 */ break; case 1921: #line 14381 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 48326 "gram_minimal.c" /* yacc.c:1646 */ break; case 1922: #line 14386 "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 48336 "gram_minimal.c" /* yacc.c:1646 */ break; case 1923: #line 14392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 48345 "gram_minimal.c" /* yacc.c:1646 */ break; case 1924: #line 14397 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 48355 "gram_minimal.c" /* yacc.c:1646 */ break; case 1925: #line 14406 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 48361 "gram_minimal.c" /* yacc.c:1646 */ break; case 1926: #line 14408 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 48367 "gram_minimal.c" /* yacc.c:1646 */ break; case 1927: #line 14410 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48373 "gram_minimal.c" /* yacc.c:1646 */ break; case 1928: #line 14414 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48379 "gram_minimal.c" /* yacc.c:1646 */ break; case 1929: #line 14415 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48385 "gram_minimal.c" /* yacc.c:1646 */ break; case 1930: #line 14416 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48391 "gram_minimal.c" /* yacc.c:1646 */ break; case 1931: #line 14417 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48397 "gram_minimal.c" /* yacc.c:1646 */ break; case 1932: #line 14418 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48403 "gram_minimal.c" /* yacc.c:1646 */ break; case 1933: #line 14420 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 48412 "gram_minimal.c" /* yacc.c:1646 */ break; case 1934: #line 14425 "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 48422 "gram_minimal.c" /* yacc.c:1646 */ break; case 1935: #line 14430 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48428 "gram_minimal.c" /* yacc.c:1646 */ break; case 1936: #line 14445 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48434 "gram_minimal.c" /* yacc.c:1646 */ break; case 1937: #line 14446 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48440 "gram_minimal.c" /* yacc.c:1646 */ break; case 1938: #line 14447 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1939: #line 14448 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48452 "gram_minimal.c" /* yacc.c:1646 */ break; case 1940: #line 14449 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48458 "gram_minimal.c" /* yacc.c:1646 */ break; case 1941: #line 14461 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48468 "gram_minimal.c" /* yacc.c:1646 */ break; case 1942: #line 14467 "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 48478 "gram_minimal.c" /* yacc.c:1646 */ break; case 1943: #line 14474 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 48484 "gram_minimal.c" /* yacc.c:1646 */ break; case 1944: #line 14475 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48490 "gram_minimal.c" /* yacc.c:1646 */ break; case 1945: #line 14482 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 48499 "gram_minimal.c" /* yacc.c:1646 */ break; case 1946: #line 14487 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 48508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1947: #line 14492 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 48517 "gram_minimal.c" /* yacc.c:1646 */ break; case 1948: #line 14497 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 48526 "gram_minimal.c" /* yacc.c:1646 */ break; case 1949: #line 14502 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 48535 "gram_minimal.c" /* yacc.c:1646 */ break; case 1950: #line 14507 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 48544 "gram_minimal.c" /* yacc.c:1646 */ break; case 1951: #line 14512 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 48553 "gram_minimal.c" /* yacc.c:1646 */ break; case 1952: #line 14517 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48563 "gram_minimal.c" /* yacc.c:1646 */ break; case 1953: #line 14523 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48573 "gram_minimal.c" /* yacc.c:1646 */ break; case 1954: #line 14529 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 48583 "gram_minimal.c" /* yacc.c:1646 */ break; case 1955: #line 14535 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 48592 "gram_minimal.c" /* yacc.c:1646 */ break; case 1956: #line 14542 "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 48617 "gram_minimal.c" /* yacc.c:1646 */ break; case 1957: #line 14563 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); } #line 48625 "gram_minimal.c" /* yacc.c:1646 */ break; case 1958: #line 14573 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48633 "gram_minimal.c" /* yacc.c:1646 */ break; case 1959: #line 14577 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48641 "gram_minimal.c" /* yacc.c:1646 */ break; case 1960: #line 14585 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48649 "gram_minimal.c" /* yacc.c:1646 */ break; case 1961: #line 14589 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 48658 "gram_minimal.c" /* yacc.c:1646 */ break; case 1962: #line 14597 "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 48671 "gram_minimal.c" /* yacc.c:1646 */ break; case 1963: #line 14609 "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 48689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1964: #line 14630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48697 "gram_minimal.c" /* yacc.c:1646 */ break; case 1965: #line 14634 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48705 "gram_minimal.c" /* yacc.c:1646 */ break; case 1966: #line 14640 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 48713 "gram_minimal.c" /* yacc.c:1646 */ break; case 1967: #line 14644 "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 48728 "gram_minimal.c" /* yacc.c:1646 */ break; case 1968: #line 14657 "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 48738 "gram_minimal.c" /* yacc.c:1646 */ break; case 1969: #line 14665 "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 48750 "gram_minimal.c" /* yacc.c:1646 */ break; case 1970: #line 14675 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48756 "gram_minimal.c" /* yacc.c:1646 */ break; case 1971: #line 14677 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48762 "gram_minimal.c" /* yacc.c:1646 */ break; case 1972: #line 14679 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "varchar"; } #line 48768 "gram_minimal.c" /* yacc.c:1646 */ break; case 1973: #line 14681 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48774 "gram_minimal.c" /* yacc.c:1646 */ break; case 1974: #line 14683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48780 "gram_minimal.c" /* yacc.c:1646 */ break; case 1975: #line 14685 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 48786 "gram_minimal.c" /* yacc.c:1646 */ break; case 1976: #line 14689 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 48792 "gram_minimal.c" /* yacc.c:1646 */ break; case 1977: #line 14690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 48798 "gram_minimal.c" /* yacc.c:1646 */ break; case 1978: #line 14698 "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 48811 "gram_minimal.c" /* yacc.c:1646 */ break; case 1979: #line 14707 "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 48823 "gram_minimal.c" /* yacc.c:1646 */ break; case 1980: #line 14715 "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 48836 "gram_minimal.c" /* yacc.c:1646 */ break; case 1981: #line 14724 "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 48848 "gram_minimal.c" /* yacc.c:1646 */ break; case 1982: #line 14735 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 48857 "gram_minimal.c" /* yacc.c:1646 */ break; case 1983: #line 14742 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 48863 "gram_minimal.c" /* yacc.c:1646 */ break; case 1984: #line 14743 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 48869 "gram_minimal.c" /* yacc.c:1646 */ break; case 1985: #line 14744 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 48875 "gram_minimal.c" /* yacc.c:1646 */ break; case 1986: #line 14749 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 48881 "gram_minimal.c" /* yacc.c:1646 */ break; case 1987: #line 14751 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 48887 "gram_minimal.c" /* yacc.c:1646 */ break; case 1988: #line 14753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 48893 "gram_minimal.c" /* yacc.c:1646 */ break; case 1989: #line 14755 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 48899 "gram_minimal.c" /* yacc.c:1646 */ break; case 1990: #line 14757 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 48905 "gram_minimal.c" /* yacc.c:1646 */ break; case 1991: #line 14759 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 48911 "gram_minimal.c" /* yacc.c:1646 */ break; case 1992: #line 14761 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 48920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1993: #line 14766 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 48929 "gram_minimal.c" /* yacc.c:1646 */ break; case 1994: #line 14771 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 48939 "gram_minimal.c" /* yacc.c:1646 */ break; case 1995: #line 14777 "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 48951 "gram_minimal.c" /* yacc.c:1646 */ break; case 1996: #line 14785 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 48960 "gram_minimal.c" /* yacc.c:1646 */ break; case 1997: #line 14790 "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 48971 "gram_minimal.c" /* yacc.c:1646 */ break; case 1998: #line 14797 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 48981 "gram_minimal.c" /* yacc.c:1646 */ break; case 1999: #line 14803 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 48987 "gram_minimal.c" /* yacc.c:1646 */ break; case 2000: #line 14808 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 48995 "gram_minimal.c" /* yacc.c:1646 */ break; case 2001: #line 14812 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 49004 "gram_minimal.c" /* yacc.c:1646 */ break; case 2002: #line 14820 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("json"); (yyval.typnam)->location = (yylsp[0]); } #line 49013 "gram_minimal.c" /* yacc.c:1646 */ break; case 2003: #line 14854 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49019 "gram_minimal.c" /* yacc.c:1646 */ break; case 2004: #line 14856 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 49025 "gram_minimal.c" /* yacc.c:1646 */ break; case 2005: #line 14858 "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 49038 "gram_minimal.c" /* yacc.c:1646 */ break; case 2006: #line 14867 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 49049 "gram_minimal.c" /* yacc.c:1646 */ break; case 2007: #line 14874 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, -1); } #line 49060 "gram_minimal.c" /* yacc.c:1646 */ break; case 2008: #line 14890 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49066 "gram_minimal.c" /* yacc.c:1646 */ break; case 2009: #line 14892 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 49072 "gram_minimal.c" /* yacc.c:1646 */ break; case 2010: #line 14894 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49078 "gram_minimal.c" /* yacc.c:1646 */ break; case 2011: #line 14896 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49084 "gram_minimal.c" /* yacc.c:1646 */ break; case 2012: #line 14898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49090 "gram_minimal.c" /* yacc.c:1646 */ break; case 2013: #line 14900 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49096 "gram_minimal.c" /* yacc.c:1646 */ break; case 2014: #line 14902 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49102 "gram_minimal.c" /* yacc.c:1646 */ break; case 2015: #line 14904 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49108 "gram_minimal.c" /* yacc.c:1646 */ break; case 2016: #line 14906 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49114 "gram_minimal.c" /* yacc.c:1646 */ break; case 2017: #line 14908 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49120 "gram_minimal.c" /* yacc.c:1646 */ break; case 2018: #line 14910 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49126 "gram_minimal.c" /* yacc.c:1646 */ break; case 2019: #line 14912 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49132 "gram_minimal.c" /* yacc.c:1646 */ break; case 2020: #line 14914 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49138 "gram_minimal.c" /* yacc.c:1646 */ break; case 2021: #line 14916 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49144 "gram_minimal.c" /* yacc.c:1646 */ break; case 2022: #line 14919 "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 49150 "gram_minimal.c" /* yacc.c:1646 */ break; case 2023: #line 14921 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49156 "gram_minimal.c" /* yacc.c:1646 */ break; case 2024: #line 14924 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49162 "gram_minimal.c" /* yacc.c:1646 */ break; case 2025: #line 14926 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49168 "gram_minimal.c" /* yacc.c:1646 */ break; case 2026: #line 14928 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 49174 "gram_minimal.c" /* yacc.c:1646 */ break; case 2027: #line 14930 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 49180 "gram_minimal.c" /* yacc.c:1646 */ break; case 2028: #line 14933 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49189 "gram_minimal.c" /* yacc.c:1646 */ break; case 2029: #line 14938 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49202 "gram_minimal.c" /* yacc.c:1646 */ break; case 2030: #line 14947 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 49211 "gram_minimal.c" /* yacc.c:1646 */ break; case 2031: #line 14952 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49224 "gram_minimal.c" /* yacc.c:1646 */ break; case 2032: #line 14961 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49233 "gram_minimal.c" /* yacc.c:1646 */ break; case 2033: #line 14966 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49246 "gram_minimal.c" /* yacc.c:1646 */ break; case 2034: #line 14975 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 49255 "gram_minimal.c" /* yacc.c:1646 */ break; case 2035: #line 14980 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("like_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49268 "gram_minimal.c" /* yacc.c:1646 */ break; case 2036: #line 14990 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make1((yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-2])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "~", (yyvsp[-3].node), (Node *) n, (yylsp[-2])); } #line 49281 "gram_minimal.c" /* yacc.c:1646 */ break; case 2037: #line 14999 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-4])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 49294 "gram_minimal.c" /* yacc.c:1646 */ break; case 2038: #line 15008 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make1((yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-3])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "!~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 49307 "gram_minimal.c" /* yacc.c:1646 */ break; case 2039: #line 15017 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"), list_make2((yyvsp[-2].node), (yyvsp[0].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_SIMILAR, "!~", (yyvsp[-6].node), (Node *) n, (yylsp[-5])); } #line 49320 "gram_minimal.c" /* yacc.c:1646 */ break; case 2040: #line 15036 "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 49333 "gram_minimal.c" /* yacc.c:1646 */ break; case 2041: #line 15045 "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 49346 "gram_minimal.c" /* yacc.c:1646 */ break; case 2042: #line 15054 "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 49359 "gram_minimal.c" /* yacc.c:1646 */ break; case 2043: #line 15063 "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 49372 "gram_minimal.c" /* yacc.c:1646 */ break; case 2044: #line 15072 "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)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 49393 "gram_minimal.c" /* yacc.c:1646 */ break; case 2045: #line 15089 "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 49406 "gram_minimal.c" /* yacc.c:1646 */ break; case 2046: #line 15098 "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 49419 "gram_minimal.c" /* yacc.c:1646 */ break; case 2047: #line 15107 "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 49432 "gram_minimal.c" /* yacc.c:1646 */ break; case 2048: #line 15116 "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 49445 "gram_minimal.c" /* yacc.c:1646 */ break; case 2049: #line 15125 "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 49458 "gram_minimal.c" /* yacc.c:1646 */ break; case 2050: #line 15134 "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 49471 "gram_minimal.c" /* yacc.c:1646 */ break; case 2051: #line 15143 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 49479 "gram_minimal.c" /* yacc.c:1646 */ break; case 2052: #line 15147 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 49487 "gram_minimal.c" /* yacc.c:1646 */ break; case 2053: #line 15151 "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 49499 "gram_minimal.c" /* yacc.c:1646 */ break; case 2054: #line 15159 "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 49511 "gram_minimal.c" /* yacc.c:1646 */ break; case 2055: #line 15167 "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 49523 "gram_minimal.c" /* yacc.c:1646 */ break; case 2056: #line 15175 "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 49535 "gram_minimal.c" /* yacc.c:1646 */ break; case 2057: #line 15183 "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 49560 "gram_minimal.c" /* yacc.c:1646 */ break; case 2058: #line 15204 "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 49587 "gram_minimal.c" /* yacc.c:1646 */ break; case 2059: #line 15227 "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 49603 "gram_minimal.c" /* yacc.c:1646 */ break; case 2060: #line 15239 "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 49614 "gram_minimal.c" /* yacc.c:1646 */ break; case 2061: #line 15246 "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[-2])))); } #line 49634 "gram_minimal.c" /* yacc.c:1646 */ break; case 2062: #line 15262 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 49643 "gram_minimal.c" /* yacc.c:1646 */ break; case 2063: #line 15267 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 49653 "gram_minimal.c" /* yacc.c:1646 */ break; case 2064: #line 15273 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-2].node)), COERCE_SQL_SYNTAX, (yylsp[-1])); } #line 49664 "gram_minimal.c" /* yacc.c:1646 */ break; case 2065: #line 15280 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-2])); } #line 49675 "gram_minimal.c" /* yacc.c:1646 */ break; case 2066: #line 15287 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make1((yyvsp[-3].node)), COERCE_SQL_SYNTAX, (yylsp[-2])), (yylsp[-2])); } #line 49687 "gram_minimal.c" /* yacc.c:1646 */ break; case 2067: #line 15295 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"), list_make2((yyvsp[-4].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-3])), (yylsp[-3])); } #line 49699 "gram_minimal.c" /* yacc.c:1646 */ break; case 2068: #line 15304 "gram_minimal.y" /* yacc.c:1646 */ { JsonFormat *format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); (yyval.node) = makeJsonIsPredicate((yyvsp[-3].node), format, (yyvsp[-1].ival), (yyvsp[0].boolean), (yylsp[-3])); } #line 49709 "gram_minimal.c" /* yacc.c:1646 */ break; case 2069: #line 15322 "gram_minimal.y" /* yacc.c:1646 */ { JsonFormat *format = makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); (yyval.node) = makeNotExpr(makeJsonIsPredicate((yyvsp[-4].node), format, (yyvsp[-1].ival), (yyvsp[0].boolean), (yylsp[-4])), (yylsp[-4])); } #line 49719 "gram_minimal.c" /* yacc.c:1646 */ break; case 2070: #line 15339 "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 49738 "gram_minimal.c" /* yacc.c:1646 */ break; case 2071: #line 15365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49744 "gram_minimal.c" /* yacc.c:1646 */ break; case 2072: #line 15367 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 49750 "gram_minimal.c" /* yacc.c:1646 */ break; case 2073: #line 15369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49756 "gram_minimal.c" /* yacc.c:1646 */ break; case 2074: #line 15371 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 49762 "gram_minimal.c" /* yacc.c:1646 */ break; case 2075: #line 15373 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49768 "gram_minimal.c" /* yacc.c:1646 */ break; case 2076: #line 15375 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49774 "gram_minimal.c" /* yacc.c:1646 */ break; case 2077: #line 15377 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49780 "gram_minimal.c" /* yacc.c:1646 */ break; case 2078: #line 15379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49786 "gram_minimal.c" /* yacc.c:1646 */ break; case 2079: #line 15381 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49792 "gram_minimal.c" /* yacc.c:1646 */ break; case 2080: #line 15383 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49798 "gram_minimal.c" /* yacc.c:1646 */ break; case 2081: #line 15385 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49804 "gram_minimal.c" /* yacc.c:1646 */ break; case 2082: #line 15387 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49810 "gram_minimal.c" /* yacc.c:1646 */ break; case 2083: #line 15389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49816 "gram_minimal.c" /* yacc.c:1646 */ break; case 2084: #line 15391 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49822 "gram_minimal.c" /* yacc.c:1646 */ break; case 2085: #line 15393 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49828 "gram_minimal.c" /* yacc.c:1646 */ break; case 2086: #line 15395 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 49834 "gram_minimal.c" /* yacc.c:1646 */ break; case 2087: #line 15397 "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 49840 "gram_minimal.c" /* yacc.c:1646 */ break; case 2088: #line 15399 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 49846 "gram_minimal.c" /* yacc.c:1646 */ break; case 2089: #line 15401 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 49854 "gram_minimal.c" /* yacc.c:1646 */ break; case 2090: #line 15405 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 49862 "gram_minimal.c" /* yacc.c:1646 */ break; case 2091: #line 15409 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 49871 "gram_minimal.c" /* yacc.c:1646 */ break; case 2092: #line 15414 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 49881 "gram_minimal.c" /* yacc.c:1646 */ break; case 2093: #line 15429 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49887 "gram_minimal.c" /* yacc.c:1646 */ break; case 2094: #line 15430 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49893 "gram_minimal.c" /* yacc.c:1646 */ break; case 2095: #line 15432 "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 49914 "gram_minimal.c" /* yacc.c:1646 */ break; case 2096: #line 15449 "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 (yyval.node) = (yyvsp[-2].node); } #line 49931 "gram_minimal.c" /* yacc.c:1646 */ break; case 2097: #line 15462 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49937 "gram_minimal.c" /* yacc.c:1646 */ break; case 2098: #line 15464 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 49943 "gram_minimal.c" /* yacc.c:1646 */ break; case 2099: #line 15466 "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 49959 "gram_minimal.c" /* yacc.c:1646 */ break; case 2100: #line 15478 "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 49988 "gram_minimal.c" /* yacc.c:1646 */ break; case 2101: #line 15503 "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 50004 "gram_minimal.c" /* yacc.c:1646 */ break; case 2102: #line 15515 "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 50020 "gram_minimal.c" /* yacc.c:1646 */ break; case 2103: #line 15527 "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 50032 "gram_minimal.c" /* yacc.c:1646 */ break; case 2104: #line 15535 "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 50047 "gram_minimal.c" /* yacc.c:1646 */ break; case 2105: #line 15546 "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 50062 "gram_minimal.c" /* yacc.c:1646 */ break; case 2106: #line 15557 "gram_minimal.y" /* yacc.c:1646 */ { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *) g; } #line 50074 "gram_minimal.c" /* yacc.c:1646 */ break; case 2107: #line 15567 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, COERCE_EXPLICIT_CALL, (yylsp[-2])); } #line 50084 "gram_minimal.c" /* yacc.c:1646 */ break; case 2108: #line 15573 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-4].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (yylsp[-4])); n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50097 "gram_minimal.c" /* yacc.c:1646 */ break; case 2109: #line 15582 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), list_make1((yyvsp[-2].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); n->func_variadic = true; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50111 "gram_minimal.c" /* yacc.c:1646 */ break; case 2110: #line 15592 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-7].list), lappend((yyvsp[-5].list), (yyvsp[-2].node)), COERCE_EXPLICIT_CALL, (yylsp[-7])); n->func_variadic = true; n->agg_order = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 50125 "gram_minimal.c" /* yacc.c:1646 */ break; case 2111: #line 15602 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (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 50142 "gram_minimal.c" /* yacc.c:1646 */ break; case 2112: #line 15615 "gram_minimal.y" /* yacc.c:1646 */ { FuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-2].list), COERCE_EXPLICIT_CALL, (yylsp[-5])); n->agg_order = (yyvsp[-1].list); n->agg_distinct = true; (yyval.node) = (Node *) n; } #line 50156 "gram_minimal.c" /* yacc.c:1646 */ break; case 2113: #line 15625 "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, COERCE_EXPLICIT_CALL, (yylsp[-3])); n->agg_star = true; (yyval.node) = (Node *) n; } #line 50179 "gram_minimal.c" /* yacc.c:1646 */ break; case 2114: #line 15656 "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 50219 "gram_minimal.c" /* yacc.c:1646 */ break; case 2115: #line 15692 "gram_minimal.y" /* yacc.c:1646 */ { JsonAggConstructor *n = IsA((yyvsp[-2].node), JsonObjectAgg) ? ((JsonObjectAgg *) (yyvsp[-2].node))->constructor : ((JsonArrayAgg *) (yyvsp[-2].node))->constructor; n->agg_filter = (yyvsp[-1].node); n->over = (yyvsp[0].windef); (yyval.node) = (Node *) (yyvsp[-2].node); } #line 50233 "gram_minimal.c" /* yacc.c:1646 */ break; case 2116: #line 15702 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50239 "gram_minimal.c" /* yacc.c:1646 */ break; case 2117: #line 15712 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50245 "gram_minimal.c" /* yacc.c:1646 */ break; case 2118: #line 15713 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50251 "gram_minimal.c" /* yacc.c:1646 */ break; case 2119: #line 15714 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50257 "gram_minimal.c" /* yacc.c:1646 */ break; case 2120: #line 15722 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50268 "gram_minimal.c" /* yacc.c:1646 */ break; case 2121: #line 15729 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 50276 "gram_minimal.c" /* yacc.c:1646 */ break; case 2122: #line 15733 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 50284 "gram_minimal.c" /* yacc.c:1646 */ break; case 2123: #line 15737 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50292 "gram_minimal.c" /* yacc.c:1646 */ break; case 2124: #line 15741 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 50300 "gram_minimal.c" /* yacc.c:1646 */ break; case 2125: #line 15745 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50308 "gram_minimal.c" /* yacc.c:1646 */ break; case 2126: #line 15749 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 50316 "gram_minimal.c" /* yacc.c:1646 */ break; case 2127: #line 15753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50324 "gram_minimal.c" /* yacc.c:1646 */ break; case 2128: #line 15757 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 50332 "gram_minimal.c" /* yacc.c:1646 */ break; case 2129: #line 15761 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 50340 "gram_minimal.c" /* yacc.c:1646 */ break; case 2130: #line 15765 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 50348 "gram_minimal.c" /* yacc.c:1646 */ break; case 2131: #line 15769 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 50356 "gram_minimal.c" /* yacc.c:1646 */ break; case 2132: #line 15773 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 50364 "gram_minimal.c" /* yacc.c:1646 */ break; case 2133: #line 15777 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("system_user"), NIL, COERCE_SQL_SYNTAX, (yylsp[0])); } #line 50375 "gram_minimal.c" /* yacc.c:1646 */ break; case 2134: #line 15784 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 50383 "gram_minimal.c" /* yacc.c:1646 */ break; case 2135: #line 15788 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 50391 "gram_minimal.c" /* yacc.c:1646 */ break; case 2136: #line 15792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 50399 "gram_minimal.c" /* yacc.c:1646 */ break; case 2137: #line 15796 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 50405 "gram_minimal.c" /* yacc.c:1646 */ break; case 2138: #line 15798 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("extract"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50416 "gram_minimal.c" /* yacc.c:1646 */ break; case 2139: #line 15805 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make1((yyvsp[-1].node)), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50427 "gram_minimal.c" /* yacc.c:1646 */ break; case 2140: #line 15812 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("normalize"), list_make2((yyvsp[-3].node), makeStringConst((yyvsp[-1].str), (yylsp[-1]))), COERCE_SQL_SYNTAX, (yylsp[-5])); } #line 50438 "gram_minimal.c" /* yacc.c:1646 */ break; case 2141: #line 15819 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50449 "gram_minimal.c" /* yacc.c:1646 */ break; case 2142: #line 15826 "gram_minimal.y" /* yacc.c:1646 */ { /* * allow functions named overlay() to be called without * special syntax */ (yyval.node) = (Node *) makeFuncCall(list_make1(makeString("overlay")), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50464 "gram_minimal.c" /* yacc.c:1646 */ break; case 2143: #line 15837 "gram_minimal.y" /* yacc.c:1646 */ { /* * position(A in B) is converted to position(B, A) * * We deliberately don't offer a "plain syntax" option * for position(), because the reversal of the arguments * creates too much risk of confusion. */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("position"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50482 "gram_minimal.c" /* yacc.c:1646 */ break; case 2144: #line 15851 "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), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50496 "gram_minimal.c" /* yacc.c:1646 */ break; case 2145: #line 15861 "gram_minimal.y" /* yacc.c:1646 */ { /* * allow functions named substring() to be called without * special syntax */ (yyval.node) = (Node *) makeFuncCall(list_make1(makeString("substring")), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50511 "gram_minimal.c" /* yacc.c:1646 */ break; case 2146: #line 15872 "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(strVal(llast((yyvsp[-1].typnam)->names))), list_make1((yyvsp[-3].node)), COERCE_EXPLICIT_CALL, (yylsp[-5])); } #line 50531 "gram_minimal.c" /* yacc.c:1646 */ break; case 2147: #line 15888 "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), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50545 "gram_minimal.c" /* yacc.c:1646 */ break; case 2148: #line 15898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50556 "gram_minimal.c" /* yacc.c:1646 */ break; case 2149: #line 15905 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50567 "gram_minimal.c" /* yacc.c:1646 */ break; case 2150: #line 15912 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), COERCE_SQL_SYNTAX, (yylsp[-3])); } #line 50578 "gram_minimal.c" /* yacc.c:1646 */ break; case 2151: #line 15919 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 50586 "gram_minimal.c" /* yacc.c:1646 */ break; case 2152: #line 15923 "gram_minimal.y" /* yacc.c:1646 */ { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *) c; } #line 50598 "gram_minimal.c" /* yacc.c:1646 */ break; case 2153: #line 15931 "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 50611 "gram_minimal.c" /* yacc.c:1646 */ break; case 2154: #line 15940 "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 50624 "gram_minimal.c" /* yacc.c:1646 */ break; case 2155: #line 15949 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 50632 "gram_minimal.c" /* yacc.c:1646 */ break; case 2156: #line 15953 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 50640 "gram_minimal.c" /* yacc.c:1646 */ break; case 2157: #line 15957 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 50648 "gram_minimal.c" /* yacc.c:1646 */ break; case 2158: #line 15961 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 50656 "gram_minimal.c" /* yacc.c:1646 */ break; case 2159: #line 15965 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 50664 "gram_minimal.c" /* yacc.c:1646 */ break; case 2160: #line 15969 "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)), COERCE_SQL_SYNTAX, (yylsp[-4])); } #line 50677 "gram_minimal.c" /* yacc.c:1646 */ break; case 2161: #line 15978 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 50685 "gram_minimal.c" /* yacc.c:1646 */ break; case 2162: #line 15982 "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 50699 "gram_minimal.c" /* yacc.c:1646 */ break; case 2163: #line 15992 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 50707 "gram_minimal.c" /* yacc.c:1646 */ break; case 2164: #line 15996 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 50715 "gram_minimal.c" /* yacc.c:1646 */ break; case 2165: #line 16000 "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 50724 "gram_minimal.c" /* yacc.c:1646 */ break; case 2166: #line 16005 "gram_minimal.y" /* yacc.c:1646 */ { XmlSerialize *n = makeNode(XmlSerialize); n->xmloption = (yyvsp[-5].ival); n->expr = (yyvsp[-4].node); n->typeName = (yyvsp[-2].typnam); n->indent = (yyvsp[-1].boolean); n->location = (yylsp[-7]); (yyval.node) = (Node *) n; } #line 50739 "gram_minimal.c" /* yacc.c:1646 */ break; case 2167: #line 16016 "gram_minimal.y" /* yacc.c:1646 */ { /* Support for legacy (non-standard) json_object() */ (yyval.node) = (Node *) makeFuncCall(SystemFuncName("json_object"), (yyvsp[-1].list), COERCE_EXPLICIT_CALL, (yylsp[-3])); } #line 50749 "gram_minimal.c" /* yacc.c:1646 */ break; case 2168: #line 16025 "gram_minimal.y" /* yacc.c:1646 */ { JsonObjectConstructor *n = makeNode(JsonObjectConstructor); n->exprs = (yyvsp[-4].list); n->absent_on_null = (yyvsp[-3].boolean); n->unique = (yyvsp[-2].boolean); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 50764 "gram_minimal.c" /* yacc.c:1646 */ break; case 2169: #line 16036 "gram_minimal.y" /* yacc.c:1646 */ { JsonObjectConstructor *n = makeNode(JsonObjectConstructor); n->exprs = NULL; n->absent_on_null = false; n->unique = false; n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 50779 "gram_minimal.c" /* yacc.c:1646 */ break; case 2170: #line 16051 "gram_minimal.y" /* yacc.c:1646 */ { JsonArrayConstructor *n = makeNode(JsonArrayConstructor); n->exprs = (yyvsp[-3].list); n->absent_on_null = (yyvsp[-2].boolean); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 50793 "gram_minimal.c" /* yacc.c:1646 */ break; case 2171: #line 16066 "gram_minimal.y" /* yacc.c:1646 */ { JsonArrayQueryConstructor *n = makeNode(JsonArrayQueryConstructor); n->query = (yyvsp[-3].node); n->format = (JsonFormat *) (yyvsp[-2].node); n->absent_on_null = true; /* XXX */ n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-5]); (yyval.node) = (Node *) n; } #line 50808 "gram_minimal.c" /* yacc.c:1646 */ break; case 2172: #line 16079 "gram_minimal.y" /* yacc.c:1646 */ { JsonArrayConstructor *n = makeNode(JsonArrayConstructor); n->exprs = NIL; n->absent_on_null = true; n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 50822 "gram_minimal.c" /* yacc.c:1646 */ break; case 2173: #line 16089 "gram_minimal.y" /* yacc.c:1646 */ { JsonParseExpr *n = makeNode(JsonParseExpr); n->expr = (JsonValueExpr *) (yyvsp[-2].node); n->unique_keys = (yyvsp[-1].boolean); n->output = NULL; n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 50836 "gram_minimal.c" /* yacc.c:1646 */ break; case 2174: #line 16099 "gram_minimal.y" /* yacc.c:1646 */ { JsonScalarExpr *n = makeNode(JsonScalarExpr); n->expr = (Expr *) (yyvsp[-1].node); n->output = NULL; n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 50849 "gram_minimal.c" /* yacc.c:1646 */ break; case 2175: #line 16108 "gram_minimal.y" /* yacc.c:1646 */ { JsonSerializeExpr *n = makeNode(JsonSerializeExpr); n->expr = (JsonValueExpr *) (yyvsp[-2].node); n->output = (JsonOutput *) (yyvsp[-1].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 50862 "gram_minimal.c" /* yacc.c:1646 */ break; case 2176: #line 16117 "gram_minimal.y" /* yacc.c:1646 */ { MergeSupportFunc *m = makeNode(MergeSupportFunc); m->msftype = TEXTOID; m->location = (yylsp[-2]); (yyval.node) = (Node *) m; } #line 50874 "gram_minimal.c" /* yacc.c:1646 */ break; case 2177: #line 16131 "gram_minimal.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_QUERY_OP; n->context_item = (JsonValueExpr *) (yyvsp[-8].node); n->pathspec = (yyvsp[-6].node); n->passing = (yyvsp[-5].list); n->output = (JsonOutput *) (yyvsp[-4].node); n->wrapper = (yyvsp[-3].ival); n->quotes = (yyvsp[-2].ival); n->on_empty = (JsonBehavior *) linitial((yyvsp[-1].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[-1].list)); n->location = (yylsp[-10]); (yyval.node) = (Node *) n; } #line 50894 "gram_minimal.c" /* yacc.c:1646 */ break; case 2178: #line 16150 "gram_minimal.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_EXISTS_OP; n->context_item = (JsonValueExpr *) (yyvsp[-5].node); n->pathspec = (yyvsp[-3].node); n->passing = (yyvsp[-2].list); n->output = NULL; n->on_error = (JsonBehavior *) (yyvsp[-1].node); n->location = (yylsp[-7]); (yyval.node) = (Node *) n; } #line 50911 "gram_minimal.c" /* yacc.c:1646 */ break; case 2179: #line 16167 "gram_minimal.y" /* yacc.c:1646 */ { JsonFuncExpr *n = makeNode(JsonFuncExpr); n->op = JSON_VALUE_OP; n->context_item = (JsonValueExpr *) (yyvsp[-6].node); n->pathspec = (yyvsp[-4].node); n->passing = (yyvsp[-3].list); n->output = (JsonOutput *) (yyvsp[-2].node); n->on_empty = (JsonBehavior *) linitial((yyvsp[-1].list)); n->on_error = (JsonBehavior *) lsecond((yyvsp[-1].list)); n->location = (yylsp[-8]); (yyval.node) = (Node *) n; } #line 50929 "gram_minimal.c" /* yacc.c:1646 */ break; case 2180: #line 16187 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 50935 "gram_minimal.c" /* yacc.c:1646 */ break; case 2181: #line 16189 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst(-1); } #line 50941 "gram_minimal.c" /* yacc.c:1646 */ break; case 2182: #line 16193 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 50947 "gram_minimal.c" /* yacc.c:1646 */ break; case 2183: #line 16195 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 50953 "gram_minimal.c" /* yacc.c:1646 */ break; case 2184: #line 16197 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 50959 "gram_minimal.c" /* yacc.c:1646 */ break; case 2185: #line 16199 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 50965 "gram_minimal.c" /* yacc.c:1646 */ break; case 2186: #line 16202 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 50971 "gram_minimal.c" /* yacc.c:1646 */ break; case 2187: #line 16205 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 50977 "gram_minimal.c" /* yacc.c:1646 */ break; case 2188: #line 16206 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 50983 "gram_minimal.c" /* yacc.c:1646 */ break; case 2189: #line 16210 "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 50995 "gram_minimal.c" /* yacc.c:1646 */ break; case 2190: #line 16218 "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 51007 "gram_minimal.c" /* yacc.c:1646 */ break; case 2191: #line 16227 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 51013 "gram_minimal.c" /* yacc.c:1646 */ break; case 2192: #line 16228 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_CONTENT; } #line 51019 "gram_minimal.c" /* yacc.c:1646 */ break; case 2193: #line 16231 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 51025 "gram_minimal.c" /* yacc.c:1646 */ break; case 2194: #line 16232 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51031 "gram_minimal.c" /* yacc.c:1646 */ break; case 2195: #line 16233 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51037 "gram_minimal.c" /* yacc.c:1646 */ break; case 2196: #line 16236 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 51043 "gram_minimal.c" /* yacc.c:1646 */ break; case 2197: #line 16237 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51049 "gram_minimal.c" /* yacc.c:1646 */ break; case 2198: #line 16238 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 51055 "gram_minimal.c" /* yacc.c:1646 */ break; case 2199: #line 16244 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51063 "gram_minimal.c" /* yacc.c:1646 */ break; case 2200: #line 16248 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51071 "gram_minimal.c" /* yacc.c:1646 */ break; case 2201: #line 16252 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51079 "gram_minimal.c" /* yacc.c:1646 */ break; case 2202: #line 16256 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51087 "gram_minimal.c" /* yacc.c:1646 */ break; case 2205: #line 16271 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51093 "gram_minimal.c" /* yacc.c:1646 */ break; case 2206: #line 16272 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51099 "gram_minimal.c" /* yacc.c:1646 */ break; case 2207: #line 16276 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 51105 "gram_minimal.c" /* yacc.c:1646 */ break; case 2208: #line 16277 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 51111 "gram_minimal.c" /* yacc.c:1646 */ break; case 2209: #line 16285 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51117 "gram_minimal.c" /* yacc.c:1646 */ break; case 2210: #line 16286 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51123 "gram_minimal.c" /* yacc.c:1646 */ break; case 2211: #line 16290 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 51129 "gram_minimal.c" /* yacc.c:1646 */ break; case 2212: #line 16292 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 51135 "gram_minimal.c" /* yacc.c:1646 */ break; case 2213: #line 16297 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 51146 "gram_minimal.c" /* yacc.c:1646 */ break; case 2214: #line 16306 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.windef) = (yyvsp[0].windef); } #line 51152 "gram_minimal.c" /* yacc.c:1646 */ break; case 2215: #line 16308 "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 51170 "gram_minimal.c" /* yacc.c:1646 */ break; case 2216: #line 16322 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.windef) = NULL; } #line 51176 "gram_minimal.c" /* yacc.c:1646 */ break; case 2217: #line 16327 "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 51195 "gram_minimal.c" /* yacc.c:1646 */ break; case 2218: #line 16353 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51201 "gram_minimal.c" /* yacc.c:1646 */ break; case 2219: #line 16354 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 51207 "gram_minimal.c" /* yacc.c:1646 */ break; case 2220: #line 16357 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51213 "gram_minimal.c" /* yacc.c:1646 */ break; case 2221: #line 16358 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51219 "gram_minimal.c" /* yacc.c:1646 */ break; case 2222: #line 16367 "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 51231 "gram_minimal.c" /* yacc.c:1646 */ break; case 2223: #line 16375 "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 51243 "gram_minimal.c" /* yacc.c:1646 */ break; case 2224: #line 16383 "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 51255 "gram_minimal.c" /* yacc.c:1646 */ break; case 2225: #line 16391 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 51268 "gram_minimal.c" /* yacc.c:1646 */ break; case 2226: #line 16402 "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 51290 "gram_minimal.c" /* yacc.c:1646 */ break; case 2227: #line 16420 "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 51332 "gram_minimal.c" /* yacc.c:1646 */ break; case 2228: #line 16466 "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 51345 "gram_minimal.c" /* yacc.c:1646 */ break; case 2229: #line 16475 "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 51358 "gram_minimal.c" /* yacc.c:1646 */ break; case 2230: #line 16484 "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 51371 "gram_minimal.c" /* yacc.c:1646 */ break; case 2231: #line 16493 "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 51384 "gram_minimal.c" /* yacc.c:1646 */ break; case 2232: #line 16502 "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 51397 "gram_minimal.c" /* yacc.c:1646 */ break; case 2233: #line 16513 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 51403 "gram_minimal.c" /* yacc.c:1646 */ break; case 2234: #line 16514 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 51409 "gram_minimal.c" /* yacc.c:1646 */ break; case 2235: #line 16515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 51415 "gram_minimal.c" /* yacc.c:1646 */ break; case 2236: #line 16516 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 51421 "gram_minimal.c" /* yacc.c:1646 */ break; case 2237: #line 16517 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 51427 "gram_minimal.c" /* yacc.c:1646 */ break; case 2238: #line 16531 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51433 "gram_minimal.c" /* yacc.c:1646 */ break; case 2239: #line 16532 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51439 "gram_minimal.c" /* yacc.c:1646 */ break; case 2240: #line 16533 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 51445 "gram_minimal.c" /* yacc.c:1646 */ break; case 2241: #line 16536 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51451 "gram_minimal.c" /* yacc.c:1646 */ break; case 2242: #line 16537 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51457 "gram_minimal.c" /* yacc.c:1646 */ break; case 2243: #line 16540 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 51463 "gram_minimal.c" /* yacc.c:1646 */ break; case 2244: #line 16543 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 51469 "gram_minimal.c" /* yacc.c:1646 */ break; case 2245: #line 16544 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 51475 "gram_minimal.c" /* yacc.c:1646 */ break; case 2246: #line 16545 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ALL_SUBLINK; } #line 51481 "gram_minimal.c" /* yacc.c:1646 */ break; case 2247: #line 16548 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51487 "gram_minimal.c" /* yacc.c:1646 */ break; case 2248: #line 16549 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51493 "gram_minimal.c" /* yacc.c:1646 */ break; case 2249: #line 16552 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "+"; } #line 51499 "gram_minimal.c" /* yacc.c:1646 */ break; case 2250: #line 16553 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "-"; } #line 51505 "gram_minimal.c" /* yacc.c:1646 */ break; case 2251: #line 16554 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "*"; } #line 51511 "gram_minimal.c" /* yacc.c:1646 */ break; case 2252: #line 16555 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "/"; } #line 51517 "gram_minimal.c" /* yacc.c:1646 */ break; case 2253: #line 16556 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "%"; } #line 51523 "gram_minimal.c" /* yacc.c:1646 */ break; case 2254: #line 16557 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "^"; } #line 51529 "gram_minimal.c" /* yacc.c:1646 */ break; case 2255: #line 16558 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<"; } #line 51535 "gram_minimal.c" /* yacc.c:1646 */ break; case 2256: #line 16559 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = ">"; } #line 51541 "gram_minimal.c" /* yacc.c:1646 */ break; case 2257: #line 16560 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "="; } #line 51547 "gram_minimal.c" /* yacc.c:1646 */ break; case 2258: #line 16561 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<="; } #line 51553 "gram_minimal.c" /* yacc.c:1646 */ break; case 2259: #line 16562 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = ">="; } #line 51559 "gram_minimal.c" /* yacc.c:1646 */ break; case 2260: #line 16563 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<>"; } #line 51565 "gram_minimal.c" /* yacc.c:1646 */ break; case 2261: #line 16567 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51571 "gram_minimal.c" /* yacc.c:1646 */ break; case 2262: #line 16569 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51577 "gram_minimal.c" /* yacc.c:1646 */ break; case 2263: #line 16574 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51583 "gram_minimal.c" /* yacc.c:1646 */ break; case 2264: #line 16576 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51589 "gram_minimal.c" /* yacc.c:1646 */ break; case 2265: #line 16581 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 51595 "gram_minimal.c" /* yacc.c:1646 */ break; case 2266: #line 16583 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 51601 "gram_minimal.c" /* yacc.c:1646 */ break; case 2267: #line 16585 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~")); } #line 51607 "gram_minimal.c" /* yacc.c:1646 */ break; case 2268: #line 16587 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~")); } #line 51613 "gram_minimal.c" /* yacc.c:1646 */ break; case 2269: #line 16589 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~*")); } #line 51619 "gram_minimal.c" /* yacc.c:1646 */ break; case 2270: #line 16591 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~*")); } #line 51625 "gram_minimal.c" /* yacc.c:1646 */ break; case 2271: #line 16603 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51633 "gram_minimal.c" /* yacc.c:1646 */ break; case 2272: #line 16607 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51641 "gram_minimal.c" /* yacc.c:1646 */ break; case 2273: #line 16614 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51649 "gram_minimal.c" /* yacc.c:1646 */ break; case 2274: #line 16618 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51657 "gram_minimal.c" /* yacc.c:1646 */ break; case 2275: #line 16624 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 51665 "gram_minimal.c" /* yacc.c:1646 */ break; case 2276: #line 16628 "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 51679 "gram_minimal.c" /* yacc.c:1646 */ break; case 2277: #line 16638 "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 51693 "gram_minimal.c" /* yacc.c:1646 */ break; case 2278: #line 16649 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51699 "gram_minimal.c" /* yacc.c:1646 */ break; case 2279: #line 16650 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 51705 "gram_minimal.c" /* yacc.c:1646 */ break; case 2280: #line 16653 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 51711 "gram_minimal.c" /* yacc.c:1646 */ break; case 2281: #line 16654 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 51717 "gram_minimal.c" /* yacc.c:1646 */ break; case 2282: #line 16658 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 51725 "gram_minimal.c" /* yacc.c:1646 */ break; case 2283: #line 16662 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 51733 "gram_minimal.c" /* yacc.c:1646 */ break; case 2284: #line 16666 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1])); } #line 51741 "gram_minimal.c" /* yacc.c:1646 */ break; case 2285: #line 16671 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51747 "gram_minimal.c" /* yacc.c:1646 */ break; case 2286: #line 16672 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 51753 "gram_minimal.c" /* yacc.c:1646 */ break; case 2287: #line 16678 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 51761 "gram_minimal.c" /* yacc.c:1646 */ break; case 2288: #line 16687 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51767 "gram_minimal.c" /* yacc.c:1646 */ break; case 2289: #line 16688 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "year"; } #line 51773 "gram_minimal.c" /* yacc.c:1646 */ break; case 2290: #line 16689 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "month"; } #line 51779 "gram_minimal.c" /* yacc.c:1646 */ break; case 2291: #line 16690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "day"; } #line 51785 "gram_minimal.c" /* yacc.c:1646 */ break; case 2292: #line 16691 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "hour"; } #line 51791 "gram_minimal.c" /* yacc.c:1646 */ break; case 2293: #line 16692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "minute"; } #line 51797 "gram_minimal.c" /* yacc.c:1646 */ break; case 2294: #line 16693 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "second"; } #line 51803 "gram_minimal.c" /* yacc.c:1646 */ break; case 2295: #line 16694 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 51809 "gram_minimal.c" /* yacc.c:1646 */ break; case 2296: #line 16698 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "NFC"; } #line 51815 "gram_minimal.c" /* yacc.c:1646 */ break; case 2297: #line 16699 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "NFD"; } #line 51821 "gram_minimal.c" /* yacc.c:1646 */ break; case 2298: #line 16700 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "NFKC"; } #line 51827 "gram_minimal.c" /* yacc.c:1646 */ break; case 2299: #line 16701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "NFKD"; } #line 51833 "gram_minimal.c" /* yacc.c:1646 */ break; case 2300: #line 16707 "gram_minimal.y" /* yacc.c:1646 */ { /* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */ (yyval.list) = list_make4((yyvsp[-6].node), (yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 51842 "gram_minimal.c" /* yacc.c:1646 */ break; case 2301: #line 16712 "gram_minimal.y" /* yacc.c:1646 */ { /* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 51851 "gram_minimal.c" /* yacc.c:1646 */ break; case 2302: #line 16720 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 51857 "gram_minimal.c" /* yacc.c:1646 */ break; case 2303: #line 16742 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 51865 "gram_minimal.c" /* yacc.c:1646 */ break; case 2304: #line 16746 "gram_minimal.y" /* yacc.c:1646 */ { /* not legal per SQL, but might as well allow it */ (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[0].node), (yyvsp[-2].node)); } #line 51874 "gram_minimal.c" /* yacc.c:1646 */ break; case 2305: #line 16751 "gram_minimal.y" /* yacc.c:1646 */ { /* * Because we aren't restricting data types here, this * syntax can end up resolving to textregexsubstr(). * We've historically allowed that to happen, so continue * to accept it. However, ruleutils.c will reverse-list * such a call in regular function call syntax. */ (yyval.list) = list_make2((yyvsp[-2].node), (yyvsp[0].node)); } #line 51889 "gram_minimal.c" /* yacc.c:1646 */ break; case 2306: #line 16762 "gram_minimal.y" /* yacc.c:1646 */ { /* not legal per SQL */ /* * 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[-2].node), makeIntConst(1, -1), makeTypeCast((yyvsp[0].node), SystemTypeName("int4"), -1)); } #line 51910 "gram_minimal.c" /* yacc.c:1646 */ break; case 2307: #line 16779 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); } #line 51918 "gram_minimal.c" /* yacc.c:1646 */ break; case 2308: #line 16784 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 51924 "gram_minimal.c" /* yacc.c:1646 */ break; case 2309: #line 16785 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51930 "gram_minimal.c" /* yacc.c:1646 */ break; case 2310: #line 16786 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 51936 "gram_minimal.c" /* yacc.c:1646 */ break; case 2311: #line 16790 "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 51948 "gram_minimal.c" /* yacc.c:1646 */ break; case 2312: #line 16797 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 51954 "gram_minimal.c" /* yacc.c:1646 */ break; case 2313: #line 16808 "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 51969 "gram_minimal.c" /* yacc.c:1646 */ break; case 2314: #line 16822 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 51975 "gram_minimal.c" /* yacc.c:1646 */ break; case 2315: #line 16823 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 51981 "gram_minimal.c" /* yacc.c:1646 */ break; case 2316: #line 16828 "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 51994 "gram_minimal.c" /* yacc.c:1646 */ break; case 2317: #line 16839 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52000 "gram_minimal.c" /* yacc.c:1646 */ break; case 2318: #line 16840 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52006 "gram_minimal.c" /* yacc.c:1646 */ break; case 2319: #line 16843 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52012 "gram_minimal.c" /* yacc.c:1646 */ break; case 2320: #line 16844 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52018 "gram_minimal.c" /* yacc.c:1646 */ break; case 2321: #line 16848 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 52026 "gram_minimal.c" /* yacc.c:1646 */ break; case 2322: #line 16852 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 52034 "gram_minimal.c" /* yacc.c:1646 */ break; case 2323: #line 16859 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 52042 "gram_minimal.c" /* yacc.c:1646 */ break; case 2324: #line 16863 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 52050 "gram_minimal.c" /* yacc.c:1646 */ break; case 2325: #line 16867 "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 52063 "gram_minimal.c" /* yacc.c:1646 */ break; case 2326: #line 16876 "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 52076 "gram_minimal.c" /* yacc.c:1646 */ break; case 2327: #line 16887 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52082 "gram_minimal.c" /* yacc.c:1646 */ break; case 2328: #line 16888 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52088 "gram_minimal.c" /* yacc.c:1646 */ break; case 2329: #line 16892 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52094 "gram_minimal.c" /* yacc.c:1646 */ break; case 2330: #line 16893 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 52100 "gram_minimal.c" /* yacc.c:1646 */ break; case 2331: #line 16897 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52106 "gram_minimal.c" /* yacc.c:1646 */ break; case 2332: #line 16898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 52112 "gram_minimal.c" /* yacc.c:1646 */ break; case 2335: #line 16907 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52118 "gram_minimal.c" /* yacc.c:1646 */ break; case 2336: #line 16908 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52124 "gram_minimal.c" /* yacc.c:1646 */ break; case 2337: #line 16912 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52130 "gram_minimal.c" /* yacc.c:1646 */ break; case 2338: #line 16913 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 52136 "gram_minimal.c" /* yacc.c:1646 */ break; case 2339: #line 16918 "gram_minimal.y" /* yacc.c:1646 */ { JsonArgument *n = makeNode(JsonArgument); n->val = (JsonValueExpr *) (yyvsp[-2].node); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 52148 "gram_minimal.c" /* yacc.c:1646 */ break; case 2340: #line 16929 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_NONE; } #line 52154 "gram_minimal.c" /* yacc.c:1646 */ break; case 2341: #line 16930 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_NONE; } #line 52160 "gram_minimal.c" /* yacc.c:1646 */ break; case 2342: #line 16931 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52166 "gram_minimal.c" /* yacc.c:1646 */ break; case 2343: #line 16932 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52172 "gram_minimal.c" /* yacc.c:1646 */ break; case 2344: #line 16933 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_CONDITIONAL; } #line 52178 "gram_minimal.c" /* yacc.c:1646 */ break; case 2345: #line 16934 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52184 "gram_minimal.c" /* yacc.c:1646 */ break; case 2346: #line 16935 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_CONDITIONAL; } #line 52190 "gram_minimal.c" /* yacc.c:1646 */ break; case 2347: #line 16936 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNCONDITIONAL; } #line 52196 "gram_minimal.c" /* yacc.c:1646 */ break; case 2348: #line 16937 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSW_UNSPEC; } #line 52202 "gram_minimal.c" /* yacc.c:1646 */ break; case 2349: #line 16942 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonBehavior(JSON_BEHAVIOR_DEFAULT, (yyvsp[0].node), (yylsp[-1])); } #line 52208 "gram_minimal.c" /* yacc.c:1646 */ break; case 2350: #line 16944 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonBehavior((yyvsp[0].ival), NULL, (yylsp[0])); } #line 52214 "gram_minimal.c" /* yacc.c:1646 */ break; case 2351: #line 16948 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_ERROR; } #line 52220 "gram_minimal.c" /* yacc.c:1646 */ break; case 2352: #line 16949 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_NULL; } #line 52226 "gram_minimal.c" /* yacc.c:1646 */ break; case 2353: #line 16950 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_TRUE; } #line 52232 "gram_minimal.c" /* yacc.c:1646 */ break; case 2354: #line 16951 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_FALSE; } #line 52238 "gram_minimal.c" /* yacc.c:1646 */ break; case 2355: #line 16952 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_UNKNOWN; } #line 52244 "gram_minimal.c" /* yacc.c:1646 */ break; case 2356: #line 16953 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 52250 "gram_minimal.c" /* yacc.c:1646 */ break; case 2357: #line 16954 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_OBJECT; } #line 52256 "gram_minimal.c" /* yacc.c:1646 */ break; case 2358: #line 16956 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JSON_BEHAVIOR_EMPTY_ARRAY; } #line 52262 "gram_minimal.c" /* yacc.c:1646 */ break; case 2359: #line 16961 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].node), NULL); } #line 52268 "gram_minimal.c" /* yacc.c:1646 */ break; case 2360: #line 16963 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-2].node)); } #line 52274 "gram_minimal.c" /* yacc.c:1646 */ break; case 2361: #line 16965 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].node), (yyvsp[-2].node)); } #line 52280 "gram_minimal.c" /* yacc.c:1646 */ break; case 2362: #line 16967 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NULL); } #line 52286 "gram_minimal.c" /* yacc.c:1646 */ break; case 2363: #line 16972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 52292 "gram_minimal.c" /* yacc.c:1646 */ break; case 2364: #line 16974 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52298 "gram_minimal.c" /* yacc.c:1646 */ break; case 2365: #line 16979 "gram_minimal.y" /* yacc.c:1646 */ { /* formatted_expr will be set during parse-analysis. */ (yyval.node) = (Node *) makeJsonValueExpr((Expr *) (yyvsp[-1].node), NULL, castNode(JsonFormat, (yyvsp[0].node))); } #line 52308 "gram_minimal.c" /* yacc.c:1646 */ break; case 2366: #line 16988 "gram_minimal.y" /* yacc.c:1646 */ { int encoding; if (!pg_strcasecmp((yyvsp[0].str), "utf8")) encoding = JS_ENC_UTF8; else if (!pg_strcasecmp((yyvsp[0].str), "utf16")) encoding = JS_ENC_UTF16; else if (!pg_strcasecmp((yyvsp[0].str), "utf32")) encoding = JS_ENC_UTF32; else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized JSON encoding: %s", (yyvsp[0].str)))); (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, (yylsp[-3])); } #line 52329 "gram_minimal.c" /* yacc.c:1646 */ break; case 2367: #line 17005 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_JSON, JS_ENC_DEFAULT, (yylsp[-1])); } #line 52337 "gram_minimal.c" /* yacc.c:1646 */ break; case 2368: #line 17012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 52345 "gram_minimal.c" /* yacc.c:1646 */ break; case 2369: #line 17016 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeJsonFormat(JS_FORMAT_DEFAULT, JS_ENC_DEFAULT, -1); } #line 52353 "gram_minimal.c" /* yacc.c:1646 */ break; case 2370: #line 17022 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_KEEP; } #line 52359 "gram_minimal.c" /* yacc.c:1646 */ break; case 2371: #line 17023 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_KEEP; } #line 52365 "gram_minimal.c" /* yacc.c:1646 */ break; case 2372: #line 17024 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_OMIT; } #line 52371 "gram_minimal.c" /* yacc.c:1646 */ break; case 2373: #line 17025 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_OMIT; } #line 52377 "gram_minimal.c" /* yacc.c:1646 */ break; case 2374: #line 17026 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_QUOTES_UNSPEC; } #line 52383 "gram_minimal.c" /* yacc.c:1646 */ break; case 2375: #line 17031 "gram_minimal.y" /* yacc.c:1646 */ { JsonOutput *n = makeNode(JsonOutput); n->typeName = (yyvsp[-1].typnam); n->returning = makeNode(JsonReturning); n->returning->format = (JsonFormat *) (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 52396 "gram_minimal.c" /* yacc.c:1646 */ break; case 2376: #line 17039 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 52402 "gram_minimal.c" /* yacc.c:1646 */ break; case 2377: #line 17053 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ANY; } #line 52408 "gram_minimal.c" /* yacc.c:1646 */ break; case 2378: #line 17054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ANY; } #line 52414 "gram_minimal.c" /* yacc.c:1646 */ break; case 2379: #line 17055 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_ARRAY; } #line 52420 "gram_minimal.c" /* yacc.c:1646 */ break; case 2380: #line 17056 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_OBJECT; } #line 52426 "gram_minimal.c" /* yacc.c:1646 */ break; case 2381: #line 17057 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = JS_TYPE_SCALAR; } #line 52432 "gram_minimal.c" /* yacc.c:1646 */ break; case 2382: #line 17066 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52438 "gram_minimal.c" /* yacc.c:1646 */ break; case 2383: #line 17067 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52444 "gram_minimal.c" /* yacc.c:1646 */ break; case 2384: #line 17068 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52450 "gram_minimal.c" /* yacc.c:1646 */ break; case 2385: #line 17069 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52456 "gram_minimal.c" /* yacc.c:1646 */ break; case 2386: #line 17070 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52462 "gram_minimal.c" /* yacc.c:1646 */ break; case 2387: #line 17075 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52468 "gram_minimal.c" /* yacc.c:1646 */ break; case 2388: #line 17077 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 52474 "gram_minimal.c" /* yacc.c:1646 */ break; case 2389: #line 17087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 52480 "gram_minimal.c" /* yacc.c:1646 */ break; case 2390: #line 17090 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeJsonKeyValue((yyvsp[-2].node), (yyvsp[0].node)); } #line 52486 "gram_minimal.c" /* yacc.c:1646 */ break; case 2391: #line 17095 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52492 "gram_minimal.c" /* yacc.c:1646 */ break; case 2392: #line 17096 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52498 "gram_minimal.c" /* yacc.c:1646 */ break; case 2393: #line 17097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52504 "gram_minimal.c" /* yacc.c:1646 */ break; case 2394: #line 17101 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 52510 "gram_minimal.c" /* yacc.c:1646 */ break; case 2395: #line 17102 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52516 "gram_minimal.c" /* yacc.c:1646 */ break; case 2396: #line 17103 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 52522 "gram_minimal.c" /* yacc.c:1646 */ break; case 2397: #line 17107 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 52528 "gram_minimal.c" /* yacc.c:1646 */ break; case 2398: #line 17108 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node));} #line 52534 "gram_minimal.c" /* yacc.c:1646 */ break; case 2399: #line 17118 "gram_minimal.y" /* yacc.c:1646 */ { JsonObjectAgg *n = makeNode(JsonObjectAgg); n->arg = (JsonKeyValue *) (yyvsp[-4].node); n->absent_on_null = (yyvsp[-3].boolean); n->unique = (yyvsp[-2].boolean); n->constructor = makeNode(JsonAggConstructor); n->constructor->output = (JsonOutput *) (yyvsp[-1].node); n->constructor->agg_order = NULL; n->constructor->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 52551 "gram_minimal.c" /* yacc.c:1646 */ break; case 2400: #line 17136 "gram_minimal.y" /* yacc.c:1646 */ { JsonArrayAgg *n = makeNode(JsonArrayAgg); n->arg = (JsonValueExpr *) (yyvsp[-4].node); n->absent_on_null = (yyvsp[-2].boolean); n->constructor = makeNode(JsonAggConstructor); n->constructor->agg_order = (yyvsp[-3].list); n->constructor->output = (JsonOutput *) (yyvsp[-1].node); n->constructor->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 52567 "gram_minimal.c" /* yacc.c:1646 */ break; case 2401: #line 17150 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52573 "gram_minimal.c" /* yacc.c:1646 */ break; case 2402: #line 17151 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52579 "gram_minimal.c" /* yacc.c:1646 */ break; case 2403: #line 17160 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 52585 "gram_minimal.c" /* yacc.c:1646 */ break; case 2404: #line 17161 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 52591 "gram_minimal.c" /* yacc.c:1646 */ break; case 2405: #line 17165 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 52597 "gram_minimal.c" /* yacc.c:1646 */ break; case 2406: #line 17166 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 52603 "gram_minimal.c" /* yacc.c:1646 */ break; case 2407: #line 17170 "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 52615 "gram_minimal.c" /* yacc.c:1646 */ break; case 2408: #line 17178 "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 52627 "gram_minimal.c" /* yacc.c:1646 */ break; case 2409: #line 17186 "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 52639 "gram_minimal.c" /* yacc.c:1646 */ break; case 2410: #line 17194 "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 52656 "gram_minimal.c" /* yacc.c:1646 */ break; case 2411: #line 17216 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 52662 "gram_minimal.c" /* yacc.c:1646 */ break; case 2412: #line 17217 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 52668 "gram_minimal.c" /* yacc.c:1646 */ break; case 2413: #line 17229 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 52676 "gram_minimal.c" /* yacc.c:1646 */ break; case 2414: #line 17233 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVarFromQualifiedName((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 52684 "gram_minimal.c" /* yacc.c:1646 */ break; case 2415: #line 17239 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 52690 "gram_minimal.c" /* yacc.c:1646 */ break; case 2416: #line 17241 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 52696 "gram_minimal.c" /* yacc.c:1646 */ break; case 2417: #line 17245 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52702 "gram_minimal.c" /* yacc.c:1646 */ break; case 2418: #line 17247 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52708 "gram_minimal.c" /* yacc.c:1646 */ break; case 2419: #line 17249 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52714 "gram_minimal.c" /* yacc.c:1646 */ break; case 2420: #line 17260 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 52720 "gram_minimal.c" /* yacc.c:1646 */ break; case 2421: #line 17262 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 52729 "gram_minimal.c" /* yacc.c:1646 */ break; case 2422: #line 17273 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 52737 "gram_minimal.c" /* yacc.c:1646 */ break; case 2423: #line 17277 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 52745 "gram_minimal.c" /* yacc.c:1646 */ break; case 2424: #line 17281 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 52753 "gram_minimal.c" /* yacc.c:1646 */ break; case 2425: #line 17285 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 52761 "gram_minimal.c" /* yacc.c:1646 */ break; case 2426: #line 17289 "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 52774 "gram_minimal.c" /* yacc.c:1646 */ break; case 2427: #line 17298 "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 52786 "gram_minimal.c" /* yacc.c:1646 */ break; case 2428: #line 17306 "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 52822 "gram_minimal.c" /* yacc.c:1646 */ break; case 2429: #line 17338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 52830 "gram_minimal.c" /* yacc.c:1646 */ break; case 2430: #line 17342 "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 52841 "gram_minimal.c" /* yacc.c:1646 */ break; case 2431: #line 17349 "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 52853 "gram_minimal.c" /* yacc.c:1646 */ break; case 2432: #line 17357 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 52861 "gram_minimal.c" /* yacc.c:1646 */ break; case 2433: #line 17361 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 52869 "gram_minimal.c" /* yacc.c:1646 */ break; case 2434: #line 17365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst((yylsp[0])); } #line 52877 "gram_minimal.c" /* yacc.c:1646 */ break; case 2435: #line 17370 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 52883 "gram_minimal.c" /* yacc.c:1646 */ break; case 2436: #line 17371 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 52889 "gram_minimal.c" /* yacc.c:1646 */ break; case 2437: #line 17373 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 52895 "gram_minimal.c" /* yacc.c:1646 */ break; case 2438: #line 17374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = + (yyvsp[0].ival); } #line 52901 "gram_minimal.c" /* yacc.c:1646 */ break; case 2439: #line 17375 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = - (yyvsp[0].ival); } #line 52907 "gram_minimal.c" /* yacc.c:1646 */ break; case 2440: #line 17380 "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; case ROLESPEC_CURRENT_ROLE: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "CURRENT_ROLE"), parser_errposition((yylsp[0])))); break; } } #line 52950 "gram_minimal.c" /* yacc.c:1646 */ break; case 2441: #line 17421 "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 52982 "gram_minimal.c" /* yacc.c:1646 */ break; case 2442: #line 17449 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_ROLE, (yylsp[0])); } #line 52990 "gram_minimal.c" /* yacc.c:1646 */ break; case 2443: #line 17453 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 52998 "gram_minimal.c" /* yacc.c:1646 */ break; case 2444: #line 17457 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 53006 "gram_minimal.c" /* yacc.c:1646 */ break; case 2445: #line 17463 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 53012 "gram_minimal.c" /* yacc.c:1646 */ break; case 2446: #line 17465 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 53018 "gram_minimal.c" /* yacc.c:1646 */ break; case 2447: #line 17482 "gram_minimal.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->distinctClause = (yyvsp[-9].list); n->targetList = (yyvsp[-8].list); n->fromClause = (yyvsp[-7].list); n->whereClause = (yyvsp[-6].node); n->groupClause = ((yyvsp[-5].groupclause))->list; n->groupDistinct = ((yyvsp[-5].groupclause))->distinct; n->havingClause = (yyvsp[-4].node); n->windowClause = (yyvsp[-3].list); n->sortClause = (yyvsp[-2].list); if ((yyvsp[-1].selectlimit)) { n->limitOffset = (yyvsp[-1].selectlimit)->limitOffset; n->limitCount = (yyvsp[-1].selectlimit)->limitCount; if (!n->sortClause && (yyvsp[-1].selectlimit)->limitOption == LIMIT_OPTION_WITH_TIES) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WITH TIES cannot be specified without ORDER BY clause"))); n->limitOption = (yyvsp[-1].selectlimit)->limitOption; } n->lockingClause = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 53049 "gram_minimal.c" /* yacc.c:1646 */ break; case 2448: #line 17515 "gram_minimal.y" /* yacc.c:1646 */ { PLAssignStmt *n = makeNode(PLAssignStmt); n->name = (yyvsp[-3].str); n->indirection = check_indirection((yyvsp[-2].list), yyscanner); /* nnames will be filled by calling production */ n->val = (SelectStmt *) (yyvsp[0].node); n->location = (yylsp[-3]); (yyval.node) = (Node *) n; } #line 53064 "gram_minimal.c" /* yacc.c:1646 */ break; case 2449: #line 17527 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53070 "gram_minimal.c" /* yacc.c:1646 */ break; case 2450: #line 17528 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("$%d", (yyvsp[0].ival)); } #line 53076 "gram_minimal.c" /* yacc.c:1646 */ break; case 2453: #line 17549 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53082 "gram_minimal.c" /* yacc.c:1646 */ break; case 2454: #line 17550 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53088 "gram_minimal.c" /* yacc.c:1646 */ break; case 2455: #line 17551 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53094 "gram_minimal.c" /* yacc.c:1646 */ break; case 2456: #line 17556 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53100 "gram_minimal.c" /* yacc.c:1646 */ break; case 2457: #line 17557 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53106 "gram_minimal.c" /* yacc.c:1646 */ break; case 2458: #line 17558 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53112 "gram_minimal.c" /* yacc.c:1646 */ break; case 2459: #line 17563 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53118 "gram_minimal.c" /* yacc.c:1646 */ break; case 2460: #line 17564 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53124 "gram_minimal.c" /* yacc.c:1646 */ break; case 2461: #line 17565 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53130 "gram_minimal.c" /* yacc.c:1646 */ break; case 2462: #line 17566 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53136 "gram_minimal.c" /* yacc.c:1646 */ break; case 2463: #line 17572 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53142 "gram_minimal.c" /* yacc.c:1646 */ break; case 2464: #line 17573 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53148 "gram_minimal.c" /* yacc.c:1646 */ break; case 2465: #line 17574 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53154 "gram_minimal.c" /* yacc.c:1646 */ break; case 2466: #line 17575 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53160 "gram_minimal.c" /* yacc.c:1646 */ break; case 2467: #line 17576 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53166 "gram_minimal.c" /* yacc.c:1646 */ break; case 2468: #line 17582 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 53172 "gram_minimal.c" /* yacc.c:1646 */ break; case 2469: #line 17583 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 53178 "gram_minimal.c" /* yacc.c:1646 */ break; #line 53182 "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 18595 "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(indirection, 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 * makeFloatConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.fval.type = T_Float; n->val.fval.fval = str; n->location = location; return (Node *)n; } static Node * makeBoolAConst(bool state, int location) { A_Const *n = makeNode(A_Const); n->val.boolval.type = T_Boolean; n->val.boolval.boolval = state; n->location = location; return (Node *) n; } static Node * makeBitStringConst(char *str, int location) { A_Const *n = makeNode(A_Const); n->val.bsval.type = T_BitString; n->val.bsval.bsval = str; n->location = location; return (Node *)n; } static Node * makeNullAConst(int location) { A_Const *n = makeNode(A_Const); n->isnull = true; n->location = location; return (Node *)n; } static Node * makeAConst(Node *v, int location) { Node *n; switch (v->type) { case T_Float: n = makeFloatConst(castNode(Float, v)->fval, location); break; case T_Integer: n = makeIntConst(castNode(Integer, v)->ival, location); break; default: /* currently not used */ Assert(false); n = NULL; } return n; } /* 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(indirection, 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); Integer *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 = makeInteger(list_length(directargs)); return list_make2(list_concat(directargs, orderedargs), 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, SelectLimit *limitClause, 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 (limitClause && limitClause->limitOffset) { if (stmt->limitOffset) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple OFFSET clauses not allowed"), parser_errposition(exprLocation(limitClause->limitOffset)))); stmt->limitOffset = limitClause->limitOffset; } if (limitClause && limitClause->limitCount) { if (stmt->limitCount) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple LIMIT clauses not allowed"), parser_errposition(exprLocation(limitClause->limitCount)))); stmt->limitCount = limitClause->limitCount; } if (limitClause) { if (stmt->limitOption) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("multiple limit options not allowed"))); if (!stmt->sortClause && limitClause->limitOption == LIMIT_OPTION_WITH_TIES) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WITH TIES cannot be specified without ORDER BY clause"))); if (limitClause->limitOption == LIMIT_OPTION_WITH_TIES && stmt->lockingClause) { ListCell *lc; foreach(lc, stmt->lockingClause) { LockingClause *lock = lfirst_node(LockingClause, lc); if (lock->waitPolicy == LockWaitSkip) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("%s and %s options cannot be used together", "SKIP LOCKED", "WITH TIES"))); } } stmt->limitOption = limitClause->limitOption; } 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 (IsA(&con->val, Integer)) { con->val.ival.ival = -con->val.ival.ival; return n; } if (IsA(&con->val, Float)) { doNegateFloat(&con->val.fval); return n; } } return (Node *) makeSimpleA_Expr(AEXPR_OP, "-", NULL, n, location); } static void doNegateFloat(Float *v) { char *oldval = v->fval; if (*oldval == '+') oldval++; if (*oldval == '-') v->fval = oldval+1; /* just strip the '-' */ else v->fval = psprintf("-%s", oldval); } static Node * makeAndExpr(Node *lexpr, Node *rexpr, int location) { /* Flatten "a AND b AND c ..." to a single BoolExpr on sight */ if (IsA(lexpr, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexpr; 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) { /* Flatten "a OR b OR c ..." to a single BoolExpr on sight */ if (IsA(lexpr, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexpr; 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_DEFAULT && 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; } /* * Convert a relation_name with name and namelist to a RangeVar using * makeRangeVar. */ static RangeVar * makeRangeVarFromQualifiedName(char *name, List *namelist, int location, core_yyscan_t yyscanner) { RangeVar *r; check_qualified_name(namelist, yyscanner); r = makeRangeVar(NULL, NULL, location); switch (list_length(namelist)) { case 1: r->catalogname = NULL; r->schemaname = name; r->relname = strVal(linitial(namelist)); break; case 2: r->catalogname = name; r->schemaname = strVal(linitial(namelist)); r->relname = strVal(lsecond(namelist)); break; default: ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", NameListToString(lcons(makeString(name), namelist))), parser_errposition(location))); break; } 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; *collClause = NULL; foreach(cell, qualList) { Node *n = (Node *) lfirst(cell); if (IsA(n, Constraint)) { /* keep it in list */ 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 = foreach_delete_current(qualList, cell); } *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))); } } /* * Parse a user-supplied partition strategy string into parse node * PartitionStrategy representation, or die trying. */ static PartitionStrategy parsePartitionStrategy(char *strategy) { if (pg_strcasecmp(strategy, "list") == 0) return PARTITION_STRATEGY_LIST; else if (pg_strcasecmp(strategy, "range") == 0) return PARTITION_STRATEGY_RANGE; else if (pg_strcasecmp(strategy, "hash") == 0) return PARTITION_STRATEGY_HASH; ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized partitioning strategy \"%s\"", strategy))); return PARTITION_STRATEGY_LIST; /* keep compiler quiet */ } /* * Process pubobjspec_list to check for errors in any of the objects and * convert PUBLICATIONOBJ_CONTINUATION into appropriate PublicationObjSpecType. */ static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner) { ListCell *cell; PublicationObjSpec *pubobj; PublicationObjSpecType prevobjtype = PUBLICATIONOBJ_CONTINUATION; if (!pubobjspec_list) return; pubobj = (PublicationObjSpec *) linitial(pubobjspec_list); if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid publication object list"), errdetail("One of TABLE or TABLES IN SCHEMA must be specified before a standalone table or schema name."), parser_errposition(pubobj->location))); foreach(cell, pubobjspec_list) { pubobj = (PublicationObjSpec *) lfirst(cell); if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION) pubobj->pubobjtype = prevobjtype; if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLE) { /* relation name or pubtable must be set for this type of object */ if (!pubobj->name && !pubobj->pubtable) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid table name"), parser_errposition(pubobj->location))); if (pubobj->name) { /* convert it to PublicationTable */ PublicationTable *pubtable = makeNode(PublicationTable); pubtable->relation = makeRangeVar(NULL, pubobj->name, pubobj->location); pubobj->pubtable = pubtable; pubobj->name = NULL; } } else if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_SCHEMA || pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA) { /* WHERE clause is not allowed on a schema object */ if (pubobj->pubtable && pubobj->pubtable->whereClause) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WHERE clause not allowed for schema"), parser_errposition(pubobj->location))); /* Column list is not allowed on a schema object */ if (pubobj->pubtable && pubobj->pubtable->columns) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("column specification not allowed for schema"), parser_errposition(pubobj->location))); /* * We can distinguish between the different type of schema * objects based on whether name and pubtable is set. */ if (pubobj->name) pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA; else if (!pubobj->name && !pubobj->pubtable) pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA; else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid schema name"), parser_errposition(pubobj->location))); } prevobjtype = pubobj->pubobjtype; } } /*---------- * 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.6.0/src/parser/README0000664000175000017500000000352514760001620013207 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.6.0/src/parser/copyfuncs.c0000664000175000017500000042155314760007565014527 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-2024, PgPool Global Development Group * Portions Copyright (c) 1996-2024, 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 an inline array */ #define COPY_ARRAY_FIELD(fldname) \ memcpy(newnode->fldname, from->fldname, sizeof(newnode->fldname)) /* 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); \ if (_size > 0) \ { \ 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(appendRelations); 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(async_capable); 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_NODE_FIELD(updateColnosLists); 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(onConflictCols); COPY_NODE_FIELD(onConflictWhere); COPY_SCALAR_FIELD(exclRelRTI); COPY_NODE_FIELD(exclRelTlist); COPY_NODE_FIELD(mergeActionLists); COPY_NODE_FIELD(mergeJoinConditions); 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_BITMAPSET_FIELD(apprelids); COPY_NODE_FIELD(appendplans); COPY_SCALAR_FIELD(nasyncplans); 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_BITMAPSET_FIELD(apprelids); 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); 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(recheckqual); 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; } /* * _copyTidRangeScan */ static TidRangeScan * _copyTidRangeScan(const TidRangeScan *from) { TidRangeScan *newnode = makeNode(TidRangeScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(tidrangequals); 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); COPY_SCALAR_FIELD(scanstatus); 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(resultRelation); 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); 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); COPY_NODE_FIELD(hashoperators); COPY_NODE_FIELD(hashcollations); COPY_NODE_FIELD(hashkeys); 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; } /* * _copyMemoize */ static Memoize * _copyMemoize(const Memoize *from) { Memoize *newnode = makeNode(Memoize); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(numKeys); COPY_POINTER_FIELD(hashOperators, sizeof(Oid) * from->numKeys); COPY_POINTER_FIELD(collations, sizeof(Oid) * from->numKeys); COPY_NODE_FIELD(param_exprs); COPY_SCALAR_FIELD(singlerow); COPY_SCALAR_FIELD(binary_mode); COPY_SCALAR_FIELD(est_entries); COPY_BITMAPSET_FIELD(keyparamids); return newnode; } /* * CopySortFields * * This function copies the fields of the Sort node. It is used by * all the copy functions for classes which inherit from Sort. */ static void CopySortFields(const Sort *from, Sort *newnode) { 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)); } /* * _copySort */ static Sort * _copySort(const Sort *from) { Sort *newnode = makeNode(Sort); /* * copy node superclass fields */ CopySortFields(from, newnode); return newnode; } /* * _copyIncrementalSort */ static IncrementalSort * _copyIncrementalSort(const IncrementalSort *from) { IncrementalSort *newnode = makeNode(IncrementalSort); /* * copy node superclass fields */ CopySortFields((const Sort *) from, (Sort *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(nPresortedCols); 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); 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_SCALAR_FIELD(transitionSpace); 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); 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); 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_NODE_FIELD(runCondition); COPY_NODE_FIELD(runConditionOrig); COPY_SCALAR_FIELD(startInRangeFunc); COPY_SCALAR_FIELD(endInRangeFunc); COPY_SCALAR_FIELD(inRangeColl); COPY_SCALAR_FIELD(inRangeAsc); COPY_SCALAR_FIELD(inRangeNullsFirst); COPY_SCALAR_FIELD(topWindow); 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_NODE_FIELD(hashkeys); 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); COPY_SCALAR_FIELD(limitOption); COPY_SCALAR_FIELD(uniqNumCols); COPY_POINTER_FIELD(uniqColIdx, from->uniqNumCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(uniqOperators, from->uniqNumCols * sizeof(Oid)); COPY_POINTER_FIELD(uniqCollations, from->uniqNumCols * sizeof(Oid)); 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_prunning_steps); COPY_NODE_FIELD(exec_prunning_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_SCALAR_FIELD(functype); 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_NODE_FIELD(colvalexprs); COPY_NODE_FIELD(passingvalexprs); COPY_BITMAPSET_FIELD(notnulls); COPY_NODE_FIELD(plan); 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(varnosyn); COPY_SCALAR_FIELD(varattnosyn); 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_SCALAR_FIELD(aggno); COPY_SCALAR_FIELD(aggtransno); 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_NODE_FIELD(runCondition); COPY_SCALAR_FIELD(winref); COPY_SCALAR_FIELD(winstar); COPY_SCALAR_FIELD(winagg); COPY_LOCATION_FIELD(location); return newnode; } static WindowFuncRunCondition * _copyWindowFuncRunCondition(const WindowFuncRunCondition *from) { WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition); COPY_SCALAR_FIELD(opno); COPY_SCALAR_FIELD(inputcollid); COPY_SCALAR_FIELD(wfunc_left); COPY_NODE_FIELD(arg); return newnode; } static MergeSupportFunc * _copyMergeSupportFunc(const MergeSupportFunc *from) { MergeSupportFunc *newnode = makeNode(MergeSupportFunc); COPY_SCALAR_FIELD(msftype); COPY_SCALAR_FIELD(msfcollid); 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(refrestype); 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(hashfuncid); COPY_SCALAR_FIELD(negfuncid); 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; } static JsonFormat * _copyJsonFormat(const JsonFormat *from) { JsonFormat *newnode = makeNode(JsonFormat); COPY_SCALAR_FIELD(format_type); COPY_SCALAR_FIELD(encoding); COPY_LOCATION_FIELD(location); return newnode; } static JsonReturning * _copyJsonReturning(const JsonReturning *from) { JsonReturning *newnode = makeNode(JsonReturning); COPY_NODE_FIELD(format); COPY_SCALAR_FIELD(typid); COPY_SCALAR_FIELD(typmod); return newnode; } static JsonValueExpr * _copyJsonValueExpr(const JsonValueExpr *from) { JsonValueExpr *newnode = makeNode(JsonValueExpr); COPY_NODE_FIELD(raw_expr); COPY_NODE_FIELD(formatted_expr); COPY_NODE_FIELD(format); return newnode; } static JsonConstructorExpr * _copyJsonConstructorExpr(const JsonConstructorExpr *from) { JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr); COPY_SCALAR_FIELD(type); COPY_NODE_FIELD(args); COPY_NODE_FIELD(func); COPY_NODE_FIELD(coercion); COPY_NODE_FIELD(returning); COPY_SCALAR_FIELD(absent_on_null); COPY_SCALAR_FIELD(unique); COPY_LOCATION_FIELD(location); return newnode; } static JsonIsPredicate * _copyJsonIsPredicate(const JsonIsPredicate *from) { JsonIsPredicate *newnode = makeNode(JsonIsPredicate); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(format); COPY_SCALAR_FIELD(item_type); COPY_SCALAR_FIELD(unique_keys); COPY_LOCATION_FIELD(location); return newnode; } static JsonBehavior * _copyJsonBehavior(const JsonBehavior *from) { JsonBehavior *newnode = makeNode(JsonBehavior); COPY_SCALAR_FIELD(btype); COPY_NODE_FIELD(expr); COPY_SCALAR_FIELD(coerce); COPY_LOCATION_FIELD(location); return newnode; } static JsonExpr * _copyJsonExpr(const JsonExpr *from) { JsonExpr *newnode = makeNode(JsonExpr); COPY_SCALAR_FIELD(op); COPY_STRING_FIELD(column_name); COPY_NODE_FIELD(formatted_expr); COPY_NODE_FIELD(format); COPY_NODE_FIELD(path_spec); COPY_NODE_FIELD(returning); COPY_NODE_FIELD(passing_names); COPY_NODE_FIELD(passing_values); COPY_NODE_FIELD(on_empty); COPY_NODE_FIELD(on_error); COPY_SCALAR_FIELD(use_io_coercion); COPY_SCALAR_FIELD(use_json_coercion); COPY_SCALAR_FIELD(wrapper); COPY_SCALAR_FIELD(omit_quotes); COPY_SCALAR_FIELD(collation); COPY_LOCATION_FIELD(location); return newnode; } static JsonTablePath * _copyJsonTablePath(const JsonTablePath *from) { JsonTablePath *newnode = makeNode(JsonTablePath); COPY_NODE_FIELD(value); COPY_STRING_FIELD(name); return newnode; } static JsonTablePathScan * _copyJsonTablePathScan(const JsonTablePathScan *from) { JsonTablePathScan *newnode = makeNode(JsonTablePathScan); COPY_NODE_FIELD(path); COPY_SCALAR_FIELD(errorOnError); COPY_NODE_FIELD(child); COPY_SCALAR_FIELD(colMin); COPY_SCALAR_FIELD(colMax); return newnode; } static JsonTableSiblingJoin * _copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from) { JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin); COPY_NODE_FIELD(lplan); COPY_NODE_FIELD(rplan); 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; } static MergeAction * _copyMergeAction(const MergeAction *from) { MergeAction *newnode = makeNode(MergeAction); COPY_SCALAR_FIELD(matchKind); COPY_SCALAR_FIELD(commandType); COPY_SCALAR_FIELD(override); COPY_NODE_FIELD(qual); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(updateColnos); 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(join_using_alias); 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; } static GroupByOrdering * _copyGroupByOrdering(const GroupByOrdering *from) { GroupByOrdering *newnode = makeNode(GroupByOrdering); COPY_NODE_FIELD(pathkeys); COPY_NODE_FIELD(clauses); 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(has_volatile); 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); COPY_SCALAR_FIELD(left_hasheqoperator); COPY_SCALAR_FIELD(right_hasheqoperator); 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(num_child_cols); COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber)); 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_NODE_FIELD(alias); COPY_NODE_FIELD(eref); COPY_SCALAR_FIELD(rtekind); COPY_SCALAR_FIELD(relid); COPY_SCALAR_FIELD(inh); COPY_SCALAR_FIELD(relkind); COPY_SCALAR_FIELD(rellockmode); COPY_SCALAR_FIELD(perminfoindex); COPY_NODE_FIELD(tablesample); COPY_NODE_FIELD(subquery); COPY_SCALAR_FIELD(security_barrier); COPY_SCALAR_FIELD(jointype); COPY_SCALAR_FIELD(joinmergedcols); COPY_NODE_FIELD(joinaliasvars); COPY_NODE_FIELD(joinleftcols); COPY_NODE_FIELD(joinrightcols); COPY_NODE_FIELD(join_using_alias); 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_SCALAR_FIELD(lateral); COPY_SCALAR_FIELD(inFromCl); 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 CTESearchClause * _copyCTESearchClause(const CTESearchClause *from) { CTESearchClause *newnode = makeNode(CTESearchClause); COPY_NODE_FIELD(search_col_list); COPY_SCALAR_FIELD(search_breadth_first); COPY_STRING_FIELD(search_seq_column); COPY_LOCATION_FIELD(location); return newnode; } static CTECycleClause * _copyCTECycleClause(const CTECycleClause *from) { CTECycleClause *newnode = makeNode(CTECycleClause); COPY_NODE_FIELD(cycle_col_list); COPY_STRING_FIELD(cycle_mark_column); COPY_NODE_FIELD(cycle_mark_value); COPY_NODE_FIELD(cycle_mark_default); COPY_STRING_FIELD(cycle_path_column); COPY_LOCATION_FIELD(location); COPY_SCALAR_FIELD(cycle_mark_type); COPY_SCALAR_FIELD(cycle_mark_typmod); COPY_SCALAR_FIELD(cycle_mark_collation); COPY_SCALAR_FIELD(cycle_mark_neop); 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_NODE_FIELD(search_clause); COPY_NODE_FIELD(cycle_clause); 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 MergeWhenClause * _copyMergeWhenClause(const MergeWhenClause *from) { MergeWhenClause *newnode = makeNode(MergeWhenClause); COPY_SCALAR_FIELD(matchKind); COPY_SCALAR_FIELD(commandType); COPY_SCALAR_FIELD(override); COPY_NODE_FIELD(condition); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(values); return newnode; } static A_Expr * _copyA_Expr(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 * _copyA_Const(const A_Const *from) { A_Const *newnode = makeNode(A_Const); COPY_SCALAR_FIELD(isnull); if (!from->isnull) { /* This part must duplicate other _copy*() functions. */ COPY_SCALAR_FIELD(val.node.type); switch (nodeTag(&from->val)) { case T_Integer: COPY_SCALAR_FIELD(val.ival.ival); break; case T_Float: COPY_STRING_FIELD(val.fval.fval); break; case T_Boolean: COPY_SCALAR_FIELD(val.boolval.boolval); break; case T_String: COPY_STRING_FIELD(val.sval.sval); break; case T_BitString: COPY_STRING_FIELD(val.bsval.bsval); break; default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(&from->val)); 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_NODE_FIELD(over); COPY_SCALAR_FIELD(agg_within_group); COPY_SCALAR_FIELD(agg_star); COPY_SCALAR_FIELD(agg_distinct); COPY_SCALAR_FIELD(func_variadic); COPY_SCALAR_FIELD(funcformat); COPY_LOCATION_FIELD(location); return newnode; } static A_Star * _copyA_Star(const A_Star *from) { A_Star *newnode = makeNode(A_Star); return newnode; } static A_Indices * _copyA_Indices(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_NODE_FIELD(opclassopts); COPY_SCALAR_FIELD(ordering); COPY_SCALAR_FIELD(nulls_ordering); return newnode; } static StatsElem * _copyStatsElem(const StatsElem *from) { StatsElem *newnode = makeNode(StatsElem); COPY_STRING_FIELD(name); COPY_NODE_FIELD(expr); return newnode; } static ColumnDef * _copyColumnDef(const ColumnDef *from) { ColumnDef *newnode = makeNode(ColumnDef); COPY_STRING_FIELD(colname); COPY_NODE_FIELD(typeName); COPY_STRING_FIELD(compression); 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_SCALAR_FIELD(skip_validation); COPY_SCALAR_FIELD(initially_valid); COPY_SCALAR_FIELD(is_no_inherit); COPY_NODE_FIELD(raw_expr); COPY_STRING_FIELD(cooked_expr); COPY_SCALAR_FIELD(generated_when); COPY_SCALAR_FIELD(inhcount); COPY_SCALAR_FIELD(nulls_not_distinct); 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(fk_del_set_cols); COPY_NODE_FIELD(old_conpfeqop); COPY_SCALAR_FIELD(old_pktable_oid); COPY_LOCATION_FIELD(location); 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 JsonOutput * _copyJsonOutput(const JsonOutput *from) { JsonOutput *newnode = makeNode(JsonOutput); COPY_NODE_FIELD(typeName); COPY_NODE_FIELD(returning); return newnode; } static JsonArgument * _copyJsonArgument(const JsonArgument *from) { JsonArgument *newnode = makeNode(JsonArgument); COPY_NODE_FIELD(val); COPY_STRING_FIELD(name); return newnode; } static JsonFuncExpr * _copyJsonFuncExpr(const JsonFuncExpr *from) { JsonFuncExpr *newnode = makeNode(JsonFuncExpr); COPY_SCALAR_FIELD(op); COPY_STRING_FIELD(column_name); COPY_NODE_FIELD(context_item); COPY_NODE_FIELD(pathspec); COPY_NODE_FIELD(passing); COPY_NODE_FIELD(output); COPY_NODE_FIELD(on_empty); COPY_NODE_FIELD(on_error); COPY_SCALAR_FIELD(wrapper); COPY_SCALAR_FIELD(quotes); COPY_LOCATION_FIELD(location); return newnode; } static JsonTablePathSpec * _copyJsonTablePathSpec(const JsonTablePathSpec *from) { JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec); COPY_NODE_FIELD(string); COPY_STRING_FIELD(name); COPY_LOCATION_FIELD(name_location); COPY_LOCATION_FIELD(location); return newnode; } static JsonTable * _copyJsonTable(const JsonTable *from) { JsonTable *newnode = makeNode(JsonTable); COPY_NODE_FIELD(context_item); COPY_NODE_FIELD(pathspec); COPY_NODE_FIELD(passing); COPY_NODE_FIELD(columns); COPY_NODE_FIELD(on_error); COPY_NODE_FIELD(alias); COPY_SCALAR_FIELD(lateral); COPY_LOCATION_FIELD(location); return newnode; } static JsonTableColumn * _copyJsonTableColumn(const JsonTableColumn *from) { JsonTableColumn *newnode = makeNode(JsonTableColumn); COPY_SCALAR_FIELD(coltype); COPY_STRING_FIELD(name); COPY_NODE_FIELD(typeName); COPY_NODE_FIELD(pathspec); COPY_NODE_FIELD(format); COPY_SCALAR_FIELD(wrapper); COPY_SCALAR_FIELD(quotes); COPY_NODE_FIELD(columns); COPY_NODE_FIELD(on_empty); COPY_NODE_FIELD(on_error); COPY_LOCATION_FIELD(location); return newnode; } static JsonKeyValue * _copyJsonKeyValue(const JsonKeyValue *from) { JsonKeyValue *newnode = makeNode(JsonKeyValue); COPY_NODE_FIELD(key); COPY_NODE_FIELD(value); return newnode; } static JsonParseExpr * _copyJsonParseExpr(const JsonParseExpr *from) { JsonParseExpr *newnode = makeNode(JsonParseExpr); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(output); COPY_SCALAR_FIELD(unique_keys); COPY_LOCATION_FIELD(location); return newnode; } static JsonScalarExpr * _copyJsonScalarExpr(const JsonScalarExpr *from) { JsonScalarExpr *newnode = makeNode(JsonScalarExpr); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(output); COPY_LOCATION_FIELD(location); return newnode; } static JsonSerializeExpr * _copyJsonSerializeExpr(const JsonSerializeExpr *from) { JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(output); COPY_LOCATION_FIELD(location); return newnode; } static JsonObjectConstructor * _copyJsonObjectConstructor(const JsonObjectConstructor *from) { JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor); COPY_NODE_FIELD(exprs); COPY_NODE_FIELD(output); COPY_SCALAR_FIELD(absent_on_null); COPY_SCALAR_FIELD(unique); COPY_LOCATION_FIELD(location); return newnode; } static JsonArrayConstructor * _copyJsonArrayConstructor(const JsonArrayConstructor *from) { JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor); COPY_NODE_FIELD(exprs); COPY_NODE_FIELD(output); COPY_SCALAR_FIELD(absent_on_null); COPY_LOCATION_FIELD(location); return newnode; } static JsonArrayQueryConstructor * _copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from) { JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor); COPY_NODE_FIELD(query); COPY_NODE_FIELD(output); COPY_NODE_FIELD(format); COPY_SCALAR_FIELD(absent_on_null); COPY_LOCATION_FIELD(location); return newnode; } static JsonAggConstructor * _copyJsonAggConstructor(const JsonAggConstructor *from) { JsonAggConstructor *newnode = makeNode(JsonAggConstructor); COPY_NODE_FIELD(output); COPY_NODE_FIELD(agg_filter); COPY_NODE_FIELD(agg_order); COPY_NODE_FIELD(over); COPY_LOCATION_FIELD(location); return newnode; } static JsonObjectAgg * _copyJsonObjectAgg(const JsonObjectAgg *from) { JsonObjectAgg *newnode = makeNode(JsonObjectAgg); COPY_NODE_FIELD(constructor); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(absent_on_null); COPY_SCALAR_FIELD(unique); return newnode; } static JsonArrayAgg * _copyJsonArrayAgg(const JsonArrayAgg *from) { JsonArrayAgg *newnode = makeNode(JsonArrayAgg); COPY_NODE_FIELD(constructor); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(absent_on_null); 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_SCALAR_FIELD(isReturn); COPY_NODE_FIELD(cteList); COPY_NODE_FIELD(rtable); COPY_NODE_FIELD(rteperminfos); COPY_NODE_FIELD(jointree); COPY_NODE_FIELD(mergeActionList); COPY_SCALAR_FIELD(mergeTargetRelation); COPY_NODE_FIELD(mergeJoinCondition); COPY_NODE_FIELD(targetList); COPY_SCALAR_FIELD(override); COPY_NODE_FIELD(onConflict); COPY_NODE_FIELD(returningList); COPY_NODE_FIELD(groupClause); COPY_SCALAR_FIELD(groupDistinct); 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_SCALAR_FIELD(limitOption); 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 MergeStmt * _copyMergeStmt(const MergeStmt *from) { MergeStmt *newnode = makeNode(MergeStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(sourceRelation); COPY_NODE_FIELD(joinCondition); COPY_NODE_FIELD(mergeWhenClauses); 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_SCALAR_FIELD(groupDistinct); 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_SCALAR_FIELD(limitOption); 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 ReturnStmt * _copyReturnStmt(const ReturnStmt *from) { ReturnStmt *newnode = makeNode(ReturnStmt); COPY_NODE_FIELD(returnval); return newnode; } static PLAssignStmt * _copyPLAssignStmt(const PLAssignStmt *from) { PLAssignStmt *newnode = makeNode(PLAssignStmt); COPY_STRING_FIELD(name); COPY_NODE_FIELD(indirection); COPY_SCALAR_FIELD(nnames); COPY_NODE_FIELD(val); COPY_LOCATION_FIELD(location); return newnode; } static AlterTableStmt * _copyAlterTableStmt(const AlterTableStmt *from) { AlterTableStmt *newnode = makeNode(AlterTableStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(cmds); COPY_SCALAR_FIELD(objtype); 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); COPY_SCALAR_FIELD(recurse); 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_NODE_FIELD(grantor); 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_NODE_FIELD(objfuncargs); 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(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); COPY_NODE_FIELD(outargs); return newnode; } static ClusterStmt * _copyClusterStmt(const ClusterStmt *from) { ClusterStmt *newnode = makeNode(ClusterStmt); COPY_NODE_FIELD(relation); COPY_STRING_FIELD(indexname); COPY_NODE_FIELD(params); 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); COPY_SCALAR_FIELD(relationOid); 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(oldNumber); COPY_SCALAR_FIELD(oldCreateSubid); COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid); COPY_SCALAR_FIELD(unique); COPY_SCALAR_FIELD(nulls_not_distinct); 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(transformed); COPY_SCALAR_FIELD(if_not_exists); return newnode; } static AlterStatsStmt * _copyAlterStatsStmt(const AlterStatsStmt *from) { AlterStatsStmt *newnode = makeNode(AlterStatsStmt); COPY_NODE_FIELD(defnames); COPY_NODE_FIELD(stxstattarget); COPY_SCALAR_FIELD(missing_ok); 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); COPY_NODE_FIELD(sql_body); 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); COPY_SCALAR_FIELD(remove); 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 AlterTypeStmt * _copyAlterTypeStmt(const AlterTypeStmt *from) { AlterTypeStmt *newnode = makeNode(AlterTypeStmt); COPY_NODE_FIELD(typeName); 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); COPY_LOCATION_FIELD(location); 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 AlterDatabaseRefreshCollStmt * _copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from) { AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt); COPY_STRING_FIELD(dbname); 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); COPY_NODE_FIELD(options); 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(objtype); 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_SCALAR_FIELD(replace); COPY_SCALAR_FIELD(isconstraint); 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_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_NODE_FIELD(params); 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); COPY_SCALAR_FIELD(isall); COPY_LOCATION_FIELD(location); 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_SCALAR_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 SinglePartitionSpec * _copySinglePartitionSpec(const SinglePartitionSpec *from) { SinglePartitionSpec *newnode = makeNode(SinglePartitionSpec); return newnode; } static PartitionCmd * _copyPartitionCmd(const PartitionCmd *from) { PartitionCmd *newnode = makeNode(PartitionCmd); COPY_NODE_FIELD(name); COPY_NODE_FIELD(bound); COPY_SCALAR_FIELD(concurrent); return newnode; } static PublicationObjSpec * _copyPublicationObject(const PublicationObjSpec *from) { PublicationObjSpec *newnode = makeNode(PublicationObjSpec); COPY_SCALAR_FIELD(pubobjtype); COPY_STRING_FIELD(name); COPY_NODE_FIELD(pubtable); COPY_LOCATION_FIELD(location); return newnode; } static PublicationTable * _copyPublicationTable(const PublicationTable *from) { PublicationTable *newnode = makeNode(PublicationTable); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(whereClause); COPY_NODE_FIELD(columns); return newnode; } static CreatePublicationStmt * _copyCreatePublicationStmt(const CreatePublicationStmt *from) { CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt); COPY_STRING_FIELD(pubname); COPY_NODE_FIELD(options); COPY_NODE_FIELD(pubobjects); 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(pubobjects); COPY_SCALAR_FIELD(for_all_tables); COPY_SCALAR_FIELD(action); 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; } #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 Integer * _copyInteger(const Integer *from) { Integer *newnode = makeNode(Integer); COPY_SCALAR_FIELD(ival); return newnode; } static Float * _copyFloat(const Float *from) { Float *newnode = makeNode(Float); COPY_STRING_FIELD(fval); return newnode; } static Boolean * _copyBoolean(const Boolean *from) { Boolean *newnode = makeNode(Boolean); COPY_SCALAR_FIELD(boolval); return newnode; } static String * _copyString(const String *from) { String *newnode = makeNode(String); COPY_STRING_FIELD(sval); return newnode; } static BitString * _copyBitString(const BitString *from) { BitString *newnode = makeNode(BitString); COPY_STRING_FIELD(bsval); 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_ARRAY_FIELD(conkey); COPY_ARRAY_FIELD(confkey); COPY_ARRAY_FIELD(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_TidRangeScan: retval = _copyTidRangeScan(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_Memoize: retval = _copyMemoize(from); break; case T_Sort: retval = _copySort(from); break; case T_IncrementalSort: retval = _copyIncrementalSort(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_WindowFuncRunCondition: retval = _copyWindowFuncRunCondition(from); break; case T_MergeSupportFunc: retval = _copyMergeSupportFunc(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_JsonFormat: retval = _copyJsonFormat(from); break; case T_JsonReturning: retval = _copyJsonReturning(from); break; case T_JsonValueExpr: retval = _copyJsonValueExpr(from); break; case T_JsonConstructorExpr: retval = _copyJsonConstructorExpr(from); break; case T_JsonIsPredicate: retval = _copyJsonIsPredicate(from); break; case T_JsonBehavior: retval = _copyJsonBehavior(from); break; case T_JsonExpr: retval = _copyJsonExpr(from); break; case T_JsonTablePath: retval = _copyJsonTablePath(from); break; case T_JsonTablePathScan: retval = _copyJsonTablePathScan(from); break; case T_JsonTableSiblingJoin: retval = _copyJsonTableSiblingJoin(from); break; case T_NullTest: retval = _copyNullTest(from); break; case T_BooleanTest: retval = _copyBooleanTest(from); break; case T_MergeAction: retval = _copyMergeAction(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_GroupByOrdering: retval = _copyGroupByOrdering(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: retval = _copyInteger(from); break; case T_Float: retval = _copyFloat(from); break; case T_Boolean: retval = _copyBoolean(from); break; case T_String: retval = _copyString(from); break; case T_BitString: retval = _copyBitString(from); break; /* * LIST NODES */ case T_List: retval = list_copy_deep(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: case T_XidList: 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_MergeStmt: retval = _copyMergeStmt(from); break; case T_SelectStmt: retval = _copySelectStmt(from); break; case T_SetOperationStmt: retval = _copySetOperationStmt(from); break; case T_ReturnStmt: retval = _copyReturnStmt(from); break; case T_PLAssignStmt: retval = _copyPLAssignStmt(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_AlterStatsStmt: retval = _copyAlterStatsStmt(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_AlterTypeStmt: retval = _copyAlterTypeStmt(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_AlterDatabaseRefreshCollStmt: retval = _copyAlterDatabaseRefreshCollStmt(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 = _copyA_Expr(from); break; case T_ColumnRef: retval = _copyColumnRef(from); break; case T_ParamRef: retval = _copyParamRef(from); break; case T_A_Const: retval = _copyA_Const(from); break; case T_FuncCall: retval = _copyFuncCall(from); break; case T_A_Star: retval = _copyA_Star(from); break; case T_A_Indices: retval = _copyA_Indices(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_StatsElem: retval = _copyStatsElem(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_CTESearchClause: retval = _copyCTESearchClause(from); break; case T_CTECycleClause: retval = _copyCTECycleClause(from); break; case T_CommonTableExpr: retval = _copyCommonTableExpr(from); break; case T_MergeWhenClause: retval = _copyMergeWhenClause(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_JsonOutput: retval = _copyJsonOutput(from); break; case T_JsonArgument: retval = _copyJsonArgument(from); break; case T_JsonFuncExpr: retval = _copyJsonFuncExpr(from); break; case T_JsonTablePathSpec: retval = _copyJsonTablePathSpec(from); break; case T_JsonTable: retval = _copyJsonTable(from); break; case T_JsonTableColumn: retval = _copyJsonTableColumn(from); break; case T_JsonKeyValue: retval = _copyJsonKeyValue(from); break; case T_JsonParseExpr: retval = _copyJsonParseExpr(from); break; case T_JsonScalarExpr: retval = _copyJsonScalarExpr(from); break; case T_JsonSerializeExpr: retval = _copyJsonSerializeExpr(from); break; case T_JsonObjectConstructor: retval = _copyJsonObjectConstructor(from); break; case T_JsonArrayConstructor: retval = _copyJsonArrayConstructor(from); break; case T_JsonArrayQueryConstructor: retval = _copyJsonArrayQueryConstructor(from); break; case T_JsonAggConstructor: retval = _copyJsonAggConstructor(from); break; case T_JsonObjectAgg: retval = _copyJsonObjectAgg(from); break; case T_JsonArrayAgg: retval = _copyJsonArrayAgg(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_SinglePartitionSpec: retval = _copySinglePartitionSpec(from); break; case T_PartitionCmd: retval = _copyPartitionCmd(from); break; case T_PublicationObjSpec: retval = _copyPublicationObject(from); break; case T_PublicationTable: retval = _copyPublicationTable(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.6.0/src/parser/gram.y0000664000175000017500000172747514760007565013507 00000000000000%{ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2024, PgPool Global Development Group * Portions Copyright (c) 1996-2024, 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 "utils/pgstrcasecmp.h" #include #include #include #include #include #include "nodes.h" #include "keywords.h" #include "gramparse.h" #include "makefuncs.h" #include "parser.h" #include "pg_class.h" #include "pg_trigger.h" /* * Definition taken from * postgreSQL source code file: src/include/commands/trigger.h */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' /* * Definition taken from * postgreSQL source code file: src/include/catalog/pg_class.h */ #define REPLICA_IDENTITY_DEFAULT 'd' #define REPLICA_IDENTITY_NOTHING 'n' #define REPLICA_IDENTITY_FULL 'f' #define REPLICA_IDENTITY_INDEX 'i' /* * Definition taken from * postgreSQL source code file: src/include/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. */ #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; /* Private struct for the result of opt_select_limit production */ typedef struct SelectLimit { Node *limitOffset; Node *limitCount; LimitOption limitOption; } SelectLimit; /* Private struct for the result of group_clause production */ typedef struct GroupClause { bool distinct; List *list; } GroupClause; /* Private structs for the result of key_actions and key_action productions */ typedef struct KeyAction { char action; List *cols; } KeyAction; typedef struct KeyActions { KeyAction *updateAction; KeyAction *deleteAction; } KeyActions; /* 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 *makeFloatConst(char *str, int location); static Node *makeBoolAConst(bool state, int location); static Node *makeBitStringConst(char *str, int location); static Node *makeNullAConst(int location); static Node *makeAConst(Node *v, 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, SelectLimit *limitClause, 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(Float *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 RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location, 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 PartitionStrategy parsePartitionStrategy(char *strategy); static void preprocess_pubobj_list(List *pubobjspec_list, 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; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; StatsElem *selem; 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; PublicationObjSpec *publicationobjectspec; struct SelectLimit *selectlimit; SetQuantifier setquantifier; struct GroupClause *groupclause; MergeMatchKind mergematch; MergeWhenClause *mergewhen; struct KeyActions *keyactions; struct KeyAction *keyaction; } %type stmt toplevel_stmt schema_stmt routine_body_stmt AlterEventTrigStmt AlterCollationStmt AlterDatabaseStmt AlterDatabaseSetStmt AlterDomainStmt AlterEnumStmt AlterFdwStmt AlterForeignServerStmt AlterGroupStmt AlterObjectDependsStmt AlterObjectSchemaStmt AlterOwnerStmt AlterOperatorStmt AlterTypeStmt AlterSeqStmt AlterSystemStmt AlterTableStmt AlterTblSpcStmt AlterExtensionStmt AlterExtensionContentsStmt AlterCompositeTypeStmt AlterUserMappingStmt AlterRoleStmt AlterRoleSetStmt AlterPolicyStmt AlterStatsStmt 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 DropStmt DropCastStmt DropRoleStmt DropdbStmt DropTableSpaceStmt DropTransformStmt DropUserMappingStmt ExplainStmt FetchStmt GrantStmt GrantRoleStmt ImportForeignSchemaStmt IndexStmt InsertStmt ListenStmt LoadStmt LockStmt MergeStmt NotifyStmt ExplainableStmt PreparableStmt CreateFunctionStmt AlterFunctionStmt ReindexStmt RemoveAggrStmt RemoveFuncStmt RemoveOperStmt RenameStmt ReturnStmt RevokeStmt RevokeRoleStmt RuleActionStmt RuleActionStmtOrEmpty RuleStmt SecLabelStmt SelectStmt TransactionStmt TransactionStmtLegacy 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 PLpgSQL_Expr PLAssignStmt %type opt_single_name %type opt_qualified_name %type opt_concurrently %type opt_drop_behavior %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 set_statistics_value %type set_access_method_name %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 utility_option_name %type utility_option_elem %type utility_option_list %type utility_option_arg %type drop_option %type opt_or_replace opt_no opt_grant_grant_option opt_nowait opt_if_exists opt_with_data opt_transaction_chain %type grant_role_opt_list %type grant_role_opt %type grant_role_opt_value %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 parameter_name %type OptSchemaEltList parameter_name_list %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 access_method_clause attr_name table_access_method_clause name cursor_name file_name cluster_index_specification %type func_name handler_name qual_Op qual_all_Op subquery_Op 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 opt_select_limit select_limit limit_clause %type parse_toplevel stmtmulti routine_body_stmt_list OptTableElementList TableElementList OptInherit definition OptTypedTableElementList TypedTableElementList reloptions opt_reloptions OptWith 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 opt_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 stats_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 distinct_clause opt_distinct_clause target_list opt_target_list insert_column_list set_target_list merge_values_clause set_clause_list set_clause def_list operator_def_list indirection opt_indirection reloption_list TriggerFuncArgs 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 vacuum_relation_list opt_vacuum_relation_list drop_option_list pub_obj_list %type opt_routine_body %type group_clause %type group_by_list %type group_by_item empty_grouping_set rollup_clause cube_clause %type grouping_sets_clause %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 set_quantifier %type join_qual %type join_type %type extract_list overlay_list position_list %type substr_list trim_list %type opt_interval interval_second %type unicode_normal_form %type opt_instead %type opt_unique opt_verbose opt_full %type opt_freeze opt_analyze opt_default opt_recheck %type opt_binary copy_delimiter %type copy_from opt_program %type event cursor_options opt_hold opt_set_data %type object_type_any_name object_type_name object_type_name_on_any_name drop_type_name %type fetch_args 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 merge_insert merge_update merge_delete %type merge_when_tgt_matched merge_when_tgt_not_matched %type merge_when_clause opt_merge_when_condition %type merge_when_list %type generic_set set_rest set_rest_more generic_reset reset_rest SetResetClause FunctionSetResetClause %type TableElement TypedTableElement ConstraintElem DomainConstraintElem 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 OptWhereClause operator_def_arg %type rowsfrom_item rowsfrom_list opt_col_def_list %type opt_ordinality %type ExclusionConstraintList ExclusionConstraintElem %type func_arg_list func_arg_list_opt %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 opt_search_clause opt_cycle_clause %type sub_type opt_materialized %type NumericOnly %type NumericOnly_list %type alias_clause opt_alias_clause opt_alias_clause_for_join_using %type func_alias_clause %type sortby %type index_elem index_elem_options %type stats_param %type table_ref %type joined_table %type relation_expr %type extended_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 reindex_target_relation reindex_target_all %type opt_reindex_option_list %type copy_generic_opt_arg copy_generic_opt_arg_list_item %type copy_generic_opt_elem %type copy_generic_opt_list copy_generic_opt_arg_list %type copy_options %type Typename SimpleTypename ConstTypename GenericType Numeric opt_float JsonType 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 BareColLabel %type NonReservedWord NonReservedWord_or_Sconst %type var_name type_function_name param_name %type createdb_opt_name plassign_target %type var_value zone_value %type auth_ident RoleSpec opt_granted_by %type PublicationObjSpec %type unreserved_keyword type_func_name_keyword %type col_name_keyword reserved_keyword %type bare_label_keyword %type DomainConstraint TableConstraint TableLikeClause %type TableLikeOptionList TableLikeOption %type column_compression opt_column_compression column_storage opt_column_storage %type ColQualList %type ColConstraint ColConstraintElem ConstraintAttr %type key_match %type key_delete key_update key_action %type key_actions %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_indent_option 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 opt_unique_null_treatment %type generated_when override_kind %type PartitionSpec OptPartitionSpec %type part_elem %type part_params %type PartitionBoundSpec %type hash_partbound %type hash_partbound_elem %type json_format_clause json_format_clause_opt json_value_expr json_returning_clause_opt json_name_and_value json_aggregate_func json_argument json_behavior json_on_error_clause_opt json_table json_table_column_definition json_table_column_path_clause_opt %type json_name_and_value_list json_value_expr_list json_array_aggregate_order_by_clause_opt json_arguments json_behavior_clause_opt json_passing_clause_opt json_table_column_definition_list %type json_table_path_name_opt %type json_behavior_type json_predicate_type_constraint json_quotes_clause_opt json_wrapper_behavior %type json_key_uniqueness_constraint_opt json_object_constructor_null_clause_opt json_array_constructor_null_clause_opt /* * 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! * * UIDENT and USCONST are reduced to IDENT and SCONST in parser.c, so that * they need no productions here; but we must assign token codes to them. * * DOT_DOT is unused in the core SQL grammar, and so will always provoke * parse errors. It is needed by PL/pgSQL. */ %token IDENT UIDENT FCONST SCONST USCONST 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 ABSENT ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC ATOMIC AT ATTACH ATTRIBUTE AUTHORIZATION BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT BOOLEAN_P BOTH BREADTH 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 COMPRESSION CONCURRENTLY CONDITIONAL 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 DEPTH DESC DETACH DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P DOUBLE_P DROP EACH ELSE EMPTY_P ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ERROR_P ESCAPE EVENT EXCEPT EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN EXPRESSION EXTENSION EXTERNAL EXTRACT FALSE_P FAMILY FETCH FILTER FINALIZE FIRST_P FLOAT_P FOLLOWING FOR FORCE FOREIGN FORMAT 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 INDENT 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 JSON JSON_ARRAY JSON_ARRAYAGG JSON_EXISTS JSON_OBJECT JSON_OBJECTAGG JSON_QUERY JSON_SCALAR JSON_SERIALIZE JSON_TABLE JSON_VALUE KEEP KEY KEYS 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 MATCHED MATERIALIZED MAXVALUE MERGE MERGE_ACTION METHOD MINUTE_P MINVALUE MODE MONTH_P MOVE NAME_P NAMES NATIONAL NATURAL NCHAR NESTED NEW NEXT NFC NFD NFKC NFKD NO NONE NORMALIZE NORMALIZED NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF NULLS_P NUMERIC OBJECT_P OF OFF OFFSET OIDS OLD OMIT ON ONLY OPERATOR OPTION OPTIONS OR ORDER ORDINALITY OTHERS OUT_P OUTER_P OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER PARALLEL PARAMETER PARSER PARTIAL PARTITION PASSING PASSWORD PATH PGPOOL PLACING PLAN PLANS POLICY POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION QUOTE QUOTES RANGE READ REAL REASSIGN RECHECK RECURSIVE REF_P REFERENCES REFERENCING REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA RESET RESTART RESTRICT RETURN RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP ROUTINE ROUTINES ROW ROWS RULE SAVEPOINT SCALAR 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 SOURCE SQL_P STABLE STANDALONE_P START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRING_P STRIP_P SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER TABLE TABLES TABLESAMPLE TABLESPACE TARGET TEMP TEMPLATE TEMPORARY TEXT_P THEN TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM TREAT TRIGGER TRIM TRUE_P TRUNCATE TRUSTED TYPE_P TYPES_P UESCAPE UNBOUNDED UNCONDITIONAL 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. * FORMAT_LA, NULLS_LA, WITH_LA, and WITHOUT_LA are needed to make the grammar * LALR(1). */ %token FORMAT_LA NOT_LA NULLS_LA WITH_LA WITHOUT_LA /* * The grammar likewise thinks these tokens are keywords, but they are never * generated by the scanner. Rather, they can be injected by parser.c as * the initial token of the string (using the lookahead-token mechanism * implemented there). This provides a way to tell the grammar to parse * something other than the usual list of SQL commands. */ %token MODE_TYPE_NAME %token MODE_PLPGSQL_EXPR %token MODE_PLPGSQL_ASSIGN1 %token MODE_PLPGSQL_ASSIGN2 %token MODE_PLPGSQL_ASSIGN3 /* Precedence: lowest to highest */ %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 */ /* * Sometimes it is necessary to assign precedence to keywords that are not * really part of the operator hierarchy, in order to resolve grammar * ambiguities. It's best to avoid doing so whenever possible, because such * assignments have global effect and may hide ambiguities besides the one * you intended to solve. (Attaching a precedence to a single rule with * %prec is far safer and should be preferred.) If you must give precedence * to a new keyword, try very hard to give it the same precedence as IDENT. * If the keyword has IDENT's precedence then it clearly acts the same as * non-keywords and other similar keywords, thus reducing the risk of * unexpected precedence effects. * * We used to need to assign IDENT an explicit precedence just less than Op, * to support target_el without AS. While that's not really necessary since * we removed postfix operators, we continue to do so because it provides a * reference point for a precedence level that we can assign to other * keywords that lack a natural precedence level. * * We need to do this for PARTITION, RANGE, ROWS, and GROUPS to support * opt_existing_window_name (see comment there). * * 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. * * 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. * * SET is likewise assigned the same precedence as IDENT, to support the * relation_expr_opt_alias production (see comment there). * * KEYS, OBJECT_P, SCALAR, VALUE_P, WITH, and WITHOUT are similarly assigned * the same precedence as IDENT. This allows resolving conflicts in the * json_predicate_type_constraint and json_key_uniqueness_constraint_opt * productions (see comments there). * * Like the UNBOUNDED PRECEDING/FOLLOWING case, NESTED is assigned a lower * precedence than PATH to fix ambiguity in the json_table production. */ %nonassoc UNBOUNDED NESTED /* ideally would have same precedence as IDENT */ %nonassoc IDENT PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP SET KEYS OBJECT_P SCALAR VALUE_P WITH WITHOUT PATH %left Op OPERATOR /* multi-character ops and user-defined operators */ %left '+' '-' %left '*' '/' '%' %left '^' /* Unary Operators */ %left AT /* sets precedence for AT TIME ZONE, AT LOCAL */ %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 %% /* * The target production for the whole parse. * * Ordinarily we parse a list of statements, but if we see one of the * special MODE_XXX symbols as first token, we parse something else. * The options here correspond to enum RawParseMode, which see for details. */ parse_toplevel: stmtmulti { pg_yyget_extra(yyscanner)->parsetree = $1; (void) yynerrs; /* suppress compiler warning */ } | MODE_TYPE_NAME Typename { pg_yyget_extra(yyscanner)->parsetree = list_make1($2); } | MODE_PLPGSQL_EXPR PLpgSQL_Expr { pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt($2, 0)); } | MODE_PLPGSQL_ASSIGN1 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 1; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } | MODE_PLPGSQL_ASSIGN2 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 2; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } | MODE_PLPGSQL_ASSIGN3 PLAssignStmt { PLAssignStmt *n = (PLAssignStmt *) $2; n->nnames = 3; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((Node *) n, 0)); } ; /* * 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 ';' toplevel_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; } | toplevel_stmt { if ($1 != NULL) $$ = list_make1(makeRawStmt($1, 0)); else $$ = NIL; } ; /* * toplevel_stmt includes BEGIN and END. stmt does not include them, because * those words have different meanings in function bodies. */ toplevel_stmt: stmt | TransactionStmtLegacy ; stmt: AlterEventTrigStmt | AlterCollationStmt | AlterDatabaseStmt | AlterDatabaseSetStmt | AlterDefaultPrivilegesStmt | AlterDomainStmt | AlterEnumStmt | AlterExtensionStmt | AlterExtensionContentsStmt | AlterFdwStmt | AlterForeignServerStmt | AlterFunctionStmt | AlterGroupStmt | AlterObjectDependsStmt | AlterObjectSchemaStmt | AlterOwnerStmt | AlterOperatorStmt | AlterTypeStmt | AlterPolicyStmt | AlterSeqStmt | AlterSystemStmt | AlterTableStmt | AlterTblSpcStmt | AlterCompositeTypeStmt | AlterPublicationStmt | AlterRoleSetStmt | AlterRoleStmt | AlterSubscriptionStmt | AlterStatsStmt | 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 | DropStmt | DropSubscriptionStmt | DropTableSpaceStmt | DropTransformStmt | DropRoleStmt | DropUserMappingStmt | DropdbStmt | ExecuteStmt | ExplainStmt | FetchStmt | GrantStmt | GrantRoleStmt | ImportForeignSchemaStmt | IndexStmt | InsertStmt | ListenStmt | RefreshMatViewStmt | LoadStmt | LockStmt | MergeStmt | NotifyStmt | PrepareStmt | ReassignOwnedStmt | ReindexStmt | RemoveAggrStmt | RemoveFuncStmt | RemoveOperStmt | RenameStmt | RevokeStmt | RevokeRoleStmt | RuleStmt | SecLabelStmt | SelectStmt | TransactionStmt | TruncateStmt | UnlistenStmt | UpdateStmt | VacuumStmt | VariableResetStmt | VariableSetStmt | VariableShowStmt | ViewStmt | /*EMPTY*/ { $$ = NULL; } ; /* * Generic supporting productions for DDL */ opt_single_name: ColId { $$ = $1; } | /* EMPTY */ { $$ = NULL; } ; opt_qualified_name: any_name { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; opt_concurrently: CONCURRENTLY { $$ = true; } | /*EMPTY*/ { $$ = false; } ; opt_drop_behavior: CASCADE { $$ = DROP_CASCADE; } | RESTRICT { $$ = DROP_RESTRICT; } | /* EMPTY */ { $$ = DROP_RESTRICT; /* default */ } ; /***************************************************************************** * * 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 *) makeBoolean(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 *) makeBoolean(true), @1); else if (strcmp($1, "nosuperuser") == 0) $$ = makeDefElem("superuser", (Node *) makeBoolean(false), @1); else if (strcmp($1, "createrole") == 0) $$ = makeDefElem("createrole", (Node *) makeBoolean(true), @1); else if (strcmp($1, "nocreaterole") == 0) $$ = makeDefElem("createrole", (Node *) makeBoolean(false), @1); else if (strcmp($1, "replication") == 0) $$ = makeDefElem("isreplication", (Node *) makeBoolean(true), @1); else if (strcmp($1, "noreplication") == 0) $$ = makeDefElem("isreplication", (Node *) makeBoolean(false), @1); else if (strcmp($1, "createdb") == 0) $$ = makeDefElem("createdb", (Node *) makeBoolean(true), @1); else if (strcmp($1, "nocreatedb") == 0) $$ = makeDefElem("createdb", (Node *) makeBoolean(false), @1); else if (strcmp($1, "login") == 0) $$ = makeDefElem("canlogin", (Node *) makeBoolean(true), @1); else if (strcmp($1, "nologin") == 0) $$ = makeDefElem("canlogin", (Node *) makeBoolean(false), @1); else if (strcmp($1, "bypassrls") == 0) $$ = makeDefElem("bypassrls", (Node *) makeBoolean(true), @1); else if (strcmp($1, "nobypassrls") == 0) $$ = makeDefElem("bypassrls", (Node *) makeBoolean(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 *) makeBoolean(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 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 opt_single_name 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 opt_single_name 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; } ; 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 minimum */ n->is_local = false; $$ = (Node *) n; } | PGPOOL set_rest_more { VariableSetStmt *n = $2; n->type = T_PgpoolQueryCacheStmt; /* Hack to keep changes minimum */ 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; } /* PGPOOL CACHE DELETE */ | SET CACHE DELETE_P Sconst { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = $4; /* query to delete query cache */ $$ = 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.ival.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 minimum */ $$ = (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 | FOREIGN TABLE ] variations * * Note: we accept all subcommands for each of the 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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->objtype = 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 FOREIGN TABLE relation_expr alter_table_cmds { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $4; n->cmds = $5; n->objtype = 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->objtype = OBJECT_FOREIGN_TABLE; n->missing_ok = true; $$ = (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; cmd->concurrent = false; n->def = (Node *) cmd; $$ = (Node *) n; } /* ALTER TABLE DETACH PARTITION [CONCURRENTLY] */ | DETACH PARTITION qualified_name opt_concurrently { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = $3; cmd->bound = NULL; cmd->concurrent = $4; n->def = (Node *) cmd; $$ = (Node *) n; } | DETACH PARTITION qualified_name FINALIZE { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartitionFinalize; cmd->name = $3; cmd->bound = NULL; cmd->concurrent = false; 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; cmd->concurrent = false; 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 EXPRESSION AS */ | ALTER opt_column ColId SET EXPRESSION AS '(' a_expr ')' { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetExpression; n->name = $3; n->def = $8; $$ = (Node *) n; } /* ALTER TABLE ALTER [COLUMN] DROP EXPRESSION */ | ALTER opt_column ColId DROP EXPRESSION { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = $3; $$ = (Node *) n; } /* ALTER TABLE ALTER [COLUMN] DROP EXPRESSION IF EXISTS */ | ALTER opt_column ColId DROP EXPRESSION IF_P EXISTS { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropExpression; n->name = $3; n->missing_ok = true; $$ = (Node *) n; } /* ALTER TABLE ALTER [COLUMN] SET STATISTICS */ | ALTER opt_column ColId SET STATISTICS set_statistics_value { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStatistics; n->name = $3; n->def = $6; $$ = (Node *) n; } /* ALTER TABLE ALTER [COLUMN] SET STATISTICS */ | ALTER opt_column Iconst SET STATISTICS set_statistics_value { 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 = $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 [, ... ] ) */ | 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 column_storage { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetStorage; n->name = $3; n->def = (Node *) makeString($5); $$ = (Node *) n; } /* ALTER TABLE ALTER [COLUMN] SET COMPRESSION */ | ALTER opt_column ColId SET column_compression { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetCompression; n->name = $3; n->def = (Node *) makeString($5); $$ = (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 ACCESS METHOD { | DEFAULT } */ | SET ACCESS METHOD set_access_method_name { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetAccessMethod; n->name = $4; $$ = (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_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); } ; set_statistics_value: SignedIconst { $$ = (Node *) makeInteger($1); } | DEFAULT { $$ = NULL; } ; set_access_method_name: ColId { $$ = $1; } | DEFAULT { $$ = NULL; } ; 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->objtype = 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 *) makeBoolean(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 *) makeBoolean(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 NOT NULL_P '*' { $$ = makeDefElem("force_not_null", (Node *) makeNode(A_Star), @1); } | FORCE NULL_P columnList { $$ = makeDefElem("force_null", (Node *) $3, @1); } | FORCE NULL_P '*' { $$ = makeDefElem("force_null", (Node *) makeNode(A_Star), @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); } | DEFAULT { $$ = (Node *) makeString("default"); } | '(' 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 opt_column_storage opt_column_compression create_generic_options ColQualList { ColumnDef *n = makeNode(ColumnDef); n->colname = $1; n->typeName = $2; n->storage_name = $3; n->compression = $4; 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 = $5; SplitColQualList($6, &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; } ; column_compression: COMPRESSION ColId { $$ = $2; } | COMPRESSION DEFAULT { $$ = pstrdup("default"); } ; opt_column_compression: column_compression { $$ = $1; } | /*EMPTY*/ { $$ = NULL; } ; column_storage: STORAGE ColId { $$ = $2; } | STORAGE DEFAULT { $$ = pstrdup("default"); } ; opt_column_storage: column_storage { $$ = $1; } | /*EMPTY*/ { $$ = NULL; } ; 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_unique_null_treatment opt_definition OptConsTableSpace { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->nulls_not_distinct = !$2; n->keys = NULL; n->options = $3; n->indexname = NULL; n->indexspace = $4; $$ = (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 = ($5)->updateAction->action; n->fk_del_action = ($5)->deleteAction->action; n->fk_del_set_cols = ($5)->deleteAction->cols; n->skip_validation = false; n->initially_valid = true; $$ = (Node *) n; } ; opt_unique_null_treatment: NULLS_P DISTINCT { $$ = true; } | NULLS_P NOT DISTINCT { $$ = false; } | /*EMPTY*/ { $$ = true; } ; 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; n->relationOid = InvalidOid; $$ = (Node *) n; } ; TableLikeOptionList: TableLikeOptionList INCLUDING TableLikeOption { $$ = $1 | $3; } | TableLikeOptionList EXCLUDING TableLikeOption { $$ = $1 & ~$3; } | /* EMPTY */ { $$ = 0; } ; TableLikeOption: COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; } | COMPRESSION { $$ = CREATE_TABLE_LIKE_COMPRESSION; } | 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 opt_unique_null_treatment '(' columnList ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->nulls_not_distinct = !$2; n->keys = $4; n->including = $6; n->options = $7; n->indexname = NULL; n->indexspace = $8; processCASbits($9, @9, "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 OptWhereClause 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 = ($10)->updateAction->action; n->fk_del_action = ($10)->deleteAction->action; n->fk_del_set_cols = ($10)->deleteAction->cols; processCASbits($11, @11, "FOREIGN KEY", &n->deferrable, &n->initdeferred, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; $$ = (Node *) n; } ; /* * DomainConstraint is separate from TableConstraint because the syntax for * NOT NULL constraints is different. For table constraints, we need to * accept a column name, but for domain constraints, we don't. (We could * accept something like NOT NULL VALUE, but that seems weird.) CREATE DOMAIN * (which uses ColQualList) has for a long time accepted NOT NULL without a * column name, so it makes sense that ALTER DOMAIN (which uses * DomainConstraint) does as well. None of these syntaxes are per SQL * standard; we are just living with the bits of inconsistency that have built * up over time. */ DomainConstraint: CONSTRAINT name DomainConstraintElem { Constraint *n = castNode(Constraint, $3); n->conname = $2; n->location = @1; $$ = (Node *) n; } | DomainConstraintElem { $$ = $1; } ; DomainConstraintElem: 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; } | NOT NULL_P ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = @1; n->keys = list_make1(makeString("value")); /* no NOT VALID support yet */ processCASbits($3, @3, "NOT NULL", NULL, NULL, NULL, &n->is_no_inherit, yyscanner); n->initially_valid = true; $$ = (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); } ; OptWhereClause: WHERE '(' a_expr ')' { $$ = $3; } | /*EMPTY*/ { $$ = NULL; } ; key_actions: key_update { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = $1; n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; $$ = n; } | key_delete { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = $1; $$ = n; } | key_update key_delete { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = $1; n->deleteAction = $2; $$ = n; } | key_delete key_update { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = $2; n->deleteAction = $1; $$ = n; } | /*EMPTY*/ { KeyActions *n = palloc(sizeof(KeyActions)); n->updateAction = palloc(sizeof(KeyAction)); n->updateAction->action = FKCONSTR_ACTION_NOACTION; n->updateAction->cols = NIL; n->deleteAction = palloc(sizeof(KeyAction)); n->deleteAction->action = FKCONSTR_ACTION_NOACTION; n->deleteAction->cols = NIL; $$ = n; } ; key_update: ON UPDATE key_action { if (($3)->cols) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("a column list with %s is only supported for ON DELETE actions", ($3)->action == FKCONSTR_ACTION_SETNULL ? "SET NULL" : "SET DEFAULT"), parser_errposition(@1))); $$ = $3; } ; key_delete: ON DELETE_P key_action { $$ = $3; } ; key_action: NO ACTION { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_NOACTION; n->cols = NIL; $$ = n; } | RESTRICT { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_RESTRICT; n->cols = NIL; $$ = n; } | CASCADE { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_CASCADE; n->cols = NIL; $$ = n; } | SET NULL_P opt_column_list { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETNULL; n->cols = $3; $$ = n; } | SET DEFAULT opt_column_list { KeyAction *n = palloc(sizeof(KeyAction)); n->action = FKCONSTR_ACTION_SETDEFAULT; n->cols = $3; $$ = n; } ; OptInherit: INHERITS '(' qualified_name_list ')' { $$ = $3; } | /*EMPTY*/ { $$ = NIL; } ; /* Optional partition key specification */ OptPartitionSpec: PartitionSpec { $$ = $1; } | /*EMPTY*/ { $$ = NULL; } ; PartitionSpec: PARTITION BY ColId '(' part_params ')' { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = parsePartitionStrategy($3); n->partParams = $5; n->location = @1; $$ = n; } ; part_params: part_elem { $$ = list_make1($1); } | part_params ',' part_elem { $$ = lappend($1, $3); } ; part_elem: ColId opt_collate opt_qualified_name { 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_qualified_name { 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_qualified_name { 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 name { $$ = $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 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. * * Statistics name is optional unless IF NOT EXISTS is specified. * *****************************************************************************/ CreateStatsStmt: CREATE STATISTICS opt_qualified_name opt_name_list ON stats_params 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 stats_params 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; } ; /* * Statistics attributes can be either simple column references, or arbitrary * expressions in parens. For compatibility with index attributes permitted * in CREATE INDEX, we allow an expression that's just a function call to be * written without parens. */ stats_params: stats_param { $$ = list_make1($1); } | stats_params ',' stats_param { $$ = lappend($1, $3); } ; stats_param: ColId { $$ = makeNode(StatsElem); $$->name = $1; $$->expr = NULL; } | func_expr_windowless { $$ = makeNode(StatsElem); $$->name = NULL; $$->expr = $1; } | '(' a_expr ')' { $$ = makeNode(StatsElem); $$->name = NULL; $$->expr = $2; } ; /***************************************************************************** * * QUERY : * ALTER STATISTICS [IF EXISTS] stats_name * SET STATISTICS * *****************************************************************************/ AlterStatsStmt: ALTER STATISTICS any_name SET STATISTICS set_statistics_value { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = $3; n->missing_ok = false; n->stxstattarget = $6; $$ = (Node *) n; } | ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS set_statistics_value { AlterStatsStmt *n = makeNode(AlterStatsStmt); n->defnames = $5; n->missing_ok = true; n->stxstattarget = $8; $$ = (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->objtype = 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->objtype = 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->objtype = 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->objtype = 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 *) makeBoolean(true), @1); } | NO CYCLE { $$ = makeDefElem("cycle", (Node *) makeBoolean(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 { $$ = (Node *) makeFloat($1); } | '+' FCONST { $$ = (Node *) makeFloat($2); } | '-' FCONST { Float *f = makeFloat($2); doNegateFloat(f); $$ = (Node *) f; } | SignedIconst { $$ = (Node *) 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 name { /* * We now interpret parameterless CREATE LANGUAGE as * CREATE EXTENSION. "OR REPLACE" is silently translated * to "IF NOT EXISTS", which isn't quite the same, but * seems more useful than throwing an error. We just * ignore TRUSTED, as the previous code would have too. */ CreateExtensionStmt *n = makeNode(CreateExtensionStmt); n->if_not_exists = $2; n->extname = $6; n->options = NIL; $$ = (Node *) n; } | CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name 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; } ; 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 ] * *****************************************************************************/ 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 { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE EXTENSION ... FROM is no longer supported"), parser_errposition(@1))); } | CASCADE { $$ = makeDefElem("cascade", (Node *) makeBoolean(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 object_type_name name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = $5; n->object = (Node *) makeString($6); $$ = (Node *) n; } | ALTER EXTENSION name add_drop object_type_any_name any_name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = $5; n->object = (Node *) $6; $$ = (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 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 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 name { 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 name { 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 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: * 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 opt_or_replace TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')' { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->replace = $2; n->isconstraint = false; n->trigname = $4; n->relation = $8; n->funcname = $14; n->args = $16; n->row = $10; n->timing = $5; n->events = intVal(linitial($6)); n->columns = (List *) lsecond($6); n->whenClause = $11; n->transitionRels = $9; n->deferrable = false; n->initdeferred = false; n->constrrel = NULL; $$ = (Node *) n; } | CREATE opt_or_replace 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->replace = $2; if (n->replace) /* not supported, see CreateTrigger */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE OR REPLACE CONSTRAINT TRIGGER is not supported"))); n->isconstraint = true; n->trigname = $5; n->relation = $9; n->funcname = $18; n->args = $20; n->row = true; n->timing = TRIGGER_TYPE_AFTER; n->events = intVal(linitial($7)); n->columns = (List *) lsecond($7); n->whenClause = $15; n->transitionRels = NIL; processCASbits($11, @11, "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); n->constrrel = $10; $$ = (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 { $$ = (Node *) makeString(psprintf("%d", $1)); } | FCONST { $$ = (Node *) makeString($1); } | Sconst { $$ = (Node *) makeString($1); } | ColLabel { $$ = (Node *) 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; } | ALTER TYPE_P any_name DROP VALUE_P Sconst { /* * The following problems must be solved before this can be * implemented: * * - There must be no instance of the target value in * any table. * * - The value must not appear in any catalog metadata, * such as stored view expressions or column defaults. * * - The value must not appear in any non-leaf page of a * btree (and similar issues with other index types). * This is problematic because a value could persist * there long after it's gone from user-visible data. * * - Concurrent sessions must not be able to insert the * value while the preceding conditions are being checked. * * - Possibly more... */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("dropping an enum value is not implemented"), parser_errposition(@4))); } ; 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 name 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 name { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = $4; n->amname = $6; $$ = (Node *) n; } ; AlterOpFamilyStmt: ALTER OPERATOR FAMILY any_name USING name 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 name 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 name 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 name 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 name 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 name 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 object_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 object_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 object_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 object_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/any_name_list */ object_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/name_list * * DROP handles some of them separately */ object_type_name: drop_type_name { $$ = $1; } | DATABASE { $$ = OBJECT_DATABASE; } | ROLE { $$ = OBJECT_ROLE; } | SUBSCRIPTION { $$ = OBJECT_SUBSCRIPTION; } | TABLESPACE { $$ = OBJECT_TABLESPACE; } ; drop_type_name: ACCESS METHOD { $$ = OBJECT_ACCESS_METHOD; } | EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; } | EXTENSION { $$ = OBJECT_EXTENSION; } | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; } | opt_procedural LANGUAGE { $$ = OBJECT_LANGUAGE; } | PUBLICATION { $$ = OBJECT_PUBLICATION; } | SCHEMA { $$ = OBJECT_SCHEMA; } | SERVER { $$ = OBJECT_FOREIGN_SERVER; } ; /* object types attached to a table */ object_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; } ; /***************************************************************************** * * COMMENT ON IS * *****************************************************************************/ CommentStmt: COMMENT ON object_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 COLUMN any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_COLUMN; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON object_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 object_type_name_on_any_name name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = $3; 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 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 OPERATOR CLASS any_name USING name 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 name 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; } ; comment_text: Sconst { $$ = $1; } | NULL_P { $$ = NULL; } ; /***************************************************************************** * * SECURITY LABEL [FOR ] ON IS